예제 #1
0
 void SaveToFile(FullConfiguration fullConfiguration, string fileName)
 {
     var dataContractSerializer = new DataContractSerializer(typeof(FullConfiguration));
     using (var fileStream = new FileStream(fileName, FileMode.Create))
     {
         dataContractSerializer.WriteObject(fileStream, fullConfiguration);
     }
 }
예제 #2
0
 void CopyTo(FullConfiguration fullConfiguration)
 {
     FiresecManager.FiresecConfiguration.DeviceConfiguration = fullConfiguration.DeviceConfiguration;
     if (FiresecManager.FiresecConfiguration.DeviceConfiguration == null)
         FiresecManager.FiresecConfiguration.SetEmptyConfiguration();
     FiresecManager.LibraryConfiguration = fullConfiguration.LibraryConfiguration;
     FiresecManager.PlansConfiguration = fullConfiguration.PlansConfiguration;
     FiresecManager.SecurityConfiguration = fullConfiguration.SecurityConfiguration;
     FiresecManager.SystemConfiguration = fullConfiguration.SystemConfiguration;
     XManager.DeviceConfiguration = fullConfiguration.XDeviceConfiguration;
     if (XManager.DeviceConfiguration == null)
         XManager.SetEmptyConfiguration();
 }