/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Thrift;
using Thrift.Collections;
using System.Runtime.Serialization;
using Thrift.Protocol;
using Thrift.Transport;

namespace ThriftInterface
{

  #if !SILVERLIGHT
  [Serializable]
  #endif
  public partial class Settings : TBase
  {
    private string _StoredUserName;
    private string _StoredPassword;
    private bool _RememberMe;
    private string _ArchivesFolder;
    private string _CertificatesFolder;

    public string StoredUserName
    {
      get
      {
        return _StoredUserName;
      }
      set
      {
        __isset.StoredUserName = true;
        this._StoredUserName = value;
      }
    }

    public string StoredPassword
    {
      get
      {
        return _StoredPassword;
      }
      set
      {
        __isset.StoredPassword = true;
        this._StoredPassword = value;
      }
    }

    public bool RememberMe
    {
      get
      {
        return _RememberMe;
      }
      set
      {
        __isset.RememberMe = true;
        this._RememberMe = value;
      }
    }

    public string ArchivesFolder
    {
      get
      {
        return _ArchivesFolder;
      }
      set
      {
        __isset.ArchivesFolder = true;
        this._ArchivesFolder = value;
      }
    }

    public string CertificatesFolder
    {
      get
      {
        return _CertificatesFolder;
      }
      set
      {
        __isset.CertificatesFolder = true;
        this._CertificatesFolder = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT
    [Serializable]
    #endif
    public struct Isset {
      public bool StoredUserName;
      public bool StoredPassword;
      public bool RememberMe;
      public bool ArchivesFolder;
      public bool CertificatesFolder;
    }

    public Settings() {
    }

    public void Read (TProtocol iprot)
    {
      TField field;
      iprot.ReadStructBegin();
      while (true)
      {
        field = iprot.ReadFieldBegin();
        if (field.Type == TType.Stop) { 
          break;
        }
        switch (field.ID)
        {
          case 1:
            if (field.Type == TType.String) {
              StoredUserName = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 2:
            if (field.Type == TType.String) {
              StoredPassword = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 3:
            if (field.Type == TType.Bool) {
              RememberMe = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 4:
            if (field.Type == TType.String) {
              ArchivesFolder = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 5:
            if (field.Type == TType.String) {
              CertificatesFolder = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          default: 
            TProtocolUtil.Skip(iprot, field.Type);
            break;
        }
        iprot.ReadFieldEnd();
      }
      iprot.ReadStructEnd();
    }

    public void Write(TProtocol oprot) {
      TStruct struc = new TStruct("Settings");
      oprot.WriteStructBegin(struc);
      TField field = new TField();
      if (StoredUserName != null && __isset.StoredUserName) {
        field.Name = "StoredUserName";
        field.Type = TType.String;
        field.ID = 1;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(StoredUserName);
        oprot.WriteFieldEnd();
      }
      if (StoredPassword != null && __isset.StoredPassword) {
        field.Name = "StoredPassword";
        field.Type = TType.String;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(StoredPassword);
        oprot.WriteFieldEnd();
      }
      if (__isset.RememberMe) {
        field.Name = "RememberMe";
        field.Type = TType.Bool;
        field.ID = 3;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(RememberMe);
        oprot.WriteFieldEnd();
      }
      if (ArchivesFolder != null && __isset.ArchivesFolder) {
        field.Name = "ArchivesFolder";
        field.Type = TType.String;
        field.ID = 4;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(ArchivesFolder);
        oprot.WriteFieldEnd();
      }
      if (CertificatesFolder != null && __isset.CertificatesFolder) {
        field.Name = "CertificatesFolder";
        field.Type = TType.String;
        field.ID = 5;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(CertificatesFolder);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("Settings(");
      sb.Append("StoredUserName: ");
      sb.Append(StoredUserName);
      sb.Append(",StoredPassword: ");
      sb.Append(StoredPassword);
      sb.Append(",RememberMe: ");
      sb.Append(RememberMe);
      sb.Append(",ArchivesFolder: ");
      sb.Append(ArchivesFolder);
      sb.Append(",CertificatesFolder: ");
      sb.Append(CertificatesFolder);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
