Ejemplo n.º 1
0
        public void Demo()
        {
            #region radspreadsheet-model-features-styling-document-themes_0
            ThemeColorScheme colorScheme = new ThemeColorScheme(
                "Mine",
                Colors.Black,     // background 1
                Colors.Blue,      // text 1
                Colors.Brown,     // background 2
                Colors.Cyan,      // text 2
                Colors.DarkGray,  // accent 1
                Colors.Gray,      // accent 2
                Colors.Green,     // accent 3
                Colors.LightGray, // accent 4
                Colors.Magenta,   // accent 5
                Colors.Orange,    // accent 6
                Colors.Purple,    // hyperlink
                Colors.Red);      // followedHyperlink
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_1
            ThemableColor themableColor = new ThemableColor(ThemeColorType.Accent1);
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_2
            ThemeFontScheme fontScheme = new ThemeFontScheme(
                "Mine",
                "Times New Roman",  // latinMajor
                "Arial");           // latinMinor
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_3
            ThemableFontFamily themableFont = new ThemableFontFamily(ThemeFontType.Major);
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_4
            DocumentTheme theme = new DocumentTheme("Mine", colorScheme, fontScheme);
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_5
            DocumentTheme theme1 = new DocumentTheme("From Predefined schemes", PredefinedThemeSchemes.ColorSchemes[0], PredefinedThemeSchemes.FontSchemes[5]);
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_6
            Workbook workbook = new Workbook();
            workbook.Worksheets.Add();
            workbook.Theme = theme;
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_7
            Color actualColor = themableColor.GetActualValue(theme);
            // the actual color is the same as Accent1 color of the colorScheme
            #endregion

            #region radspreadsheet-model-features-styling-document-themes_8
            var actualFont = themableFont.GetActualValue(theme);
            // the actualFont is the same as the Major font of the fontScheme
            #endregion
        }
Ejemplo n.º 2
0
        public EFontfamily GetFontTheme(ThemeFontScheme themeFontScheme)
        {
            EFontfamily fontfamily = new EFontfamily();

            fontfamily.MajorFont = themeFontScheme.MajorFont.Item(MsoFontLanguageIndex.msoThemeLatin).Name;
            fontfamily.MinorFont = themeFontScheme.MinorFont.Item(MsoFontLanguageIndex.msoThemeLatin).Name;
            fontfamily.TagName   = fontfamily.MajorFont + "-" + fontfamily.MinorFont;
            return(fontfamily);
        }
Ejemplo n.º 3
0
 private void CreateFontScheme()
 {
     #region radwordsprocessing-concepts-document-themes_2
     ThemeFontScheme fontScheme = new ThemeFontScheme(
         "Mine",
         "Times New Roman",   // Major
         "Arial");            // Minor
     #endregion
 }
Ejemplo n.º 4
0
 public void Dispose()
 {
     if (this._ColorScheme != null)
     {
         this._ColorScheme.Dispose();
         this._ColorScheme = null;
     }
     if (this._FontScheme != null)
     {
         this._FontScheme.Dispose();
         this._FontScheme = null;
     }
     if (this._FormatScheme != null)
     {
         this._FormatScheme.Dispose();
         this._FormatScheme = null;
     }
 }
Ejemplo n.º 5
0
        private void SetWorkbookTheme()
        {
            ThemeColorScheme colorScheme = new ThemeColorScheme("ExpenseReport",
                                                                Color.FromArgb(255, 65, 65, 65),    // Background1
                                                                Color.FromArgb(255, 240, 240, 240), // Text1
                                                                Color.FromArgb(255, 0, 0, 0),       // Background2
                                                                Color.FromArgb(255, 255, 255, 255), // Text2
                                                                Color.FromArgb(255, 116, 202, 218), // Accent1
                                                                Color.FromArgb(255, 146, 204, 70),  // Accent2
                                                                Color.FromArgb(255, 241, 96, 61),   // Accent3
                                                                Color.FromArgb(255, 143, 145, 158), // Accent4
                                                                Color.FromArgb(255, 141, 119, 251), // Accent5
                                                                Color.FromArgb(255, 91, 119, 153),  // Accent6
                                                                Color.FromArgb(255, 5, 99, 193),    // Hyperlink
                                                                Color.FromArgb(255, 149, 79, 114)); // Followed hyperlink

            ThemeFontScheme fontScheme = new ThemeFontScheme("ExpenseReport", "Cambria", "Segoe UI");
            DocumentTheme   theme      = new DocumentTheme("ExpenseReport", colorScheme, fontScheme);

            this.workbook.Theme = theme;
        }
Ejemplo n.º 6
0
        private void SetWorkbookTheme()
        {
            ThemeColorScheme colorScheme = new ThemeColorScheme("ExpenseReport",
                       Color.FromArgb(255, 65, 65, 65),    // Background1
                       Color.FromArgb(255, 240, 240, 240), // Text1
                       Color.FromArgb(255, 0, 0, 0),       // Background2
                       Color.FromArgb(255, 255, 255, 255), // Text2
                       Color.FromArgb(255, 116, 202, 218), // Accent1
                       Color.FromArgb(255, 146, 204, 70),  // Accent2
                       Color.FromArgb(255, 241, 96, 61),   // Accent3
                       Color.FromArgb(255, 143, 145, 158), // Accent4
                       Color.FromArgb(255, 141, 119, 251), // Accent5
                       Color.FromArgb(255, 91, 119, 153),  // Accent6
                       Color.FromArgb(255, 5, 99, 193),    // Hyperlink
                       Color.FromArgb(255, 149, 79, 114)); // Followed hyperlink

            ThemeFontScheme fontScheme = new ThemeFontScheme("ExpenseReport", "Cambria", "Segoe UI");
            DocumentTheme theme = new DocumentTheme("ExpenseReport", colorScheme, fontScheme);
            this.workbook.Theme = theme;
        }
Ejemplo n.º 7
0
 private void CreatingTheme(ThemeColorScheme colorScheme, ThemeFontScheme fontScheme)
 {
     #region radwordsprocessing-concepts-document-themes_4
     DocumentTheme theme = new DocumentTheme("Mine", colorScheme, fontScheme);
     #endregion
 }