Esempio n. 1
0
        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.I32)
                    {
                        this.errorCode         = (EDAMErrorCode)iprot.ReadI32();
                        this.__isset.errorCode = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        this.message         = iprot.ReadString();
                        this.__isset.message = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
Esempio n. 2
0
        internal static AuthenticationResult Authenticate(String username, String password, String consumerKey, String consumerSecret, String evernoteHost, UserStore.Client userStore)
        {
            AuthenticationResult authResult;

            try
            {
                authResult = userStore.authenticate(username, password, consumerKey, consumerSecret);
            }
            catch (EDAMUserException ex)
            {
                String        parameter = ex.Parameter;
                EDAMErrorCode errorCode = ex.ErrorCode;

                if (parameter.ToLower() == "consumerkey")
                {
                    throw new ApplicationException("API Key Missing. \r\n Please download latest en2ki release from homepage");
                }
                else
                {
                    throw new ApplicationException(String.Format("Authentication Failed \r\n (Make sure {0} is correct)", parameter));
                }
            }
            return(authResult);
        }
Esempio n. 3
0
 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.I32) {
       this.errorCode = (EDAMErrorCode)iprot.ReadI32();
       this.__isset.errorCode = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 2:
     if (field.Type == TType.String) {
       this.parameter = iprot.ReadString();
       this.__isset.parameter = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       default:
     TProtocolUtil.Skip(iprot, field.Type);
     break;
     }
     iprot.ReadFieldEnd();
       }
       iprot.ReadStructEnd();
 }
 public EDAMSystemException(EDAMErrorCode errorCode) : this()
 {
     this.ErrorCode = errorCode;
 }
Esempio n. 5
0
 public EDAMUserException(EDAMErrorCode errorCode) : this()
 {
     this.ErrorCode = errorCode;
 }