示例#1
0
 /// <summary>
 /// Saves the configuration.
 /// </summary>
 /// <param name="configurationFile">The configuration file.</param>
 /// <exception cref="ArgumentNullException"></exception>
 public void SaveConfiguration(FileInfo configurationFile)
 {
     if (CurrentConfiguration == null)
     {
         throw new ArgumentNullException(nameof(CurrentConfiguration));
     }
     ConfigurationDataFactoryIO.Save <ConfigurationDataType>(CurrentConfiguration, Properties.Settings.Default.Serializer.ToUpper() == "XML" ? SerializerType.Xml : SerializerType.Json, configurationFile, (x, y, z) => TraceSource.TraceData(x, y, z));
 }
示例#2
0
 /// <summary>
 /// Reads the configuration from the <see cref="FileInfo"/>.
 /// </summary>
 /// <param name="configurationFile">The file <see cref="FileInfo"/> containing the configuration data of the UANetworking application.</param>
 public void ReadConfiguration(FileInfo configurationFile)
 {
     CurrentConfiguration = ConfigurationDataFactoryIO.Load <ConfigurationDataType>
                                (Properties.Settings.Default.Serializer.ToUpper() == "XML" ? SerializerType.Xml : SerializerType.Json, configurationFile, (x, y, z) => TraceSource.TraceData(x, y, z), () => RaiseOnChangeEvent());
 }
 /// <summary>
 /// Gets the configuration.
 /// </summary>
 /// <returns>Am object of <see cref="ConfigurationData" /> type capturing the communication configuration.</returns>
 public ConfigurationData GetConfiguration()
 {
     Configuration = ConfigurationDataFactoryIO.Load <ConfigurationType>(Loader, RaiseEvents);
     return(Configuration.GetConfigurationData());
 }
 private ConfigurationType LoadConfig()
 {
     return(ConfigurationDataFactoryIO.Load <ConfigurationType>(() => XmlDataContractSerializers.Load <ConfigurationType>(m_ConfigurationFileInformation, TraceData), () => RaiseEvents()));
 }
 /// <summary>
 /// Gets the configuration.
 /// </summary>
 /// <returns>Am object of <see cref="ConfigurationData" /> type capturing the communication configuration.</returns>
 public ConfigurationData GetConfiguration()
 {
     return(ConfigurationDataFactoryIO.Load(Loader, RaiseEvents));
 }