Esempio n. 1
0
        public unsafe void ReadXml(XmlReader reader)
        {
            var tl = reader.Deserialize <Position>();
            var br = reader.Deserialize <Position>();

            fixed(Position *topLeft = &TopLeft)
            * topLeft = tl;

            fixed(Position *bottomRight = &BottomRight)
            * bottomRight = br;
        }
Esempio n. 2
0
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            if (null == reader)
            {
                throw new ArgumentNullException("reader");
            }

            if (reader.IsEmptyElement)
            {
                reader.Read();
                return;
            }

            var name = reader.Name;

            while (reader.Read())
            {
#if NET20
                if (XmlReaderExtensionMethods.IsEndElement(reader, name))
#else
                if (reader.IsEndElement(name))
#endif
                {
                    reader.Read();
                    break;
                }

                while (XmlNodeType.Element == reader.NodeType)
                {
                    switch (reader.Name)
                    {
                    case "directories":
#if NET20
                        Directories = XmlReaderExtensionMethods.Deserialize <DirectoryCollection>(reader);
#else
                        Directories = reader.Deserialize <DirectoryCollection>();
#endif
                        break;

                    case "files":
#if NET20
                        Files = XmlReaderExtensionMethods.Deserialize <FileCollection>(reader);
#else
                        Files = reader.Deserialize <FileCollection>();
#endif
                        break;
                    }
                }
            }
        }
Esempio n. 3
0
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            if (null == reader)
            {
                throw new ArgumentNullException("reader");
            }

            if (reader.IsEmptyElement)
            {
                reader.Read();
                return;
            }

            var name = reader.Name;
            while (reader.Read())
            {
#if NET20
                if (XmlReaderExtensionMethods.IsEndElement(reader, name))
#else
                if (reader.IsEndElement(name))
#endif
                {
                    reader.Read();
                    break;
                }

                while (XmlNodeType.Element == reader.NodeType)
                {
                    switch (reader.Name)
                    {
                        case "directories":
#if NET20
                            Directories = XmlReaderExtensionMethods.Deserialize<DirectoryCollection>(reader);
#else
                            Directories = reader.Deserialize<DirectoryCollection>();
#endif
                            break;
                        case "files":
#if NET20
                            Files = XmlReaderExtensionMethods.Deserialize<FileCollection>(reader);
#else
                            Files = reader.Deserialize<FileCollection>();
#endif
                            break;
                    }
                }
            }
        }
        public virtual void ReadXml(XmlReader reader)
        {
            if (null == reader)
            {
                throw new ArgumentNullException("reader");
            }

            if (reader.IsEmptyElement)
            {
                reader.Read();
                return;
            }

            var name = reader.Name;

            while (reader.Read())
            {
                if (XmlNodeType.EndElement == reader.NodeType &&
                    reader.Name == name)
                {
                    reader.Read();
                    break;
                }

                while (XmlNodeType.Element == reader.NodeType)
                {
#if NET20
                    Add(XmlReaderExtensionMethods.Deserialize <T>(reader));
#else
                    Add(reader.Deserialize <T>());
#endif
                }
            }
        }
Esempio n. 5
0
        public void ReadXml(XmlReader reader)
        {
            var isEmpty = reader.IsEmptyElement;

            // Read past the property element
            reader.Read();

            // For an empty list in Settings.Default
            if (isEmpty)
            {
                return;
            }

            // Read list items
            var list = new List <AutoQcConfig>();

            while (reader.IsStartElement())
            {
                list.Add(reader.Deserialize(new AutoQcConfig()));
                reader.Read();
            }

            Clear();
            foreach (var config in list)
            {
                Add(config);
            }
        }
Esempio n. 6
0
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            var blocks = new Dictionary <string, (int x, int y, Size size)>();

            while (reader.Read())
            {
                if (reader.NodeType is XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                    case "Header":
                        reader.ReadSubTree(ReadHeader);
                        break;

                    case "Blocks":
                        reader.ReadSubTree(ReadBlocks);
                        break;

                    case "Entities":
                        reader.ReadSubTree(ReadEntities);
                        return;
                    }
                }
            }

            void ReadHeader(XmlReader reader)
            {
                var setName = false;
                var setSize = false;

                while (!(setName && setSize) && reader.Read())
                {
                    if (reader.NodeType is XmlNodeType.Element)
                    {
                        if (reader.Name is nameof(Name))
                        {
                            var name = reader.ReadElementContentAsString();
                            Helper.ModifyReadOnlyProperty(() => Name, name);

                            if (setSize)
                            {
                                break;
                            }
                            setName = true;
                        }
                        else if (reader.Name is nameof(Size))
                        {
                            var size = reader.Deserialize <Size>();
                            Helper.ModifyReadOnlyProperty(() => Size, size);
                            Helper.ModifyReadOnlyProperty(() => Blocks, new BlockType[Size.Width, Size.Height]);

                            if (setName)
                            {
                                break;
                            }
                            setSize = true;
                        }
                    }
                }
            }
Esempio n. 7
0
    void Start()
    {
        fileLoader = new FileLoader();
        xmlReader = new XmlReader();
        dialogue = new DialogueReader();
        textSpoken.text = "";

        string data = fileLoader.Load("TestDialogue.xml");

        Dialogue d = xmlReader.Deserialize<Dialogue>(data) as Dialogue;

        dialogue.SetDialogue(d);
    }
Esempio n. 8
0
        public void OnAttached(Activity activity)
        {
            var actionBar = activity.GetActionBar();

            if (actionBar == null)
            {
                Tracer.Error("Cannot apply ActionBarView the ActionBar is null, activity {0}", activity.GetType().FullName);
                return;
            }

            var activityView = activity as IActivityView;

            if (activityView != null)
            {
                activityView.Mediator.Destroyed += DestroyedHandler;
            }

            if (_resourceId != int.MinValue)
            {
                if (_tabContentId != int.MinValue)
                {
                    ServiceProvider.AttachedValueProvider.SetValue(actionBar, ActionBarTemplate.TabContentIdKey, _tabContentId);
                }


                object templateObj;
                if (!TemplateCache.TryGetValue(_resourceId, out templateObj))
                {
                    using (XmlReader reader = Context.Resources.GetLayout(_resourceId))
                    {
                        templateObj = reader.Deserialize <ActionBarTemplate>();
                        TemplateCache[_resourceId] = templateObj;
                    }
                }
                ((ActionBarTemplate)templateObj).Apply(activity);
            }

            if (string.IsNullOrEmpty(_bind))
            {
                return;
            }
            BindingServiceProvider.BindingProvider.CreateBindingsFromString(actionBar, _bind, null);
            this.ClearBindingsRecursively(true, true, AndroidToolkitExtensions.AggressiveViewCleanup);
            this.RemoveFromParent();
        }
Esempio n. 9
0
 public static RCalcIrt Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new RCalcIrt()));
 }
Esempio n. 10
0
 public static AnnotationExpression Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new AnnotationExpression()));
 }
Esempio n. 11
0
 public static MeasuredIon Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new MeasuredIon()));
 }
Esempio n. 12
0
 public static SrmSettings Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new SrmSettings());
 }
Esempio n. 13
0
 public static PeptideModifications Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideModifications());
 }
Esempio n. 14
0
 public new static BackgroundProteome Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new BackgroundProteome()));
 }
Esempio n. 15
0
 public static SpectrastLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new SpectrastLibrary()));
 }
Esempio n. 16
0
 public static MProphetPeakScoringModel Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new MProphetPeakScoringModel());
 }
Esempio n. 17
0
 // ReSharper restore MemberHidesStaticFromOuterClass
 // ReSharper disable MemberHidesStaticFromOuterClass
 public static FeatureCalculator Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new FeatureCalculator());
 }
Esempio n. 18
0
 public static PeptideLibraries Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideLibraries());
 }
Esempio n. 19
0
 public static PeptideIntegration Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideIntegration(null));
 }
Esempio n. 20
0
 public static PeptideSettings Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideSettings());
 }
Esempio n. 21
0
 public static PeptidePrediction Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptidePrediction());
 }
Esempio n. 22
0
 public static PeptideFilter Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideFilter());
 }
Esempio n. 23
0
 public static IsotopeEnrichments Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new IsotopeEnrichments()));
 }
Esempio n. 24
0
 public static ReportSpec Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ReportSpec()));
 }
Esempio n. 25
0
 public static IonMobilityLibrary Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IonMobilityLibrary());
 }
Esempio n. 26
0
 public static LegacyScoringModel Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new LegacyScoringModel()));
 }
Esempio n. 27
0
 public static Enzyme Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new Enzyme());
 }
Esempio n. 28
0
 public static XHunterLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new XHunterLibrary()));
 }
Esempio n. 29
0
 public static PeptideExcludeRegex Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideExcludeRegex());
 }
Esempio n. 30
0
 public static DigestSettings Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new DigestSettings());
 }
Esempio n. 31
0
 public static MeasuredIon Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new MeasuredIon());
 }
Esempio n. 32
0
 public static IsotopeEnrichments Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IsotopeEnrichments());
 }
Esempio n. 33
0
 public static FragmentLoss Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new FragmentLoss());
 }
Esempio n. 34
0
 public static ChromLibSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ChromLibSpectrumHeaderInfo()));
 }
Esempio n. 35
0
 public static RetentionTimeSource Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new RetentionTimeSource());
 }
Esempio n. 36
0
 public static IsolationScheme Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new IsolationScheme()));
 }
Esempio n. 37
0
 public static StaticMod Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new StaticMod());
 }
Esempio n. 38
0
 public static ToolDescription Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ToolDescription()));
 }
Esempio n. 39
0
 public static BiblioSpecSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new BiblioSpecSpectrumHeaderInfo());
 }
Esempio n. 40
0
// ReSharper disable MemberHidesStaticFromOuterClass
        public static FeatureCalculator Deserialize(XmlReader reader)
// ReSharper restore MemberHidesStaticFromOuterClass
        {
            return(reader.Deserialize(new FeatureCalculator()));
        }
Esempio n. 41
0
 public static BiblioSpecSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new BiblioSpecSpectrumHeaderInfo()));
 }
Esempio n. 42
0
 public static SpectrastSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new SpectrastSpectrumHeaderInfo()));
 }
Esempio n. 43
0
 public static BiblioSpecLibSpec Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new BiblioSpecLibSpec());
 }
Esempio n. 44
0
 public static SpectrastSpec Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new SpectrastSpec()));
 }
Esempio n. 45
0
 public static LegacyScoringModel Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new LegacyScoringModel());
 }
Esempio n. 46
0
 public static ChromatogramLibrarySpec Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ChromatogramLibrarySpec()));
 }
Esempio n. 47
0
 public static MProphetPeakScoringModel Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new MProphetPeakScoringModel()));
 }
Esempio n. 48
0
 public static XHunterSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new XHunterSpectrumHeaderInfo()));
 }
Esempio n. 49
0
 public static IsolationScheme Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IsolationScheme());
 }
Esempio n. 50
0
 public static ProgramPathContainer Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ProgramPathContainer()));
 }
 public static BackgroundProteomeSpec Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new BackgroundProteomeSpec());
 }
Esempio n. 52
0
 public static BiblioSpecLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new BiblioSpecLibrary()));
 }
Esempio n. 53
0
 public static OptimizationLibrary Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new OptimizationLibrary());
 }
Esempio n. 54
0
 public static OptimizationLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new OptimizationLibrary()));
 }
Esempio n. 55
0
 public static ChromatogramSet Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new ChromatogramSet());
 }
Esempio n. 56
0
 public static DocumentRetentionTimes Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new DocumentRetentionTimes()));
 }
Esempio n. 57
0
 public static RCalcIrt Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new RCalcIrt());
 }
Esempio n. 58
0
 public static FragmentLoss Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new FragmentLoss()));
 }
Esempio n. 59
0
 public static IsolationWindow Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IsolationWindow());
 }