Esempio n. 1
0
        protected void LoadFromXml(string path)
        {
            RscStore store = new RscStore();

            System.IO.Stream strm = store.GetReaderStream(path);

            XDocument xDoc = XDocument.Load(strm, LoadOptions.None);

            strm.Close();

            try
            {
                XElement xRoot = xDoc.Element("ThemeColors");

                ListZebraBack1 = RscDecode.HexaStringToColor(xRoot.Element("ListZebraBack1").Value);
                ListZebraBack2 = RscDecode.HexaStringToColor(xRoot.Element("ListZebraBack2").Value);
                ListZebraFore  = RscDecode.HexaStringToColor(xRoot.Element("ListZebraFore").Value);

                TreeDescBack      = RscDecode.HexaStringToColor(xRoot.Element("TreeDescBack").Value);
                TreeDescFore      = RscDecode.HexaStringToColor(xRoot.Element("TreeDescFore").Value);
                TreeLeafBack      = RscDecode.HexaStringToColor(xRoot.Element("TreeLeafBack").Value);
                TreeLeafFore      = RscDecode.HexaStringToColor(xRoot.Element("TreeLeafFore").Value);
                TreeContainerBack = RscDecode.HexaStringToColor(xRoot.Element("TreeContainerBack").Value);
                TreeContainerFore = RscDecode.HexaStringToColor(xRoot.Element("TreeContainerFore").Value);

                TextDarkBack  = RscDecode.HexaStringToColor(xRoot.Element("TextDarkBack").Value);
                TextDarkFore  = RscDecode.HexaStringToColor(xRoot.Element("TextDarkFore").Value);
                TextLightBack = RscDecode.HexaStringToColor(xRoot.Element("TextLightBack").Value);
                TextLightFore = RscDecode.HexaStringToColor(xRoot.Element("TextLightFore").Value);

                GalleryItemBack   = RscDecode.HexaStringToColor(xRoot.Element("GalleryItemBack").Value);
                GalleryItemBorder = RscDecode.HexaStringToColor(xRoot.Element("GalleryItemBorder").Value);
                GalleryItemFore   = RscDecode.HexaStringToColor(xRoot.Element("GalleryItemFore").Value);

                DialogLightBack = RscDecode.HexaStringToColor(xRoot.Element("DialogLightBack").Value);

                ToolBarLightBack = RscDecode.HexaStringToColor(xRoot.Element("ToolBarLightBack").Value);
                ToolBarLightFore = RscDecode.HexaStringToColor(xRoot.Element("ToolBarLightFore").Value);

                AppTitleBack = RscDecode.HexaStringToColor(xRoot.Element("AppTitleBack").Value);
                AppTitleFore = RscDecode.HexaStringToColor(xRoot.Element("AppTitleFore").Value);

                AppStatusBack = RscDecode.HexaStringToColor(xRoot.Element("AppStatusBack").Value);
                AppStatusFore = RscDecode.HexaStringToColor(xRoot.Element("AppStatusFore").Value);

                IconBack   = RscDecode.HexaStringToColor(xRoot.Element("IconBack").Value);
                IconBorder = RscDecode.HexaStringToColor(xRoot.Element("IconBorder").Value);
                IconFore   = RscDecode.HexaStringToColor(xRoot.Element("IconFore").Value);

                ThemeBack = RscDecode.HexaStringToColor(xRoot.Element("ThemeBack").Value);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        protected string DeCodeValue(RscTextTag tt)
        {
            string sRet = "";

            int iCount = tt.m_asRight.Length;

            for (int i = 0; i < iCount; i++)
            {
                string sVal = "";

                sVal = tt.m_asRight[i];

                if (tt.LeftIndexOf("ENCODING=QUOTED-PRINTABLE") >= 0)
                {
                    sVal = RscDecode.QuotedPrintable(sVal);
                }

                if (tt.LeftIndexOf("ENCODING=8BIT") >= 0)
                {
                    //NOP...
                }
                else
                {
                    if (tt.LeftIndexOf("CHARSET=UTF-8") >= 0)
                    {
                        if (sVal.Length > 0)
                        {
                            char [] acVal = sVal.ToCharArray();
                            byte [] ay    = new byte [acVal.Length];
                            for (int j = 0; j < acVal.Length; j++)
                            {
                                ay[j] = ((byte)(acVal[j]));
                            }
                            sVal = Encoding.UTF8.GetString(ay, 0, ay.Length);
                        }
                    }
                }

                if (sVal.Length > 0)
                {
                    if (sRet.Length > 0)
                    {
                        sRet += " ";
                    }
                    sRet += sVal;
                }
            }

            return(sRet);
        }