Exemplo n.º 1
0
 /// <summary>
 /// saves the provider information
 /// </summary>
 internal void SaveProviderInfo()
 {
     if (!Object.ReferenceEquals(CurrentProvider, null))
     {
         var localSetting = GetStorageSetting();
         localSetting.Values[GatewayHttpInterface.ProviderKey] = GatewayHttpInterface.EncodeToBytes <RecogEngine>(CurrentProvider);
         VMHub.CurrentProvider = CurrentProvider;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// saves the domain information
 /// </summary>
 internal void SaveDomainInfo()
 {
     if (!Object.ReferenceEquals(CurrentDomain, null))
     {
         var localSetting = GetStorageSetting();
         localSetting.Values[GatewayHttpInterface.DomainKey] = GatewayHttpInterface.EncodeToBytes <RecogInstance>(CurrentDomain);
         VMHub.CurrentDomain = CurrentDomain;
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Save information of gateway to local storage
        /// </summary>
        /// <param name="gateway"></param>
        /// <param name="gatewayCollection"></param>
        public void SaveGatewayInfo(String gateway, List <OneServerInfo> gatewayCollection)
        {
            var localSetting = GetStorageSetting();

            localSetting.Values[GatewayHttpInterface.GatewayKey] = gateway;
            var arr = gatewayCollection.ToArray();

            localSetting.Values[GatewayHttpInterface.GatewayCollectionKey] = GatewayHttpInterface.EncodeToBytes <OneServerInfo[]>(arr);
            CurrentGateway       = gateway;
            VMHub.CurrentGateway = gateway;
            GatewayCollection.Clear();
            foreach (var info in gatewayCollection)
            {
                GatewayCollection.GetOrAdd(info.HostName, info.HostInfo);
            }
            GatewayCollection.GetOrAdd(this.CurrentGateway, "Default");
        }