예제 #1
0
 void Clone(XeroConfiguration configObj)
 {
     this.AccessDeniedHTML   = configObj.AccessDeniedHTML;
     this.AccessGrantedHTML  = configObj.AccessGrantedHTML;
     this.AccessTokenSet     = configObj.AccessTokenSet;
     this.AutoSelectTenant   = configObj.AutoSelectTenant;
     this.CallbackUri        = configObj.CallbackUri;
     this.ClientID           = configObj.ClientID;
     this.codeVerifier       = configObj.codeVerifier;
     this.ReturnedAccessCode = configObj.ReturnedAccessCode;
     this.ReturnedState      = configObj.ReturnedState;
     this.Scopes             = configObj.Scopes;
     this.SelectedTenant     = configObj.SelectedTenant;
     this.State = configObj.State;
     this.StoreReceivedScope = configObj.StoreReceivedScope;
 }
예제 #2
0
 /// <summary>
 /// Provide ability to create the config from a loaded Json string
 /// </summary>
 /// <param name="jsonStringOrFilePath">The string containing the Configuration record or a valid file path to a saved Configuration </param>
 /// <returns>XeroConfiguration object <see cref="XeroConfiguration"/></returns>
 public XeroConfiguration(string jsonStringOrFilePath)
 {
     try
     {
         if (System.IO.File.Exists(jsonStringOrFilePath))
         {
             // Thi parameter passed is a valid file so load it and Deserialize
             string            content   = Common.ReadTextFile(jsonStringOrFilePath);
             XeroConfiguration newConfig = Common.DeSerializeObject <XeroConfiguration>(content);
             Clone(newConfig);
         }
         else
         {
             XeroConfiguration newConfig = Common.DeSerializeObject <XeroConfiguration>(jsonStringOrFilePath);
             Clone(newConfig);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }