コード例 #1
0
        public WindowsPhoneIO()
        {
            MethodList = new List<MethodInvoker>(WindowsPhoneUtils.GetMethodInvokersList(this));
            IOUserAgent = "Unity 1.0";
            var pendingTask = Task.Run(async () =>
            {
                _servicesConfigObject = await GetServicesConfig();
            });

            pendingTask.Wait();
        }
コード例 #2
0
ファイル: AbstractIO.cs プロジェクト: thomascLM/appverse-core
 /// <summary>
 ///
 /// </summary>
 protected void LoadServicesConfig()
 {
     try {               // FileStream to read the XML document.
         Stream fs = GetConfigFileStream();
         if (fs != null)
         {
             XmlSerializer serializer = new XmlSerializer(typeof(IOServicesConfig));
             servicesConfig = (IOServicesConfig)serializer.Deserialize(new MemoryStream(((MemoryStream)fs).GetBuffer()));
         }
     } catch (Exception e) {
         SystemLogger.Log(SystemLogger.Module.CORE, "Error when loading services configuration", e);
     }
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 protected void LoadServicesConfig()
 {
     try {   // FileStream to read the XML document.
         byte[] configFileRawData = GetConfigFileBinaryData();
         if (configFileRawData != null)
         {
             XmlSerializer serializer = new XmlSerializer(typeof(IOServicesConfig));
             servicesConfig = (IOServicesConfig)serializer.Deserialize(new MemoryStream(configFileRawData));
         }
     } catch (Exception e) {
         SystemLogger.Log(SystemLogger.Module.CORE, "Error when loading services configuration", e);
         servicesConfig = new IOServicesConfig(); // reset services config mapping when the services could not be loaded for any reason
     }
 }
コード例 #4
0
 /// <summary>
 /// 
 /// </summary>
 protected void LoadServicesConfig()
 {
     servicesConfig = new IOServicesConfig(); // reset services config mapping when the services could not be loaded for any reason
     try
     {   // FileStream to read the XML document.
         byte[] configFileRawData = GetConfigFileBinaryData();
         if (configFileRawData != null)
         {
             XmlSerializer serializer = new XmlSerializer(typeof(IOServicesConfig));
             servicesConfig = (IOServicesConfig)serializer.Deserialize(new MemoryStream(configFileRawData));
         }
     }
     catch (Exception e)
     {
         SystemLogger.Log(SystemLogger.Module.CORE, "Error when loading services configuration", e);
     }
 }
コード例 #5
0
 public override async Task<IOService> GetService(string name)
 {
     if (_servicesConfigObject == null) _servicesConfigObject = await GetServicesConfig();
     return _servicesConfigObject != null ? _servicesConfigObject.Services.First(serv => serv.Name.Equals(name)) : null;
 }
コード例 #6
0
 private async Task<IOServicesConfig> GetServicesConfig()
 {
     if (_servicesConfigObject != null) return _servicesConfigObject;
     var IOConfigStorageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(SERVICES_CONFIG_FILE));
     var serializer = new XmlSerializer(typeof(IOServicesConfig));
     var reader = XmlReader.Create(await IOConfigStorageFile.OpenStreamForReadAsync());
     _servicesConfigObject = (IOServicesConfig)serializer.Deserialize(reader);
     return _servicesConfigObject;
 }
コード例 #7
0
ファイル: AbstractIO.cs プロジェクト: thomascLM/appverse-core
 /// <summary>
 /// 
 /// </summary>
 protected void LoadServicesConfig()
 {
     try {   // FileStream to read the XML document.
         Stream fs = GetConfigFileStream ();
         if (fs != null) {
             XmlSerializer serializer = new XmlSerializer (typeof(IOServicesConfig));
             servicesConfig = (IOServicesConfig)serializer.Deserialize (new MemoryStream (((MemoryStream)fs).GetBuffer ()));
         }
     } catch (Exception e) {
         SystemLogger.Log (SystemLogger.Module .CORE, "Error when loading services configuration", e);
     }
 }