Пример #1
0
        private ProcessorOptions_v4 SerializeProcessorOptions(UserData user, IProcessorArchitecture architecture)
        {
            if (architecture == null)
            {
                return(null);
            }
            var options = architecture.SaveUserOptions();

            if (string.IsNullOrEmpty(user.Processor) && options == null)
            {
                return(null);
            }
            else
            {
                var doc   = new XmlDocument();
                var xml   = SerializeValue(options, doc);
                var elems = xml != null
                    ? xml.ChildNodes.OfType <XmlElement>().ToArray()
                    : new XmlElement[0];

                return(new ProcessorOptions_v4 {
                    Name = user.Processor,
                    Options = elems
                });
            }
        }
Пример #2
0
 private ProcessorOptions_v4 SerializeProcessorOptions(UserData user, IProcessorArchitecture architecture)
 {
     if (architecture == null)
         return null;
     var options = architecture.SaveUserOptions();
     if (string.IsNullOrEmpty(user.Processor) && options == null)
         return null;
     else
     {
         var doc = new XmlDocument();
         var xml = SerializeValue(options, doc);
         var elems = xml != null
             ? xml.ChildNodes.OfType<XmlElement>().ToArray()
             : new XmlElement[0];
         return new ProcessorOptions_v4 {
             Name = user.Processor,
             Options = elems
         };
     }
 }