コード例 #1
0
        protected override byte[] GetRawBytes()
        {
            XmlTheme     context      = this.Context as XmlTheme;
            MemoryStream memoryStream = new MemoryStream();

            context.SaveToStream((Stream)memoryStream);
            byte[] array = memoryStream.ToArray();
            memoryStream.Close();
            return(array);
        }
コード例 #2
0
        protected override object Deserialize(byte[] rawBytes)
        {
            XmlTheme     xmlTheme     = new XmlTheme();
            MemoryStream memoryStream = new MemoryStream(rawBytes);
            XmlReader    reader       = XmlReader.Create((Stream)memoryStream);

            xmlTheme.DeserializePartially(reader);
            reader.Close();
            memoryStream.Close();
            return((object)xmlTheme);
        }
コード例 #3
0
        public XmlTheme[] DecompressThemes()
        {
            List <XmlTheme> xmlThemeList = new List <XmlTheme>();

            foreach (RadArchiveStream stream in this.Streams)
            {
                XmlTheme xmlTheme = stream.Unzip() as XmlTheme;
                if (xmlTheme != null)
                {
                    xmlThemeList.Add(xmlTheme);
                }
            }
            return(xmlThemeList.ToArray());
        }
コード例 #4
0
        protected override object Deserialize(byte[] rawBytes)
        {
            XmlTheme theme = new XmlTheme();

            MemoryStream memStream = new MemoryStream(rawBytes);
            XmlReader    reader    = XmlReader.Create(memStream);

            theme.DeserializePartiallyThemeFromReader(reader);

            reader.Close();
            memStream.Close();

            return(theme);
        }
コード例 #5
0
        protected override byte[] GetRawBytes()
        {
            XmlTheme theme = this.Context as XmlTheme;

            Debug.Assert(theme != null, "Invalid XmlThemeArchiveStream context.");

            MemoryStream savedThemeStream = new MemoryStream();

            theme.SaveToStream(savedThemeStream);
            byte[] savedBuffer = savedThemeStream.ToArray();
            savedThemeStream.Close();

            return(savedBuffer);
        }
コード例 #6
0
ファイル: RadThemePackage.cs プロジェクト: configare/hispeed
        /// <summary>
        /// Gets all the themes that reside within this package.
        /// </summary>
        /// <returns></returns>
        public XmlTheme[] DecompressThemes()
        {
            List <XmlTheme> themes = new List <XmlTheme>();

            foreach (RadArchiveStream stream in this.Streams)
            {
                XmlTheme theme = stream.Unzip() as XmlTheme;
                Debug.Assert(theme != null, "Invalid stream in RadThemePackage.");
                if (theme != null)
                {
                    themes.Add(theme);
                }
            }

            return(themes.ToArray());
        }
コード例 #7
0
 public RadXmlThemeArchiveStream(XmlTheme theme)
     : base((object)theme)
 {
 }
コード例 #8
0
 public RadXmlThemeArchiveStream(XmlTheme theme)
     : base(theme)
 {
 }