Beispiel #1
0
        private void styleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IStyleGallery        pStyleGlry    = new ServerStyleGalleryClass();
            IStyleGalleryStorage pStyleStorage = pStyleGlry as IStyleGalleryStorage;

            IRgbColor pRgbColor = new RgbColorClass();

            pRgbColor.Red   = 255;
            pRgbColor.Green = 1;
            pRgbColor.Blue  = 2;

            IStyleGalleryItem pStyleItem = new ServerStyleGalleryItemClass();

            pStyleItem.Name     = "Red";
            pStyleItem.Category = "Default";
            pStyleItem.Item     = pRgbColor;

            string pOldFile = pStyleStorage.TargetFile;

            pStyleStorage.TargetFile = @"E:\test.style";
            pStyleGlry.AddItem(pStyleItem);
            pStyleStorage.TargetFile = pOldFile;
            IColor color = pRgbColor as IColor;

            this.Text = color.RGB.ToString();
        }
Beispiel #2
0
        private void styleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IStyleGallery pStyleGlry = new ServerStyleGalleryClass();
            IStyleGalleryStorage pStyleStorage = pStyleGlry as IStyleGalleryStorage;

            IRgbColor pRgbColor = new RgbColorClass();
            pRgbColor.Red = 255;
            pRgbColor.Green = 1;
            pRgbColor.Blue = 2;

            IStyleGalleryItem pStyleItem = new ServerStyleGalleryItemClass();
            pStyleItem.Name = "Red";
            pStyleItem.Category = "Default";
            pStyleItem.Item = pRgbColor;

            string pOldFile = pStyleStorage.TargetFile;
            pStyleStorage.TargetFile = @"E:\test.style";
            pStyleGlry.AddItem(pStyleItem);
            pStyleStorage.TargetFile = pOldFile;
            IColor color = pRgbColor as IColor;
            this.Text = color.RGB.ToString();
        }