public string GetOrionDiscoveryJobDescriptionString(
            OrionDiscoveryJobDescription discoveryJobDescription,
            List <DiscoveryPluginInfo> pluginInfos,
            bool jsonFormat = false)
        {
            if (jsonFormat)
            {
                return(SerializationHelper.ToJson((object)discoveryJobDescription));
            }
            DiscoveryPluginInfoCollection pluginInfoCollection1 = new DiscoveryPluginInfoCollection();

            pluginInfoCollection1.set_PluginInfos(pluginInfos);
            DiscoveryPluginInfoCollection pluginInfoCollection2 = pluginInfoCollection1;
            List <Type> typeList = new List <Type>();

            using (List <DiscoveryPluginJobDescriptionBase> .Enumerator enumerator = discoveryJobDescription.get_DiscoveryPluginJobDescriptions().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    DiscoveryPluginJobDescriptionBase current = enumerator.Current;
                    if (!typeList.Contains(((object)current).GetType()))
                    {
                        typeList.Add(((object)current).GetType());
                    }
                }
            }
            return(SerializationHelper.XmlWrap(new List <string>()
            {
                SerializationHelper.ToXmlString((object)pluginInfoCollection2),
                SerializationHelper.ToXmlString((object)discoveryJobDescription, (IEnumerable <Type>)typeList)
            }));
        }
        public void GetOrionDiscoveryJobDescriptionXml(
            OrionDiscoveryJobDescription discoveryJobDescription,
            List <DiscoveryPluginInfo> pluginInfos,
            XmlWriter xmlWriter)
        {
            IEnumerable <Type> types = ((IEnumerable <DiscoveryPluginJobDescriptionBase>)discoveryJobDescription.get_DiscoveryPluginJobDescriptions()).Select <DiscoveryPluginJobDescriptionBase, Type>((Func <DiscoveryPluginJobDescriptionBase, Type>)(pjd => ((object)pjd).GetType())).Distinct <Type>();

            XmlReader[] xmlReaderArray = new XmlReader[2];
            DiscoveryPluginInfoCollection pluginInfoCollection = new DiscoveryPluginInfoCollection();

            pluginInfoCollection.set_PluginInfos(pluginInfos);
            xmlReaderArray[0] = SerializationHelper.ToXmlReader((object)pluginInfoCollection);
            xmlReaderArray[1] = SerializationHelper.ToXmlReader((object)discoveryJobDescription, types);
            SerializationHelper.XmlWrap((IEnumerable <XmlReader>)xmlReaderArray, xmlWriter);
        }