예제 #1
0
        public static CommandMapper CreateInstance(ICommandTarget o, XmlTextReader xtr)
        {
            SimpleXmlSerializer serializer =
                new SimpleXmlSerializer(typeof(CommandMapper));

            try
            {
                CommandMapper km = (CommandMapper)serializer.Deserialize(xtr);
                km.target = o;
                return(km);
            }
            finally
            {
                xtr.Close();
            }
        }
예제 #2
0
        public static Stylesheet Load(string filename, XmlNameTable tbl)
        {
            SimpleXmlSerializer serializer =
                new SimpleXmlSerializer(typeof(Stylesheet));

            XmlTextReader xtr = new XmlTextReader(filename);

            try
            {
                Stylesheet s = (Stylesheet)serializer.Deserialize(xtr);

                s.BindStyles(tbl);
                return(s);
            }
            finally
            {
                xtr.Close();
            }
        }
예제 #3
0
        public static XmlCatalog Load()
        {
            Assembly asm=typeof(XmlCatalog).Assembly;
            Uri baseUri=new Uri(asm.CodeBase);
            Uri catalogUri=new Uri(baseUri, "catalog.xml");

            XmlTextReader xtr=new XmlTextReader(catalogUri.AbsoluteUri);
            SimpleXmlSerializer serializer =
                new SimpleXmlSerializer(typeof(XmlCatalog));

            try
            {
                XmlCatalog xc=(XmlCatalog) serializer.Deserialize(xtr);
                return xc;
            }
            finally
            {
                xtr.Close();
            }
        }
예제 #4
0
        public static XmlCatalog Load()
        {
            Assembly asm        = typeof(XmlCatalog).Assembly;
            Uri      baseUri    = new Uri(asm.CodeBase);
            Uri      catalogUri = new Uri(baseUri, "catalog.xml");

            XmlTextReader       xtr        = new XmlTextReader(catalogUri.AbsoluteUri);
            SimpleXmlSerializer serializer =
                new SimpleXmlSerializer(typeof(XmlCatalog));

            try
            {
                XmlCatalog xc = (XmlCatalog)serializer.Deserialize(xtr);
                return(xc);
            }
            finally
            {
                xtr.Close();
            }
        }
예제 #5
0
        public static Stylesheet Load(string filename, XmlNameTable tbl)
        {
            SimpleXmlSerializer serializer =
                new SimpleXmlSerializer(typeof(Stylesheet));

            XmlTextReader xtr=new XmlTextReader(filename);
            try
            {
                Stylesheet s=(Stylesheet) serializer.Deserialize(xtr);

                s.BindStyles(tbl);
                return s;
            }
            finally
            {
                xtr.Close();
            }
        }
예제 #6
0
        public static CommandMapper CreateInstance(ICommandTarget o, XmlTextReader xtr)
        {
            SimpleXmlSerializer serializer =
                new SimpleXmlSerializer(typeof(CommandMapper));

            try
            {
                CommandMapper km=(CommandMapper) serializer.Deserialize(xtr);
                km.target=o;
                return km;
            }
            finally
            {
                xtr.Close();
            }
        }
 /// <summary>
 /// Deserializes <see cref="StoredDomainModel"/> from string.
 /// </summary>
 /// <param name="serialized">Serialized instance.</param>
 /// <returns>Deserialized instance.</returns>
 public static StoredDomainModel Deserialize(string serialized)
 {
     return(Serializer.Deserialize(serialized));
 }
예제 #8
0
 /// <summary>
 /// Deserializes <see cref="StoredPartialIndexFilterInfoCollection"/> from string.
 /// </summary>
 /// <param name="serialized">Serialized instance.</param>
 /// <returns>Deserialized instance.</returns>
 public static StoredPartialIndexFilterInfoCollection Deserialize(string serialized)
 {
     return(Serializer.Deserialize(serialized));
 }