/*
 * Automatically generated by jrpcgen 1.0.7 on 29.11.2012
 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C#
 * See http://remotetea.sourceforge.net for details
 */
using NFSLibrary.Protocols.Commons;
using org.acplt.oncrpc;

namespace NFSLibrary.Protocols.V2.RPC.Mount
{
    public class MountStatus : XdrAble
    {
        private NFSMountStats _status;
        private NFSHandle _handle;

        public MountStatus()
        { }

        public MountStatus(XdrDecodingStream xdr)
        { xdrDecode(xdr); }

        public void xdrEncode(XdrEncodingStream xdr)
        {
            xdr.xdrEncodeInt((int)this._status);

            switch (this._status)
            {
                case NFSMountStats.MNT_OK:
                    this._handle.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                    this._handle.xdrEncode(xdr);
                    break;
                default:
                    break;
            }
        }

        public void xdrDecode(XdrDecodingStream xdr)
        {
            this._status = (NFSMountStats)xdr.xdrDecodeInt();

            switch (this._status)
            {
                case NFSMountStats.MNT_OK:
                    this._handle = new NFSHandle();
                    this._handle.Version = V2.RPC.NFSv2Protocol.NFS_VERSION;
                    this._handle.xdrDecode(xdr);

                    break;
                default:
                    break;
            }
        }

        public NFSHandle Handle
        {
            get
            { return this._handle; }
        }

        public NFSMountStats Status
        {
            get
            { return this._status; }
        }
    }
    // End of fhstatus.cs
}