예제 #1
0
        internal void Init(string configpath)
        {
            string      xmlString = System.IO.File.ReadAllText(configpath, System.Text.Encoding.UTF8);
            XmlReader   xmlReader = new XmlReader();
            CloudConfig config    = xmlReader.Deserialize <CloudConfig>(xmlString);

            Init(config);
        }
예제 #2
0
 void Init(CloudConfig config)
 {
     this.CurrentApp = config.App;
     appService      = new XService(config.Authcenter);                                          //app授权中心
     appService.RefreshHttp(new XHttpClient(config.Authcenter.AppID, config.Authcenter.Origin)); //创建连接
     if (config.Dependencies != null)
     {
         TokenProvider tokenProvider = new TokenProvider(appService); //Token刷新器
         foreach (ServiceInfo serviceInfo in config.Dependencies)
         {
             XService xService = new XService(serviceInfo)
             {
                 TokenProvider = tokenProvider
             };
             DicServices[serviceInfo.AppID] = xService;
         }
     }
 }