Example #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;
        }
Example #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;
                    }
                }
            }
        }
Example #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
                }
            }
        }
Example #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);
            }
        }
Example #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;
                        }
                    }
                }
            }
Example #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);
    }
Example #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();
        }
Example #9
0
 public static RCalcIrt Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new RCalcIrt()));
 }
Example #10
0
 public static AnnotationExpression Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new AnnotationExpression()));
 }
Example #11
0
 public static MeasuredIon Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new MeasuredIon()));
 }
Example #12
0
 public static SrmSettings Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new SrmSettings());
 }
Example #13
0
 public static PeptideModifications Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideModifications());
 }
Example #14
0
 public new static BackgroundProteome Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new BackgroundProteome()));
 }
Example #15
0
 public static SpectrastLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new SpectrastLibrary()));
 }
 public static MProphetPeakScoringModel Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new MProphetPeakScoringModel());
 }
Example #17
0
 // ReSharper restore MemberHidesStaticFromOuterClass
 // ReSharper disable MemberHidesStaticFromOuterClass
 public static FeatureCalculator Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new FeatureCalculator());
 }
Example #18
0
 public static PeptideLibraries Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideLibraries());
 }
Example #19
0
 public static PeptideIntegration Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideIntegration(null));
 }
Example #20
0
 public static PeptideSettings Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideSettings());
 }
Example #21
0
 public static PeptidePrediction Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptidePrediction());
 }
Example #22
0
 public static PeptideFilter Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideFilter());
 }
Example #23
0
 public static IsotopeEnrichments Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new IsotopeEnrichments()));
 }
Example #24
0
 public static ReportSpec Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ReportSpec()));
 }
Example #25
0
 public static IonMobilityLibrary Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IonMobilityLibrary());
 }
Example #26
0
 public static LegacyScoringModel Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new LegacyScoringModel()));
 }
Example #27
0
 public static Enzyme Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new Enzyme());
 }
Example #28
0
 public static XHunterLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new XHunterLibrary()));
 }
Example #29
0
 public static PeptideExcludeRegex Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new PeptideExcludeRegex());
 }
Example #30
0
 public static DigestSettings Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new DigestSettings());
 }
Example #31
0
 public static MeasuredIon Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new MeasuredIon());
 }
Example #32
0
 public static IsotopeEnrichments Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IsotopeEnrichments());
 }
Example #33
0
 public static FragmentLoss Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new FragmentLoss());
 }
Example #34
0
 public static ChromLibSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ChromLibSpectrumHeaderInfo()));
 }
 public static RetentionTimeSource Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new RetentionTimeSource());
 }
Example #36
0
 public static IsolationScheme Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new IsolationScheme()));
 }
Example #37
0
 public static StaticMod Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new StaticMod());
 }
Example #38
0
 public static ToolDescription Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ToolDescription()));
 }
Example #39
0
 public static BiblioSpecSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new BiblioSpecSpectrumHeaderInfo());
 }
Example #40
0
// ReSharper disable MemberHidesStaticFromOuterClass
        public static FeatureCalculator Deserialize(XmlReader reader)
// ReSharper restore MemberHidesStaticFromOuterClass
        {
            return(reader.Deserialize(new FeatureCalculator()));
        }
Example #41
0
 public static BiblioSpecSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new BiblioSpecSpectrumHeaderInfo()));
 }
Example #42
0
 public static SpectrastSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new SpectrastSpectrumHeaderInfo()));
 }
Example #43
0
 public static BiblioSpecLibSpec Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new BiblioSpecLibSpec());
 }
Example #44
0
 public static SpectrastSpec Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new SpectrastSpec()));
 }
Example #45
0
 public static LegacyScoringModel Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new LegacyScoringModel());
 }
Example #46
0
 public static ChromatogramLibrarySpec Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ChromatogramLibrarySpec()));
 }
Example #47
0
 public static MProphetPeakScoringModel Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new MProphetPeakScoringModel()));
 }
Example #48
0
 public static XHunterSpectrumHeaderInfo Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new XHunterSpectrumHeaderInfo()));
 }
Example #49
0
 public static IsolationScheme Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IsolationScheme());
 }
Example #50
0
 public static ProgramPathContainer Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new ProgramPathContainer()));
 }
 public static BackgroundProteomeSpec Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new BackgroundProteomeSpec());
 }
Example #52
0
 public static BiblioSpecLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new BiblioSpecLibrary()));
 }
 public static OptimizationLibrary Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new OptimizationLibrary());
 }
Example #54
0
 public static OptimizationLibrary Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new OptimizationLibrary()));
 }
Example #55
0
 public static ChromatogramSet Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new ChromatogramSet());
 }
Example #56
0
 public static DocumentRetentionTimes Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new DocumentRetentionTimes()));
 }
Example #57
0
 public static RCalcIrt Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new RCalcIrt());
 }
Example #58
0
 public static FragmentLoss Deserialize(XmlReader reader)
 {
     return(reader.Deserialize(new FragmentLoss()));
 }
Example #59
0
 public static IsolationWindow Deserialize(XmlReader reader)
 {
     return reader.Deserialize(new IsolationWindow());
 }