Ejemplo n.º 1
0
        public LocalSettings()
        {
            //DevUrl = "https://dev-CS--IRIS----RKSB1-CS17-my-salesforce-com.iris-dev.rowini.net:29443",
            //    DevPartner = "/services/Soap/u/29.0/00Dg0000003Nc8C",
            //    DevMeta = "/services/Soap/m/29.0/00Dg0000003Nc8C"

            this.settingsDialog = null;

            this.inst = GetInstance("Inst", Instances.Prod);
            this.debug = GetBool("Debug",false);
            this.ssologin = GetBool("SSOLogin", false);
            this.showalllogins = GetBool("ShowAllLogins", false);
            this.soapversion = GetString("SoapVersion", "29.0");

            this.devurl = GetString("DevUrl", "https://dev-CS--IRIS----RKSB1-CS17-my-salesforce-com.iris-dev.rowini.net:29443");
            this.devorgid = GetString("DevOrgId", "00Dg0000003Nc8C");

            this.iturl = GetString("ITUrl", "");
            this.itorgid = GetString("ITOrgId", "");

            this.uaturl = GetString("UATUrl", "");
            this.uatorgid = GetString("UATOrgId", "");

            this.produrl = GetString("ProdUrl", "");
            this.prodorgid = GetString("ProdOrgId", "");

            this.reportsdevurl = GetString("ReportsDevUrl", "https://reprots.irisbyaxiom.com/SSOLogin");
            this.reportsiturl = GetString("ReportsITUrl", "https://reprots.irisbyaxiom.com/SSOLogin");
            this.reportsuaturl = GetString("ReportsUATUrl", "https://reprots.irisbyaxiom.com/SSOLogin");
            this.reportsprodurl = GetString("ReportsProdUrl", "https://reprots.irisbyaxiom.com/SSOLogin");

            this.theme = GetTheme("Theme", Themes.Windows8);
            this.themecolor = GetString("ThemeColor", "#DE5827");
        }
 private static void OnThemeChanged(Themes theme, ForegroundColorVariations colorVariation)
 {
     if (ThemeChanged != null)
     {
         ThemeChanged(null, new AppearanceChangedEventArgs(theme, colorVariation));
     }
 }
        public static void ChangeAppearance(Themes theme, ForegroundColorVariations foregroundColorVariation)
        {
            string analyticsFeatureName = string.Concat(EqatecConstants.Theme, ".", theme.ToString());
            EqatecMonitor.Instance.TrackFeature(analyticsFeatureName);

            switch (foregroundColorVariation)
                {
                    case ForegroundColorVariations.Light:
                        ThemePalette.Palette.Foreground = ThemePalette.LightForegroundColor;
                        break;
                    case ForegroundColorVariations.Dark:
                        ThemePalette.Palette.Foreground = ThemePalette.DarkForegroundColor;
                        break;
                    case ForegroundColorVariations.ExpressionDark:
                        ThemePalette.Palette.Foreground = ThemePalette.ExpressionDarkForegroundColor;
                        break;
                    case ForegroundColorVariations.Windows7:
                        ThemePalette.Palette.Foreground = ThemePalette.Windows7ForegroundColor;
                        break;
                    default:
                        break;
                }

            string themeAssembly = GetThemeAssemblyName(theme.ToString());
            SetTheme(themeAssembly);
            SetThemeSpecific(theme);
            SetIconsSet(theme);

            OnThemeChanged(theme, foregroundColorVariation);
        }
        internal override void UpdateThemeResources(Themes.Theme oldTheme = null)
        {
            if (Application.Current != null)
                return;

            base.UpdateThemeResources(oldTheme);

            if (_overlayWindow != null)
                _overlayWindow.UpdateThemeResources(oldTheme);
        }
Ejemplo n.º 5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            var builder = new ContainerBuilder();
            builder.RegisterType<MemoryCacheManager>().As<ICacheManager>().SingleInstance();
            builder.RegisterType<SessionCachingFlash>().As<IFlash>();
            builder.RegisterType<TestUserLoader>().As<IUserLoader>();
            builder.RegisterType<Authenticate>().AsSelf();

            var controllerAssemblies = new[] { typeof(MvcApplication).Assembly };
            builder.RegisterControllers(controllerAssemblies).PropertiesAutowired();
            // OPTIONAL: Register model binders that require DI.
            builder.RegisterModelBinders(controllerAssemblies);
            builder.RegisterModelBinderProvider();

            // OPTIONAL: Register web abstractions like HttpContextBase.
            builder.RegisterModule<AutofacWebTypesModule>();

            // OPTIONAL: Enable property injection in view pages.
            builder.RegisterSource(new ViewRegistrationSource());

            // OPTIONAL: Enable property injection into action filters.
            builder.RegisterFilterProvider();

            // Set the dependency resolver to be Autofac.

            var clipOneTheme = new ClipOneTheme();
            Themes themes = new Themes();
            themes.Register(clipOneTheme);
            builder.Register(context => new DefaultThemeLoader("clip-one", themes)).As<IThemeLoader>();

            builder.RegisterType<ReflectionSitemapsLoader>().As<ISitemapsLoader>();
            builder.RegisterType<MyTaskLoader>().As<ITaskLoader>();
            builder.RegisterType<MyNoticeLoader>().As<INoticeLoader>();
            builder.RegisterType<MyMessageLoader>().As<IMessageLoader>();
            builder.RegisterType<TestUserLoader>().As<IUserLoader>();

            RequestMappings.Current.Register(RouteTable.Routes);
            var container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
        }
Ejemplo n.º 6
0
 private void updateTheme(int index, Themes.Theme theme)
 {
     var a = panelTheme.ItemsSource.OfType<Themes.Theme>();
     var b = a.ToList();
     b.RemoveAt(index);
     b.Insert(index, theme);
     panelTheme.ItemsSource = b;
     panelTheme.SelectedIndex = index;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Class constructor
 /// </summary>
 public Workspace()
 {
     SelectedTheme = Themes.First();
 }
Ejemplo n.º 8
0
 public void Add(ThemeViewModel theme)
 {
     Themes.Add(theme);
     CurrentTheme = theme;
 }
Ejemplo n.º 9
0
        public override void Execute(GrapeCity.Documents.Excel.Workbook workbook)
        {
            IWorksheet worksheet = workbook.Worksheets[0];

            #region theme
            //create a custom theme.
            Themes themes = new Themes();
            ITheme theme  = themes.Add("testTheme");
            theme.ThemeColorScheme[ThemeColor.Light1].RGB             = Color.FromArgb(255, 255, 255);
            theme.ThemeColorScheme[ThemeColor.Dark1].RGB              = Color.FromArgb(0, 0, 0);
            theme.ThemeColorScheme[ThemeColor.Light2].RGB             = Color.FromArgb(222, 222, 212);
            theme.ThemeColorScheme[ThemeColor.Dark2].RGB              = Color.FromArgb(30, 46, 47);
            theme.ThemeColorScheme[ThemeColor.Accent1].RGB            = Color.FromArgb(233, 117, 90);
            theme.ThemeColorScheme[ThemeColor.Accent2].RGB            = Color.FromArgb(122, 182, 186);
            theme.ThemeColorScheme[ThemeColor.Accent3].RGB            = Color.FromArgb(125, 181, 135);
            theme.ThemeColorScheme[ThemeColor.Accent4].RGB            = Color.FromArgb(230, 191, 94);
            theme.ThemeColorScheme[ThemeColor.Accent5].RGB            = Color.FromArgb(230, 143, 77);
            theme.ThemeColorScheme[ThemeColor.Accent6].RGB            = Color.FromArgb(194, 107, 112);
            theme.ThemeColorScheme[ThemeColor.Hyperlink].RGB          = Color.FromArgb(122, 182, 186);
            theme.ThemeColorScheme[ThemeColor.FollowedHyperlink].RGB  = Color.FromArgb(166, 140, 177);
            theme.ThemeFontScheme.Major[FontLanguageIndex.Latin].Name = "Gill Sans";
            theme.ThemeFontScheme.Minor[FontLanguageIndex.Latin].Name = "Gill Sans";

            //assign the custom theme for workbook.
            workbook.Theme = theme;
            #endregion

            //does not show sheet gridlines.
            worksheet.SheetView.DisplayGridlines = false;

            #region RowHeightColumnWidth
            //set row height and column width.
            worksheet.StandardHeight     = 12.75;
            worksheet.StandardWidth      = 8.43;
            worksheet.Rows[1].RowHeight  = 32.25;
            worksheet.Rows[2].RowHeight  = 13.5;
            worksheet.Rows[3].RowHeight  = 18.75;
            worksheet.Rows[6].RowHeight  = 18.75;
            worksheet.Rows[9].RowHeight  = 18.75;
            worksheet.Rows[12].RowHeight = 18.75;
            worksheet.Rows[15].RowHeight = 19.5;
            worksheet.Rows[16].RowHeight = 13.5;
            worksheet.Rows[33].RowHeight = 19.5;
            worksheet.Rows[34].RowHeight = 13.5;

            worksheet.Columns[0].ColumnWidth = 1.7109375;
            worksheet.Columns[1].ColumnWidth = 12.140625;
            worksheet.Columns[2].ColumnWidth = 12.140625;
            worksheet.Columns[3].ColumnWidth = 12.140625;
            worksheet.Columns[4].ColumnWidth = 11.85546875;
            worksheet.Columns[5].ColumnWidth = 12.7109375;
            worksheet.Columns[6].ColumnWidth = 13.85546875;
            worksheet.Columns[7].ColumnWidth = 44.7109375;
            #endregion

            #region Values
            //initialize worksheet's values.
            worksheet.Name = "BLOOD PRESSURE DATA";
            worksheet.Range["B2"].Value     = "BLOOD PRESSURE TRACKER";
            worksheet.Range["B4:F13"].Value = new object[, ] {
                { "NAME", null, null, null, null },
                { null, null, null, null, null },
                { null, null, null, "Systolic", "Diastolic" },
                { "TARGET BLOOD PRESSURE", null, null, 120, 80 },
                { null, null, null, null, null },
                { null, null, null, "Systolic", "Diastolic" },
                { "CALL PHYSICIAN IF ABOVE", null, null, 140, 90 },
                { null, null, null, null, null },
                { null, null, null, null, null },
                { "PHYSICIAN PHONE NUMBER", null, null, "[Phone Number]", null }
            };

            worksheet.Range["B16"].Value = "CHARTED PROGRESS";
            worksheet.Range["B34"].Value = "DATA ENTRY";
            #endregion

            #region Table
            //initialize table data.
            worksheet.Range["B36:H44"].Value = new object[, ] {
                { "TIME", "DATE", "AM/PM", "SYSTOLIC", "DIASTOLIC", "HEART RATE", "NOTES" },
                { new TimeSpan(10, 00, 00), DateTime.Parse("7/1/2013 12:00:00 AM"), "AM", 129, 99, 72, null },
                { new TimeSpan(18, 00, 00), DateTime.Parse("7/1/2013 12:00:00 AM"), "PM", 133, 80, 75, null },
                { new TimeSpan(10, 30, 00), DateTime.Parse("7/2/2012 12:00:00 AM"), "AM", 142, 86, 70, null },
                { new TimeSpan(19, 00, 00), DateTime.Parse("7/2/2012 12:00:00 AM"), "PM", 141, 84, 68, null },
                { new TimeSpan(09, 00, 00), DateTime.Parse("7/3/2012 12:00:00 AM"), "AM", 137, 84, 70, null },
                { new TimeSpan(18, 30, 00), DateTime.Parse("7/3/2012 12:00:00 AM"), "PM", 139, 83, 72, null },
                { new TimeSpan(10, 00, 00), DateTime.Parse("7/4/2012 12:00:00 AM"), "AM", 140, 85, 78, null },
                { new TimeSpan(18, 00, 00), DateTime.Parse("7/4/2012 12:00:00 AM"), "PM", 138, 85, 69, null },
            };
            ITable table = worksheet.Tables.Add(worksheet.Range["B36:H44"], true);
            table.ShowTotals = true;

            //set total row formulas.
            table.Columns[0].Total.Value       = "Average";
            table.Columns[3].TotalsCalculation = TotalsCalculation.Average;
            table.Columns[4].TotalsCalculation = TotalsCalculation.Average;
            table.Columns[5].TotalsCalculation = TotalsCalculation.Average;
            table.Columns[6].TotalsCalculation = TotalsCalculation.None;

            //config data body range and total range's number format.
            table.Columns[0].DataBodyRange.NumberFormat = "h:mm;@";
            table.Columns[1].DataBodyRange.NumberFormat = "m/d/yyyy";
            table.Columns[3].DataBodyRange.NumberFormat = "0";
            table.Columns[4].DataBodyRange.NumberFormat = "0";
            table.Columns[5].DataBodyRange.NumberFormat = "0";
            table.Columns[3].Total.NumberFormat         = "0";
            table.Columns[4].Total.NumberFormat         = "0";
            table.Columns[5].Total.NumberFormat         = "0";

            //config table range's alignment.
            table.Range.HorizontalAlignment = HorizontalAlignment.Left;
            table.Range.IndentLevel         = 0;
            table.Range.VerticalAlignment   = VerticalAlignment.Center;
            #endregion

            #region TableStyle
            //create a custom table style.
            ITableStyle tablestyle = workbook.TableStyles.Add("testStyle");
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Font.ThemeColor   = ThemeColor.Dark1;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Font.TintAndShade = 0.25;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeTop].LineStyle             = BorderLineStyle.Thin;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeTop].ThemeColor            = ThemeColor.Accent1;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeTop].TintAndShade          = 0.4;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.InsideHorizontal].LineStyle    = BorderLineStyle.Thin;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.InsideHorizontal].ThemeColor   = ThemeColor.Accent1;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.InsideHorizontal].TintAndShade = 0.4;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeBottom].LineStyle          = BorderLineStyle.Thin;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeBottom].ThemeColor         = ThemeColor.Accent1;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeBottom].TintAndShade       = 0.4;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeLeft].LineStyle            = BorderLineStyle.Thin;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeLeft].ThemeColor           = ThemeColor.Accent1;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeLeft].TintAndShade         = 0.4;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeRight].LineStyle           = BorderLineStyle.Thin;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeRight].ThemeColor          = ThemeColor.Accent1;
            tablestyle.TableStyleElements[TableStyleElementType.WholeTable].Borders[BordersIndex.EdgeRight].TintAndShade        = 0.4;

            tablestyle.TableStyleElements[TableStyleElementType.FirstRowStripe].Interior.ThemeColor   = ThemeColor.Accent1;
            tablestyle.TableStyleElements[TableStyleElementType.FirstRowStripe].Interior.TintAndShade = 0.8;

            tablestyle.TableStyleElements[TableStyleElementType.HeaderRow].Font.Bold           = true;
            tablestyle.TableStyleElements[TableStyleElementType.HeaderRow].Font.ThemeColor     = ThemeColor.Dark1;
            tablestyle.TableStyleElements[TableStyleElementType.HeaderRow].Font.TintAndShade   = 0.25;
            tablestyle.TableStyleElements[TableStyleElementType.HeaderRow].Interior.ThemeColor = ThemeColor.Accent1;

            tablestyle.TableStyleElements[TableStyleElementType.TotalRow].Font.Bold         = true;
            tablestyle.TableStyleElements[TableStyleElementType.TotalRow].Font.ThemeColor   = ThemeColor.Dark1;
            tablestyle.TableStyleElements[TableStyleElementType.TotalRow].Font.TintAndShade = 0.25;
            tablestyle.TableStyleElements[TableStyleElementType.TotalRow].Borders[BordersIndex.EdgeTop].LineStyle  = BorderLineStyle.Double;
            tablestyle.TableStyleElements[TableStyleElementType.TotalRow].Borders[BordersIndex.EdgeTop].ThemeColor = ThemeColor.Accent1;

            //assign custom table style for table.
            table.TableStyle = workbook.TableStyles["testStyle"];
            #endregion

            #region Style
            //assign built-in styles for ranges.
            worksheet.Range["B2:H2"].Style = workbook.Styles["Heading 1"];
            worksheet.Range["B4:F4, B7:D7, B10:D10, B13:D13"].Style = workbook.Styles["Heading 2"];
            worksheet.Range["B16:H16, B34:H34"].Style = workbook.Styles["Heading 3"];

            //modify built-in styles.
            IStyle style_Heading1 = workbook.Styles["Heading 1"];
            style_Heading1.HorizontalAlignment = HorizontalAlignment.General;
            style_Heading1.VerticalAlignment   = VerticalAlignment.Center;
            style_Heading1.Font.ThemeFont      = ThemeFont.Major;
            style_Heading1.Font.Size           = 24;
            style_Heading1.Font.Bold           = true;
            style_Heading1.Font.ThemeColor     = ThemeColor.Accent1;
            style_Heading1.Borders[BordersIndex.EdgeBottom].LineStyle  = BorderLineStyle.Thick;
            style_Heading1.Borders[BordersIndex.EdgeBottom].ThemeColor = ThemeColor.Accent1;

            style_Heading1.IncludeAlignment  = true;
            style_Heading1.IncludeFont       = true;
            style_Heading1.IncludeBorder     = true;
            style_Heading1.IncludeNumber     = false;
            style_Heading1.IncludePatterns   = false;
            style_Heading1.IncludeProtection = false;

            IStyle style_Heading2 = workbook.Styles["Heading 2"];
            style_Heading2.HorizontalAlignment = HorizontalAlignment.General;
            style_Heading2.VerticalAlignment   = VerticalAlignment.Bottom;
            style_Heading2.Font.ThemeFont      = ThemeFont.Minor;
            style_Heading2.Font.Size           = 14;
            style_Heading2.Font.ThemeColor     = ThemeColor.Dark1;
            style_Heading2.Font.TintAndShade   = 0.25;
            style_Heading2.Font.Bold           = false;
            style_Heading2.Borders[BordersIndex.EdgeBottom].LineStyle    = BorderLineStyle.Dotted;
            style_Heading2.Borders[BordersIndex.EdgeBottom].ThemeColor   = ThemeColor.Light1;
            style_Heading2.Borders[BordersIndex.EdgeBottom].TintAndShade = -0.5;

            style_Heading2.IncludeAlignment  = true;
            style_Heading2.IncludeFont       = true;
            style_Heading2.IncludeBorder     = true;
            style_Heading2.IncludeNumber     = false;
            style_Heading2.IncludePatterns   = false;
            style_Heading2.IncludeProtection = false;

            IStyle style_Heading3 = workbook.Styles["Heading 3"];
            style_Heading3.HorizontalAlignment = HorizontalAlignment.General;
            style_Heading3.VerticalAlignment   = VerticalAlignment.Center;
            style_Heading3.Font.ThemeFont      = ThemeFont.Minor;
            style_Heading3.Font.Size           = 14;
            style_Heading3.Font.Bold           = true;
            style_Heading3.Font.ThemeColor     = ThemeColor.Dark1;
            style_Heading3.Font.TintAndShade   = 0.25;
            style_Heading3.Borders[BordersIndex.EdgeBottom].LineStyle  = BorderLineStyle.Thick;
            style_Heading3.Borders[BordersIndex.EdgeBottom].ThemeColor = ThemeColor.Accent2;

            style_Heading3.IncludeAlignment  = true;
            style_Heading3.IncludeFont       = true;
            style_Heading3.IncludeBorder     = true;
            style_Heading3.IncludeNumber     = false;
            style_Heading3.IncludePatterns   = false;
            style_Heading3.IncludeProtection = false;

            IStyle style_Normal = workbook.Styles["Normal"];
            style_Normal.NumberFormat        = "General";
            style_Normal.HorizontalAlignment = HorizontalAlignment.General;
            style_Normal.VerticalAlignment   = VerticalAlignment.Center;
            style_Normal.Font.ThemeFont      = ThemeFont.Minor;
            style_Normal.Font.Size           = 10;
            style_Normal.Font.ThemeColor     = ThemeColor.Dark1;
            style_Normal.Font.TintAndShade   = 0.25;

            style_Normal.IncludeAlignment  = true;
            style_Normal.IncludeFont       = true;
            style_Normal.IncludeBorder     = true;
            style_Normal.IncludeNumber     = true;
            style_Normal.IncludePatterns   = true;
            style_Normal.IncludeProtection = true;

            //modify cell styles.
            worksheet.Range["B4"].Borders[BordersIndex.EdgeBottom].LineStyle    = BorderLineStyle.None;
            worksheet.Range["C4:F4"].Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.Thin;
            IRange range1 = worksheet.Range["E7:F7, E10:F10"];
            range1.Borders[BordersIndex.EdgeBottom].LineStyle    = BorderLineStyle.Dotted;
            range1.Borders[BordersIndex.EdgeBottom].ThemeColor   = ThemeColor.Light1;
            range1.Borders[BordersIndex.EdgeBottom].TintAndShade = -0.5;
            range1.Font.Bold = true;
            IRange range2 = worksheet.Range["E7, E10"];
            range2.Borders[BordersIndex.EdgeRight].LineStyle    = BorderLineStyle.Thin;
            range2.Borders[BordersIndex.EdgeRight].ThemeColor   = ThemeColor.Light1;
            range2.Borders[BordersIndex.EdgeRight].TintAndShade = -0.5;
            #endregion

            #region Chart
            //create a new chart.
            IShape shape = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 8.99984251968504, 268.5, 627.750157480315, 184.5);

            //create series for chart.
            ISeries series_systolic  = shape.Chart.SeriesCollection.NewSeries();
            ISeries series_diatolic  = shape.Chart.SeriesCollection.NewSeries();
            ISeries series_HeartRate = shape.Chart.SeriesCollection.NewSeries();

            //set series formulas.
            series_systolic.Formula = "=SERIES('BLOOD PRESSURE DATA'!$E$36,'BLOOD PRESSURE DATA'!$C$37:$D$44,'BLOOD PRESSURE DATA'!$E$37:$E$44,1)";
            series_diatolic.Formula = "=SERIES('BLOOD PRESSURE DATA'!$F$36,'BLOOD PRESSURE DATA'!$C$37:$D$44,'BLOOD PRESSURE DATA'!$F$37:$F$44,2)";

            //set series plot on secondary axis, and change its chart type.
            series_HeartRate.AxisGroup = AxisGroup.Secondary;
            series_HeartRate.ChartType = ChartType.Line;
            series_HeartRate.Formula   = "=SERIES('BLOOD PRESSURE DATA'!$G$36,,'BLOOD PRESSURE DATA'!$G$37:$G$44,3)";

            //set series fill to gradient fill.
            series_systolic.Format.Fill.TwoColorGradient(GradientStyle.Horizontal, 1);
            series_systolic.Format.Fill.GradientAngle = 270;
            series_systolic.Format.Fill.GradientStops[0].Color.RGB = Color.FromArgb(255, 172, 175);
            series_systolic.Format.Fill.GradientStops[1].Color.RGB = Color.FromArgb(255, 227, 228);
            series_systolic.Format.Fill.GradientStops.Insert(0xFEC6C8, 0.35);
            series_systolic.Format.Line.Color.ObjectThemeColor = ThemeColor.Accent6;

            series_diatolic.Format.Fill.TwoColorGradient(GradientStyle.Horizontal, 1);
            series_diatolic.Format.Fill.GradientAngle = 270;
            series_diatolic.Format.Fill.GradientStops[0].Color.RGB = Color.FromArgb(255, 192, 147);
            series_diatolic.Format.Fill.GradientStops[1].Color.RGB = Color.FromArgb(255, 227, 212);
            series_diatolic.Format.Fill.GradientStops.Insert(0xFFCBA9, 0.35);
            series_diatolic.Format.Line.Color.ObjectThemeColor = ThemeColor.Accent5;

            //set series gap width and overlap.
            shape.Chart.ColumnGroups[0].GapWidth = 150;
            shape.Chart.ColumnGroups[0].Overlap  = 0;

            //set series line style.
            series_HeartRate.Format.Line.BeginArrowheadLength   = ArrowheadLength.Medium;
            series_HeartRate.Format.Line.BeginArrowheadStyle    = ArrowheadStyle.None;
            series_HeartRate.Format.Line.BeginArrowheadWidth    = ArrowheadWidth.Medium;
            series_HeartRate.Format.Line.Color.ObjectThemeColor = ThemeColor.Accent4;
            series_HeartRate.Format.Line.Color.TintAndShade     = 0;
            series_HeartRate.Format.Line.DashStyle          = LineDashStyle.Solid;
            series_HeartRate.Format.Line.EndArrowheadLength = ArrowheadLength.Medium;
            series_HeartRate.Format.Line.EndArrowheadStyle  = ArrowheadStyle.None;
            series_HeartRate.Format.Line.EndArrowheadWidth  = ArrowheadWidth.Medium;
            series_HeartRate.Format.Line.Style  = LineStyle.Single;
            series_HeartRate.Format.Line.Weight = 1.25;

            IAxis primary_axis = shape.Chart.Axes.Item(AxisType.Value, AxisGroup.Primary);
            primary_axis.HasTitle                  = true;
            primary_axis.AxisTitle.Text            = "BLOOD PRESSURE";
            primary_axis.AxisTitle.IncludeInLayout = true;

            IAxis secondary_axis = shape.Chart.Axes.Item(AxisType.Value, AxisGroup.Secondary);
            secondary_axis.HasTitle                  = true;
            secondary_axis.AxisTitle.Text            = "HEART RATE";
            secondary_axis.AxisTitle.IncludeInLayout = true;

            IAxis category_axis = shape.Chart.Axes.Item(AxisType.Category, AxisGroup.Primary);
            category_axis.HasTitle     = true;
            category_axis.CategoryType = CategoryType.CategoryScale;
            category_axis.Format.Line.Color.ColorType = SolidColorType.None;

            shape.Chart.HasTitle = false;
            //set chart font style.
            shape.Chart.ChartArea.Font.Size = 9;
            shape.Chart.ChartArea.Font.Color.ObjectThemeColor = ThemeColor.Dark1;
            shape.Chart.ChartArea.Font.Color.Brightness       = 0.5;
            #endregion


            #region Shape
            IShape shape1 = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 402, 77.25, 234, 100);
            shape1.Fill.Solid();
            shape1.Fill.Color.ObjectThemeColor = ThemeColor.Accent1;
            shape1.Fill.Color.Brightness       = 0.6;
            //set shape's border to no line.
            shape1.Line.Color.ColorType = SolidColorType.None;

            //set shape rich text.
            ITextRange shape1_p1 = shape1.TextFrame.TextRange.Paragraphs[0];
            shape1_p1.Text = "*";
            shape1_p1.Runs.Add(" Blood pressures may vary dependent on many");
            shape1_p1.Runs.Add(" factors.  Always consult with a physician about what is normal for you.  These numbers may vary slightly.");

            ITextRange shape1_p2 = shape1.TextFrame.TextRange.Paragraphs.Add("");
            ITextRange shape1_p3 = shape1.TextFrame.TextRange.Paragraphs.Add("Info from National Institute of Health:");
            ITextRange shape1_p4 = shape1.TextFrame.TextRange.Paragraphs.Add("http://www.nhlbi.nih.gov/health/health-topics/topics/hbp/");

            shape1.TextFrame.TextRange.Font.Size      = 10;
            shape1.TextFrame.TextRange.Font.ThemeFont = ThemeFont.Minor;
            shape1.TextFrame.TextRange.Font.Color.ObjectThemeColor = ThemeColor.Dark1;
            shape1.TextFrame.TextRange.Font.Color.Brightness       = 0.25;
            shape1_p3.Runs[0].Font.Bold = true;

            IShape shape2 = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 421.5, 546.75, 198, 50);
            shape2.Fill.Solid();
            shape2.Fill.Color.ObjectThemeColor = ThemeColor.Accent3;
            shape2.Fill.Color.Brightness       = 0.6;
            //set shape's border to no line.
            shape2.Line.Color.ColorType = SolidColorType.None;

            ITextRange shape2_p1 = shape2.TextFrame.TextRange.Paragraphs[0];
            shape2_p1.Text = "NOTE:";
            shape2_p1.Runs.Add(" Any blood pressure readings over the indicated numbers (\"CALL PHYSICIAN IF ABOVE\") will be");
            shape2_p1.Runs.Add(" highlighted.");

            shape2.TextFrame.TextRange.Font.Size      = 10;
            shape2.TextFrame.TextRange.Font.ThemeFont = ThemeFont.Minor;
            shape2.TextFrame.TextRange.Font.Color.ObjectThemeColor = ThemeColor.Dark1;
            shape2.TextFrame.TextRange.Font.Color.Brightness       = 0.25;
            shape2_p1.Runs[0].Font.Bold = true;
            #endregion

            #region DefinedName
            //create defined names for workbook.
            workbook.Names.Add("MaxDiastolic", "='BLOOD PRESSURE DATA'!$F$10");
            workbook.Names.Add("MaxSystolic", "='BLOOD PRESSURE DATA'!$E$10");
            #endregion

            #region ConditionalFormat
            //create conditional format for ranges.
            IFormatCondition condition1 = worksheet.Range["E37:E44"].FormatConditions.Add(FormatConditionType.Expression, formula1: "=E37>MaxSystolic") as IFormatCondition;
            IFormatCondition condition2 = worksheet.Range["F37:F44"].FormatConditions.Add(FormatConditionType.Expression, formula1: "=F37>MaxDiastolic") as IFormatCondition;
            condition1.Interior.Color = Color.Red;
            condition2.Interior.Color = Color.Red;
            #endregion
        }
Ejemplo n.º 10
0
    public string GetThemeInfo(string ThemeID)
    {
        string RetVal = string.Empty;
        string TempFileWPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath + Constants.FolderName.TempCYV, DateTime.Now.Ticks.ToString() + ".xml");
        string AbsoluteTempFile = HttpContext.Current.Request.Url.AbsoluteUri;
        string MapFolder = string.Empty;
        Map diMap = null;
        Themes themes = null;
        bool visible = false;

        try
        {
            //step To load map from session/ NewMap/ From preserved file
            diMap = this.GetSessionMapObject();

            if (!string.IsNullOrEmpty(ThemeID))
            {
                themes = new Themes();
                visible = diMap.Themes[ThemeID].Visible;

                Theme theme = (Theme)diMap.Themes[ThemeID].Clone();
                theme.AreaIndexes = new System.Collections.Hashtable();
                themes.Add(theme);
                theme.Visible = visible;
            }
            else
            {
                themes = (Themes)diMap.Themes.Clone();
                foreach (Theme theme in themes)
                {
                    theme.Visible = diMap.Themes[theme.ID].Visible;
                    theme.AreaIndexes = new System.Collections.Hashtable();
                }
            }

            //get theme info xml for all themes
            RetVal = this.GetXmlOfSerializeObject(TempFileWPath, themes);

        }
        catch (Exception ex)
        {
            //Global.WriteErrorsInLog("From GetThemeInfo ->" + ex.Message);
            RetVal = "false" + Constants.Delimiters.ParamDelimiter + ex.Message;
            Global.CreateExceptionString(ex, null);

        }
        finally
        {
        }

        return RetVal;
    }
Ejemplo n.º 11
0
        public ADXProFunctionChart(ChartView BaseChart)
        {
            this.adxFunction = new ADXFunction();
            this.candle      = new Candle();
            this.line        = new Line();
            this.myAxisLeft  = new Axis();
            this.BaseChart   = BaseChart;
            this.var         = new Variables.Variables();

            Themes.CandleGodStyle(candle);

            BaseChart.Chart.Header.Text = "Average Directional Change (ADX)";

            BaseChart.Chart.Series.Add(candle);
            BaseChart.Chart.Series.Add(line);
            BaseChart.Chart.Axes.Custom.Add(myAxisLeft);

            BaseChart.Chart.Axes.Left.RelativePosition = 0;
            BaseChart.Chart.Axes.Left.StartPosition    = 0;
            BaseChart.Chart.Axes.Left.EndPosition      = 55;
            //BaseChart.Chart.Axes.Left.Automatic = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Left.Increment          = 20;

            BaseChart.Chart.Axes.Bottom.RelativePosition = 0;
            BaseChart.Chart.Axes.Bottom.StartPosition    = 0;
            BaseChart.Chart.Axes.Bottom.EndPosition      = 100;
            //BaseChart.Chart.Axes.Bottom.Automatic = true;

            myAxisLeft = Themes.CustomAxisLeft(myAxisLeft);

            FillSampleValues(candle);
            candle.HorizAxis = HorizontalAxis.Bottom;
            candle.VertAxis  = VerticalAxis.Left;
            candle.Title     = "Data Source";

            line.HorizAxis      = HorizontalAxis.Bottom;
            line.VertAxis       = VerticalAxis.Custom;
            line.CustomVertAxis = myAxisLeft;
            line.Function       = adxFunction;
            line.DataSource     = candle;
            line.Title          = "ADX";
            line.LinePen.Width  = 3;
            line.Color          = var.GetPaletteBasic[4];

            adxFunction.Period                = 2;
            adxFunction.DMDown.Color          = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(151)))), ((int)(((byte)(168)))));
            adxFunction.DMDown.ColorEach      = false;
            adxFunction.DMDown.CustomVertAxis = myAxisLeft;
            adxFunction.DMDown.LinePen.Color  = var.GetPaletteBasic[2];
            adxFunction.DMDown.LinePen.Width  = 3;
            adxFunction.DMDown.Marks.Brush.Gradient.EndColor    = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))));
            adxFunction.DMDown.Marks.Brush.Gradient.MiddleColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            adxFunction.DMDown.Marks.Brush.Gradient.StartColor  = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            adxFunction.DMDown.Marks.Callout.ArrowHead          = ArrowHeadStyles.None;
            adxFunction.DMDown.Marks.Callout.ArrowHeadSize      = 8;
            adxFunction.DMDown.Marks.Callout.Brush.Color        = System.Drawing.Color.Black;
            adxFunction.DMDown.Marks.Callout.Distance           = 0;
            adxFunction.DMDown.Marks.Callout.Draw3D             = false;
            adxFunction.DMDown.Marks.Callout.Length             = 10;
            adxFunction.DMDown.Marks.Callout.Style    = PointerStyles.Rectangle;
            adxFunction.DMDown.Marks.Callout.Visible  = false;
            adxFunction.DMDown.Marks.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            adxFunction.DMDown.Marks.Transparent      = true;
            adxFunction.DMDown.Legend.Visible         = false;
            adxFunction.DMDown.Title              = "DMDown";
            adxFunction.DMDown.TreatNulls         = TreatNullsStyle.Ignore;
            adxFunction.DMDown.VertAxis           = VerticalAxis.Custom;
            adxFunction.DMDown.CustomVertAxis     = myAxisLeft;
            adxFunction.DMDown.XValues.DataMember = "X";
            adxFunction.DMDown.XValues.DateTime   = true;
            adxFunction.DMDown.XValues.Order      = ValueListOrder.Ascending;
            adxFunction.DMDown.YValues.DataMember = "Y";

            adxFunction.DMUp.Color         = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(76)))), ((int)(((byte)(20)))));
            adxFunction.DMUp.ColorEach     = false;
            adxFunction.DMUp.LinePen.Color = var.GetPaletteBasic[3];
            adxFunction.DMUp.LinePen.Width = 3;
            adxFunction.DMUp.Marks.Brush.Gradient.EndColor    = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))));
            adxFunction.DMUp.Marks.Brush.Gradient.MiddleColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            adxFunction.DMUp.Marks.Brush.Gradient.StartColor  = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            adxFunction.DMUp.Marks.Callout.ArrowHead          = ArrowHeadStyles.None;
            adxFunction.DMUp.Marks.Callout.ArrowHeadSize      = 8;
            adxFunction.DMUp.Marks.Callout.Brush.Color        = System.Drawing.Color.Black;
            adxFunction.DMUp.Marks.Callout.Distance           = 0;
            adxFunction.DMUp.Marks.Callout.Draw3D             = false;
            adxFunction.DMUp.Marks.Callout.Length             = 10;
            adxFunction.DMUp.Marks.Callout.Style    = PointerStyles.Rectangle;
            adxFunction.DMUp.Marks.Callout.Visible  = false;
            adxFunction.DMUp.Marks.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            adxFunction.DMUp.Marks.Transparent      = true;
            adxFunction.DMUp.Legend.Visible         = false;
            adxFunction.DMUp.Title              = "DMUp";
            adxFunction.DMUp.TreatNulls         = TreatNullsStyle.Ignore;
            adxFunction.DMUp.VertAxis           = VerticalAxis.Custom;
            adxFunction.DMUp.CustomVertAxis     = myAxisLeft;
            adxFunction.DMUp.XValues.DataMember = "X";
            adxFunction.DMUp.XValues.DateTime   = true;
            adxFunction.DMUp.XValues.Order      = ValueListOrder.Ascending;
            adxFunction.DMUp.YValues.DataMember = "Y";

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue - 10, BaseChart.Chart.Axes.Left.MaxYValue + 10);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue - 1, BaseChart.Chart.Axes.Bottom.MaxXValue + 1);
        }
Ejemplo n.º 12
0
 public static void SetTheme(DependencyObject d, Themes value)
 {
     d.SetValue(ThemeProperty, value);
 }
 public AppearanceChangedEventArgs(Themes theme, ForegroundColorVariations colorVariation)
 {
     this.Theme = theme;
     this.ColorVariation = colorVariation;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Reads current theme id from the local storage and loads it.
        /// </summary>
        public static void LoadTheme()
        {
            Themes currentTheme = CurrentTheme();

            ChangeTheme(currentTheme);
        }
Ejemplo n.º 15
0
        public override void Execute(GrapeCity.Documents.Excel.Workbook workbook)
        {
            object[,] data = new object[, ] {
                { "Cost Center", "Annual Cost", "Percent of Total", "Cumulative Percent" },
                { "Parts and materials", 1325000, null, null },
                { "Manufacturing equipment", 900500, null, null },
                { "Salaries", 575000, null, null },
                { "Maintenance", 395000, null, null },
                { "Office lease", 295000, null, null },
                { "Warehouse lease", 250000, null, null },
                { "Insurance", 180000, null, null },
                { "Benefits and pensions", 130000, null, null },
                { "Vehicles", 125000, null, null },
                { "Research", 75000, null, null },
            };

            IWorksheet worksheet = workbook.Worksheets[0];

            worksheet.Name     = "COST DATA and CHART";
            worksheet.TabColor = Color.FromRGB(63, 94, 101);
            worksheet.SheetView.DisplayGridlines = false;

            //Set Value.
            worksheet.Range["B2"].Value      = "COST ANALYSIS - PARETO";
            worksheet.Range["B39"].Value     = "COST ANALYSIS";
            worksheet.Range["B41:E51"].Value = data;

            //Set NumberFormat.
            worksheet.Range["C42:C52"].NumberFormat = "\"$\"#,##0.00_);[Red](\"$\"#,##0.00)";
            worksheet.Range["D42:E52"].NumberFormat = "0.00%";

            //Change the range's RowHeight and ColumnWidth.
            worksheet.StandardHeight           = 15.75;
            worksheet.StandardWidth            = 8.43;
            worksheet.Range["1:1"].RowHeight   = 12.75;
            worksheet.Range["2:2"].RowHeight   = 20.25;
            worksheet.Range["3:3"].RowHeight   = 16.5;
            worksheet.Range["39:39"].RowHeight = 20.25;
            worksheet.Range["40:40"].RowHeight = 16.5;
            worksheet.Range["41:41"].RowHeight = 29.25;
            worksheet.Range["42:51"].RowHeight = 20.1;
            worksheet.Range["A:A"].ColumnWidth = 1.44140625;
            worksheet.Range["B:B"].ColumnWidth = 25.88671875;
            worksheet.Range["C:C"].ColumnWidth = 18.5546875;
            worksheet.Range["D:D"].ColumnWidth = 17.77734375;
            worksheet.Range["E:E"].ColumnWidth = 20.77734375;

            //Apply one build in name style on the ranges.
            worksheet.Range["B2:J2"].Style   = workbook.Styles["Heading 1"];
            worksheet.Range["B39:E39"].Style = workbook.Styles["Heading 1"];

            //Create a table and apply one build in table style.
            ITable table = worksheet.Tables.Add(worksheet.Range["B41:E51"], true);

            table.Name       = "tblData";
            table.TableStyle = workbook.TableStyles["TableStyleLight9"];
            table.ShowTotals = true;
            table.ShowTableStyleRowStripes = true;

            //Use table formula in table range.
            worksheet.Range["D42:D51"].Formula = "=[@[Annual Cost]]/SUM([[Annual Cost]])";
            worksheet.Range["E42:E51"].Formula = "=SUM(INDEX([Percent of Total],1):[@[Percent of Total]])";
            table.Columns[1].TotalsCalculation = TotalsCalculation.Sum;
            table.Columns[2].TotalsCalculation = TotalsCalculation.Sum;
            table.Columns[3].TotalsCalculation = TotalsCalculation.None;

            //Add chart.
            IShape shape = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 9.75, 48, 597, 472.5);

            shape.Name = "Pareto Chart";

            //Add Series.
            ISeries series_ColumnClustered = shape.Chart.SeriesCollection.NewSeries();

            series_ColumnClustered.Formula = "=SERIES('COST DATA and CHART'!$C$41,'COST DATA and CHART'!$B$42:$B$51,'COST DATA and CHART'!$C$42:$C$51,1)";
            series_ColumnClustered.Format.Fill.TwoColorGradient(GradientStyle.Horizontal, 1);
            series_ColumnClustered.Format.Fill.GradientAngle = 90;
            series_ColumnClustered.Format.Fill.GradientStops[0].Color.ObjectThemeColor = ThemeColor.Accent1;
            series_ColumnClustered.Format.Fill.GradientStops[0].Color.Brightness       = 0;
            series_ColumnClustered.Format.Fill.GradientStops[0].Position = 0;
            series_ColumnClustered.Format.Fill.GradientStops[1].Color.ObjectThemeColor = ThemeColor.Accent1;
            series_ColumnClustered.Format.Fill.GradientStops[1].Color.Brightness       = -0.16;
            series_ColumnClustered.Format.Fill.GradientStops[1].Position = 1;
            series_ColumnClustered.Format.Line.Color.ObjectThemeColor    = ThemeColor.Light1;

            ISeries series_Line = shape.Chart.SeriesCollection.NewSeries();

            series_Line.ChartType          = ChartType.Line;
            series_Line.Formula            = "=SERIES('COST DATA and CHART'!$E$41,,'COST DATA and CHART'!$E$42:$E$51,2)";
            series_Line.Format.Line.Weight = 2.25;
            series_Line.AxisGroup          = AxisGroup.Secondary;

            //Change the secondary's maxinumscale.
            IAxis secondary_axis = shape.Chart.Axes.Item(AxisType.Value, AxisGroup.Secondary);

            secondary_axis.MaximumScale = 1.0;

            //Set the chart's title format.
            shape.Chart.ChartTitle.Text           = "Cost Center";
            shape.Chart.ChartTitle.Font.ThemeFont = ThemeFont.Minor;
            shape.Chart.ChartTitle.Font.Color.RGB = Color.FromRGB(89, 89, 89);
            shape.Chart.ChartTitle.Font.Size      = 18;

            //Set the chart has no legend.
            shape.Chart.HasLegend = false;

            //Set the char group's Overlap and GapWidth.
            shape.Chart.ColumnGroups[0].Overlap  = 0;
            shape.Chart.ColumnGroups[0].GapWidth = 0;

            //Set chart area's format.
            shape.Chart.ChartArea.Format.Fill.PresetGradient(GradientStyle.Horizontal, 1, PresetGradientType.EarlySunset);
            shape.Chart.ChartArea.Format.Fill.GradientStops.Delete(3);
            shape.Chart.ChartArea.Format.Fill.GradientStops.Delete(3);
            shape.Chart.ChartArea.Format.Fill.GradientAngle = 90;
            shape.Chart.ChartArea.Format.Fill.GradientStops[0].Color.ObjectThemeColor = ThemeColor.Light1;
            shape.Chart.ChartArea.Format.Fill.GradientStops[0].Color.Brightness       = 0;
            shape.Chart.ChartArea.Format.Fill.GradientStops[0].Position = 0;
            shape.Chart.ChartArea.Format.Fill.GradientStops[1].Color.ObjectThemeColor = ThemeColor.Light1;
            shape.Chart.ChartArea.Format.Fill.GradientStops[1].Color.Brightness       = -0.15;
            shape.Chart.ChartArea.Format.Fill.GradientStops[1].Position = 0.68;
            shape.Chart.ChartArea.Format.Fill.GradientStops[2].Color.ObjectThemeColor = ThemeColor.Light1;
            shape.Chart.ChartArea.Format.Fill.GradientStops[2].Color.Brightness       = 0;
            shape.Chart.ChartArea.Format.Fill.GradientStops[2].Position = 1;

            //Create customize theme.
            Themes themes = new Themes();
            ITheme theme  = themes.Add("test");

            theme.ThemeColorScheme[ThemeColor.Dark1].RGB              = Color.FromRGB(0, 0, 0);
            theme.ThemeColorScheme[ThemeColor.Light1].RGB             = Color.FromRGB(255, 255, 255);
            theme.ThemeColorScheme[ThemeColor.Dark2].RGB              = Color.FromRGB(96, 89, 88);
            theme.ThemeColorScheme[ThemeColor.Light2].RGB             = Color.FromRGB(241, 246, 246);
            theme.ThemeColorScheme[ThemeColor.Accent1].RGB            = Color.FromRGB(63, 94, 101);
            theme.ThemeColorScheme[ThemeColor.Accent2].RGB            = Color.FromRGB(224, 170, 83);
            theme.ThemeColorScheme[ThemeColor.Accent3].RGB            = Color.FromRGB(179, 29, 66);
            theme.ThemeColorScheme[ThemeColor.Accent4].RGB            = Color.FromRGB(162, 67, 162);
            theme.ThemeColorScheme[ThemeColor.Accent5].RGB            = Color.FromRGB(120, 59, 101);
            theme.ThemeColorScheme[ThemeColor.Accent6].RGB            = Color.FromRGB(55, 120, 169);
            theme.ThemeColorScheme[ThemeColor.Hyperlink].RGB          = Color.FromRGB(71, 166, 181);
            theme.ThemeColorScheme[ThemeColor.FollowedHyperlink].RGB  = Color.FromRGB(120, 59, 101);
            theme.ThemeFontScheme.Major[FontLanguageIndex.Latin].Name = "Constantia";
            theme.ThemeFontScheme.Minor[FontLanguageIndex.Latin].Name = "Helvetica";

            //Apply the above custom theme.
            workbook.Theme = theme;

            //Set active cell.
            worksheet.Range["B43"].Activate();
        }
Ejemplo n.º 16
0
 /// <summary>
 /// The get default image.
 /// </summary>
 /// <returns>
 /// The default image link.
 /// </returns>
 public static string GetDefaultImage()
 {
     return(Themes.MapTheme(Client.GetItemNotNull("/sitecore/content/Applications/WebEdit/WebEdit Texts", Client.CoreDatabase)["Default Image"]));
 }
Ejemplo n.º 17
0
	//Returns an integer, the List index of where the theme can be found in SpriteDatabase.
	//If there's no match (eg. SpriteDatabase List isn't assigned in the inspector, it will return the first index (0)
	int FindThemeIndex(Themes t){
		for (int i = 0; i < sd.sprites.Count; i++) {
			if (sd.sprites[i].theme.theme == chosenTheme.theme)
				return i;
		}
		return 0;
	}
Ejemplo n.º 18
0
 public void AddColorToTheme(Theme theme, ColorEntry entry)
 {
     Themes[Themes.IndexOf(theme)].ColorEntries.Add(entry);
 }
Ejemplo n.º 19
0
 private Themes GetTheme(string name, Themes deflt)
 {
     if (PropertyExists(name))
     {
         string inst = (string)Properties.Settings.Default[name];
         switch (inst)
         {
             case "Windows8":
                 return Themes.Windows8;
             case "Dark":
                 return Themes.Dark;
             case "Office":
                 return Themes.Office;
             default:
                 return Themes.Windows8;
         }
     }
     else
     {
         return deflt;
     }
 }
Ejemplo n.º 20
0
        private Workbook GetToToList()
        {
            Workbook workbook = new Workbook();

            object[,] data = new object[, ] {
                { "TASK", "PRIORITY", "STATUS", "START DATE", "DUE DATE", "% COMPLETE", "DONE?", "NOTES" },
                { "First Thing I Need To Do", "Normal", "Not Started", null, null, 0, null, null },
                { "Other Thing I Need To Finish", "High", "In Progress", null, null, 0.5, null, null },
                { "Something Else To Get Done", "Low", "Complete", null, null, 1, null, null },
                { "More Errands And Things", "Normal", "In Progress", null, null, 0.75, null, null },
                { "So Much To Get Done This Week", "High", "In Progress", null, null, 0.25, null, null }
            };

            IWorksheet worksheet = workbook.Worksheets[0];

            worksheet.Name     = "To-Do List";
            worksheet.TabColor = Color.FromArgb(148, 112, 135);
            worksheet.SheetView.DisplayGridlines = false;

            //Set Value.
            worksheet.Range["B1"].Value    = "To-Do List";
            worksheet.Range["B2:I7"].Value = data;

            //Set formula.
            worksheet.Range["E3"].Formula = "=TODAY()";
            worksheet.Range["E4"].Formula = "=TODAY()-30";
            worksheet.Range["E5"].Formula = "=TODAY()-23";
            worksheet.Range["E6"].Formula = "=TODAY()-15";
            worksheet.Range["E7"].Formula = "=TODAY()-5";

            //Change the range's RowHeight and ColumnWidth.
            worksheet.StandardHeight           = 30;
            worksheet.StandardWidth            = 8.88671875;
            worksheet.Range["1:1"].RowHeight   = 72.75;
            worksheet.Range["2:2"].RowHeight   = 33;
            worksheet.Range["3:7"].RowHeight   = 30;
            worksheet.Range["A:A"].ColumnWidth = 2.77734375;
            worksheet.Range["B:B"].ColumnWidth = 29.109375;
            worksheet.Range["C:G"].ColumnWidth = 16.77734375;
            worksheet.Range["H:H"].ColumnWidth = 10.77734375;
            worksheet.Range["I:I"].ColumnWidth = 29.6640625;
            worksheet.Range["J:J"].ColumnWidth = 2.77734375;

            //Modify the build in name styles.
            var nameStyle_Normal = workbook.Styles["Normal"];

            nameStyle_Normal.VerticalAlignment = VerticalAlignment.Center;
            nameStyle_Normal.WrapText          = true;
            nameStyle_Normal.Font.ThemeFont    = ThemeFont.Minor;
            nameStyle_Normal.Font.ThemeColor   = ThemeColor.Dark1;
            nameStyle_Normal.Font.TintAndShade = 0.25;

            var nameStyle_Title = workbook.Styles["Title"];

            nameStyle_Title.HorizontalAlignment = HorizontalAlignment.General;
            nameStyle_Title.VerticalAlignment   = VerticalAlignment.Bottom;
            nameStyle_Title.Font.ThemeFont      = ThemeFont.Minor;
            nameStyle_Title.Font.Bold           = true;
            nameStyle_Title.Font.Size           = 38;
            nameStyle_Title.Font.ThemeColor     = ThemeColor.Dark1;
            nameStyle_Title.Font.TintAndShade   = 0.249946592608417;
            nameStyle_Title.Borders[BordersIndex.EdgeBottom].LineStyle  = BorderLineStyle.Thick;
            nameStyle_Title.Borders[BordersIndex.EdgeBottom].ThemeColor = ThemeColor.Dark1;
            nameStyle_Title.IncludeAlignment = true;
            nameStyle_Title.IncludeBorder    = true;

            var nameStyle_Percent = workbook.Styles["Percent"];

            nameStyle_Percent.HorizontalAlignment = HorizontalAlignment.Right;
            nameStyle_Percent.IndentLevel         = 1;
            nameStyle_Percent.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Percent.IncludeAlignment    = true;

            var nameStyle_Heading_1 = workbook.Styles["Heading 1"];

            nameStyle_Heading_1.HorizontalAlignment = HorizontalAlignment.Left;
            nameStyle_Heading_1.VerticalAlignment   = VerticalAlignment.Bottom;
            nameStyle_Heading_1.Font.ThemeFont      = ThemeFont.Major;
            nameStyle_Heading_1.Font.Bold           = false;
            nameStyle_Heading_1.Font.Size           = 11;
            nameStyle_Heading_1.Font.ThemeColor     = ThemeColor.Dark1;
            nameStyle_Heading_1.Font.TintAndShade   = 0.249946592608417;
            nameStyle_Heading_1.Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.None;
            nameStyle_Heading_1.IncludeNumber    = true;
            nameStyle_Heading_1.IncludeAlignment = true;
            nameStyle_Heading_1.IncludeBorder    = false;

            var nameStyle_Heading_2 = workbook.Styles["Heading 2"];

            nameStyle_Heading_2.HorizontalAlignment = HorizontalAlignment.Right;
            nameStyle_Heading_2.IndentLevel         = 2;
            nameStyle_Heading_2.VerticalAlignment   = VerticalAlignment.Bottom;
            nameStyle_Heading_2.Font.ThemeFont      = ThemeFont.Major;
            nameStyle_Heading_2.Font.Bold           = false;
            nameStyle_Heading_2.Font.Size           = 11;
            nameStyle_Heading_2.Font.ThemeColor     = ThemeColor.Dark2;
            nameStyle_Heading_2.Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.None;
            nameStyle_Heading_2.IncludeNumber    = true;
            nameStyle_Heading_2.IncludeAlignment = true;

            //Create custom name styes.
            IStyle nameStyle_Done = workbook.Styles.Add("Done");

            nameStyle_Done.NumberFormat        = "\"Done\";\"\";\"\"";
            nameStyle_Done.HorizontalAlignment = HorizontalAlignment.Center;
            nameStyle_Done.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Done.Font.ThemeFont      = ThemeFont.Minor;
            nameStyle_Done.Font.ThemeColor     = ThemeColor.Light1;

            IStyle nameStyle_Date = workbook.Styles.Add("Date");

            nameStyle_Date.NumberFormat        = "yyyy/m/d";
            nameStyle_Date.HorizontalAlignment = HorizontalAlignment.Right;
            nameStyle_Date.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Date.Font.ThemeFont      = ThemeFont.Minor;
            nameStyle_Date.Font.ThemeColor     = ThemeColor.Dark1;
            nameStyle_Date.Font.TintAndShade   = 0.249946592608417;
            nameStyle_Date.IncludeBorder       = false;
            nameStyle_Date.IncludePatterns     = false;

            //Apply the above name styles on ranges.
            worksheet.Range["B1:I1"].Style = workbook.Styles["Title"];
            worksheet.Range["B2:D2"].Style = workbook.Styles["Heading 1"];
            worksheet.Range["E2:F2"].Style = workbook.Styles["Heading 2"];
            worksheet.Range["G2"].Style    = workbook.Styles["Heading 1"];
            worksheet.Range["H2:H7"].Style = workbook.Styles["Done"];
            worksheet.Range["I2"].Style    = workbook.Styles["Heading 1"];
            worksheet.Range["E3:F7"].Style = workbook.Styles["Date"];
            worksheet.Range["G3:G7"].Style = workbook.Styles["Percent"];

            //Add one custom table style.
            ITableStyle style           = workbook.TableStyles.Add("To-do List");
            var         wholeTableStyle = style.TableStyleElements[TableStyleElementType.WholeTable];

            wholeTableStyle.Borders[BordersIndex.EdgeBottom].LineStyle          = BorderLineStyle.Thin;
            wholeTableStyle.Borders[BordersIndex.EdgeBottom].ThemeColor         = ThemeColor.Light1;
            wholeTableStyle.Borders[BordersIndex.EdgeBottom].TintAndShade       = -0.14993743705557422;
            wholeTableStyle.Borders[BordersIndex.InsideHorizontal].LineStyle    = BorderLineStyle.Thin;
            wholeTableStyle.Borders[BordersIndex.InsideHorizontal].ThemeColor   = ThemeColor.Light1;
            wholeTableStyle.Borders[BordersIndex.InsideHorizontal].TintAndShade = -0.14993743705557422;

            //Create a table and apply the above table style.
            ITable table = worksheet.Tables.Add(worksheet.Range["B2:I7"], true);

            table.Name       = "ToDoList";
            table.TableStyle = style;

            //Use table formula in table range.
            worksheet.Range["F3"].Formula    = "=[@[START DATE]]+7";
            worksheet.Range["F4"].Formula    = "=[@[START DATE]]+35";
            worksheet.Range["F5"].Formula    = "=[@[START DATE]]+10";
            worksheet.Range["F6"].Formula    = "=[@[START DATE]]+36";
            worksheet.Range["F7"].Formula    = "=[@[START DATE]]+14";
            worksheet.Range["H3:H7"].Formula = "=--([@[% COMPLETE]]>=1)";

            //Add a expression rule.
            IFormatCondition expression = worksheet.Range["B3:I7"].FormatConditions.Add(FormatConditionType.Expression, FormatConditionOperator.Between, "=AND($G3=0,$G3<>\"\")", null) as IFormatCondition;

            expression.Interior.ThemeColor   = ThemeColor.Light1;
            expression.Interior.TintAndShade = -0.0499893185216834;

            //Add a data bar rule.
            IDataBar dataBar = worksheet.Range["G3:G7"].FormatConditions.AddDatabar();

            dataBar.BarFillType           = DataBarFillType.Solid;
            dataBar.BarColor.ThemeColor   = ThemeColor.Accent1;
            dataBar.BarColor.TintAndShade = 0.39997558519241921;

            //Add an icon set rule.
            IIconSetCondition iconSet = worksheet.Range["H3:H7"].FormatConditions.AddIconSetCondition();

            iconSet.IconSet = workbook.IconSets[IconSetType.Icon3Symbols];
            iconSet.IconCriteria[0].Operator = FormatConditionOperator.GreaterEqual;
            iconSet.IconCriteria[0].Value    = 1;
            iconSet.IconCriteria[0].Type     = ConditionValueTypes.Number;

            //Create list validations.
            worksheet.Range["C3:C7"].Validation.Add(ValidationType.List, ValidationAlertStyle.Warning, ValidationOperator.Between, "Low, Normal, High", null);
            IValidation validation = worksheet.Range["C3:C7"].Validation;

            validation.ErrorMessage = "Select entry from the list. Select CANCEL, then press ALT+DOWN ARROW to navigate the list. Select ENTER to make selection";

            worksheet.Range["D3:D7"].Validation.Add(ValidationType.List, ValidationAlertStyle.Warning, ValidationOperator.Between, "Not Started,In Progress, Deferred, Complete", null);
            validation = worksheet.Range["D3:D7"].Validation;
            validation.ErrorMessage = "Select entry from the list. Select CANCEL, then press ALT+DOWN ARROW to navigate the list. Select ENTER to make selection";

            worksheet.Range["G3:G7"].Validation.Add(ValidationType.List, ValidationAlertStyle.Warning, ValidationOperator.Between, "0%,25%,50%,75%,100%", null);
            validation = worksheet.Range["G3:G7"].Validation;
            validation.ErrorMessage = "Select entry from the list. Select CANCEL, then press ALT+DOWN ARROW to navigate the list. Select ENTER to make selection";

            //Create custom validation.
            worksheet.Range["F3:F7"].Validation.Add(ValidationType.Custom, ValidationAlertStyle.Warning, ValidationOperator.Between, "=F3>=E3", null);
            validation = worksheet.Range["F3:F7"].Validation;
            validation.ErrorMessage = "The Due Date must be greater than or equal to the Start Date. Select YES to keep the value, NO to retry or CANCEL to clear the entry";

            //Create none validations, set inputmessage.
            worksheet.Range["B2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["B2"].Validation;
            validation.InputMessage = "Enter Task in this column under this heading. Use heading filters to find specific entries";

            worksheet.Range["C2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["C2"].Validation;
            validation.InputMessage = "Select Priority in this column under this heading. Press ALT+DOWN ARROW to open the drop-down list, then ENTER to make selection";

            worksheet.Range["D2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["D2"].Validation;
            validation.InputMessage = "Select Status in this column under this heading.  Press ALT+DOWN ARROW to open the drop-down list, then ENTER to make selection";

            worksheet.Range["E2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["E2"].Validation;
            validation.InputMessage = "Enter Start Date in this column under this heading";

            worksheet.Range["F2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["F2"].Validation;
            validation.InputMessage = "Enter Due Date in this column under this heading";

            worksheet.Range["G2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["G2"].Validation;
            validation.InputMessage = "Select % Complete in this column. Press ALT+DOWN ARROW to open the drop-down list, then ENTER to make selection. A status bar indicates progress toward completion";

            worksheet.Range["H2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["H2"].Validation;
            validation.InputMessage = "Icon indicator for task completion in this column under this heading is automatically updated as tasks complete";

            worksheet.Range["I2"].Validation.Add(ValidationType.None, ValidationAlertStyle.Stop, ValidationOperator.Between, null, null);
            validation = worksheet.Range["I2"].Validation;
            validation.InputMessage = "Enter Notes in this column under this heading";

            //Create customize theme.
            Themes themes = new Themes();
            ITheme theme  = themes.Add("test");

            theme.ThemeColorScheme[ThemeColor.Dark1].RGB              = Color.FromArgb(0, 0, 0);
            theme.ThemeColorScheme[ThemeColor.Light1].RGB             = Color.FromArgb(255, 255, 255);
            theme.ThemeColorScheme[ThemeColor.Dark2].RGB              = Color.FromArgb(37, 28, 34);
            theme.ThemeColorScheme[ThemeColor.Light2].RGB             = Color.FromArgb(240, 248, 246);
            theme.ThemeColorScheme[ThemeColor.Accent1].RGB            = Color.FromArgb(148, 112, 135);
            theme.ThemeColorScheme[ThemeColor.Accent2].RGB            = Color.FromArgb(71, 166, 181);
            theme.ThemeColorScheme[ThemeColor.Accent3].RGB            = Color.FromArgb(234, 194, 53);
            theme.ThemeColorScheme[ThemeColor.Accent4].RGB            = Color.FromArgb(107, 192, 129);
            theme.ThemeColorScheme[ThemeColor.Accent5].RGB            = Color.FromArgb(233, 115, 61);
            theme.ThemeColorScheme[ThemeColor.Accent6].RGB            = Color.FromArgb(251, 147, 59);
            theme.ThemeColorScheme[ThemeColor.Hyperlink].RGB          = Color.FromArgb(71, 166, 181);
            theme.ThemeColorScheme[ThemeColor.FollowedHyperlink].RGB  = Color.FromArgb(148, 112, 135);
            theme.ThemeFontScheme.Major[FontLanguageIndex.Latin].Name = "Franklin Gothic Medium";
            theme.ThemeFontScheme.Minor[FontLanguageIndex.Latin].Name = "Bookman Old Style";

            //Apply the above custom theme.
            workbook.Theme = theme;

            //Set active cell.
            worksheet.Range["G4"].Activate();

            return(workbook);
        }
Ejemplo n.º 21
0
 private void SetCurrentTheme()
 {
     Visibility darkBackgroundVisibility;
     darkBackgroundVisibility = (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"];
     if (darkBackgroundVisibility == Visibility.Visible)
     {
         theme = Themes.Dark;
     }
     else
     {
         theme = Themes.Light;
     }
 }
        // Constructor
        public StackAreaChartFeatures(ChartView BaseChart)
        {
            // Inicializar variables
            area1 = new Area();
            area2 = new Area();
            var   = new Variables.Variables();
            tool_dataPointSelect = new DataPointSelection(BaseChart);

            // Propiedades del "Chart" base
            BaseChart.Chart.Series.Add(area2);
            BaseChart.Chart.Series.Add(area1);
            BaseChart.Chart.Legend.Visible           = true;
            BaseChart.Chart.Header.Text              = "Mensual sells by two companies";
            BaseChart.Chart.Axes.Bottom.LabelsOnAxis = true;

            // Propiedades de la "area1"
            area1.Title                  = "Company 1";
            area1.SeriesColor            = var.GetPaletteBasic[0];
            area1.Chart.Zoom.Allow       = false;
            area1.Chart.Panning.Allow    = ScrollModes.None;
            area1.RecalcOptions          = RecalcOptions.OnModify;
            area1.DefaultNullValue       = 0;
            area1.ClickableLine          = true;
            area1.AreaLines.Visible      = false;
            area1.LinePen.Width          = 5;
            area1.Pointer.Visible        = true;
            area1.Pointer.Style          = PointerStyles.Nothing;
            area1.Pointer.InflateMargins = false;
            area1.LinePen.Style          = DashStyle.Solid;
            area1.LinePen.EndCap         = PenLineCap.Flat;
            area1.LinePen.DashCap        = PenLineCap.Flat;
            area1.LinePen.Color          = var.GetPaletteBasic[0].AddLuminosity(-0.2);
            area1.ClickTolerance         = 30;
            area1.ClickPointer          += tool_dataPointSelect.PointValue_Click;
            area1.GetSeriesMark         += tool_dataPointSelect.Serie_GetSeriesMark;
            for (int i = 0; i < var.GetValorArea1.Length; i++)
            {
                area1.Add(var.GetValorArea1[i], var.GetValorAreaX[i]);
            }
            area1.VertAxis    = VerticalAxis.Both;
            area1.HorizAxis   = HorizontalAxis.Both;
            area1.Marks.OnTop = true;

            // Propiedades de la "area2"
            area2.Title               = "Company 2";
            area2.SeriesColor         = var.GetPaletteBasic[1];
            area2.Chart.Zoom.Allow    = false;
            area2.Chart.Panning.Allow = ScrollModes.None;
            area2.RecalcOptions       = RecalcOptions.OnModify;
            area2.DefaultNullValue    = 0;
            area2.ClickableLine       = true;
            area2.ClickTolerance      = 30;
            area2.Pointer.Visible     = true;
            area2.Pointer.Style       = PointerStyles.Nothing;
            area2.LinePen.Style       = DashStyle.Solid;
            area2.LinePen.EndCap      = PenLineCap.Flat;
            area2.LinePen.DashCap     = PenLineCap.Flat;
            area2.LinePen.Color       = var.GetPaletteBasic[0].AddLuminosity(-0.2);
            area2.LinePen.Color       = var.GetPaletteBasic[1].AddLuminosity(-0.2);
            area2.AreaLines.Visible   = false;
            area2.LinePen.Width       = 5;
            area2.ClickPointer       += tool_dataPointSelect.PointValue_Click;
            area2.GetSeriesMark      += tool_dataPointSelect.Serie_GetSeriesMark;
            for (int i = 0; i < var.GetValorArea2.Length; i++)
            {
                area2.Add(var.GetValorArea2[i], var.GetValorAreaX[i]);
            }
            area2.VertAxis    = VerticalAxis.Both;
            area2.HorizAxis   = HorizontalAxis.Both;
            area2.Marks.OnTop = true;

            area1.Stacked    = CustomStack.Stack;
            area2.Stacked    = CustomStack.Stack;
            area1.StackGroup = 1;
            area2.StackGroup = 1;

            // Propieades de los ejes del "Chart" base
            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue + 20);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue);
            BaseChart.Chart.Axes.Left.Labels.ValueFormat   = "0";
            BaseChart.Chart.Axes.Bottom.Labels.ValueFormat = "0";
            BaseChart.Chart.Axes.Bottom.Labels.TextAlign   = Xamarin.Forms.TextAlignment.Start;
            BaseChart.Chart.Axes.Left.Visible       = true;
            BaseChart.Chart.Axes.Left.Increment     = 20;
            BaseChart.Chart.Axes.Left.Title.Visible = false;
            BaseChart.Chart.Axes.Left.Ticks         = new Axis.TicksPen {
                Width = 2, Visible = true, Color = Color.FromArgb(200, 200, 200), EndCap = PenLineCap.Flat, Style = DashStyle.Solid, Length = 10
            };
            BaseChart.Chart.Axes.Left.LabelsOnAxis = true;

            BaseChart.Chart.Axes.Left.Labels.CustomSize = 10;
            BaseChart.Chart.Axes.Bottom.Title.Visible   = false;
            BaseChart.Chart.Axes.Left.AxisPen.Visible   = true;
            BaseChart.Chart.Axes.Left.Grid.Visible      = false;
            BaseChart.Chart.Axes.Bottom.Grid.Visible    = false;
            BaseChart.Chart.Legend.LegendStyle          = LegendStyles.Series;
            BaseChart.Chart.Panel.MarginRight           = 5;
            BaseChart.Chart.ClickSeries     += null;
            BaseChart.Chart.Panel.MarginLeft = 4;

            // Themes Marks
            Themes.AplicarMarksTheme1(BaseChart);
            area1.Marks.Width = 82;
            area2.Marks.Width = 82;
            //area2.Marks.
            //area1.Marks.ZPosition = 1;
        }
 private static void SetIconsSet(Themes theme)
 {
     switch (theme)
     {
         case Themes.Office_Blue:
         case Themes.Summer:
         case Themes.Vista:
         case Themes.Windows7:
             IconSources.ChangeIconsSet(IconsSet.Light);
             break;
         case Themes.Expression_Dark:
         case Themes.VisualStudio2013_Dark:
             IconSources.ChangeIconsSet(IconsSet.Dark);
             break;
         default:
             IconSources.ChangeIconsSet(IconsSet.Modern);
             break;
     }
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Synchronizes the color of the theme and.
 /// </summary>
 private void SyncThemeAndColor()
 {
     // synchronizes the selected viewmodel theme with the actual theme used by the appearance manager.
     SelectedTheme = Themes.FirstOrDefault(l => l.Source.Equals(AppearanceManager.Current.ThemeSource));
 }
Ejemplo n.º 25
0
 private void ApplicationThemeExportTemplate_Click(object sender, RoutedEventArgs e)
 {
     Themes.WriteThemeToDisk("Ugly Kulu-Ya-Ku");
     Themes.LoadThemes();
 }
Ejemplo n.º 26
0
 /// <summary>Initializes a new instance of the <see cref="Theme" /> class.</summary>
 /// <param name="themes">The internal themes.</param>
 public Theme(Themes themes)
 {
     LoadThemeFromResources(themes);
 }
        public override void Execute(GrapeCity.Documents.Excel.Workbook workbook)
        {
            object[,] data = new object[, ] {
                { null, "[Segment Name]", "[Segment Name]", "[Segment Name]", "Overall" },
                { "Customer Activity:", null, null, null, null },
                { "Number of active customers—Beginning of period", 5, 8, 8, null },
                { "Number of customers added", 2, 4, 4, null },
                { "Number of customers lost/terminated", -1, -2, -2, null },
                { "Number of active customers—End of period", null, null, null, null },
                { null, null, null, null, null },
                { "Profitability Analysis:", null, null, null, null },
                { "Revenue per segment", 1500000, 1800000, 2500000, null },
                { "Weighting", null, null, null, null },
                { null, null, null, null, null },
                { "Cost of sales:", null, null, null, null },
                { "Ongoing service and support costs", 1000000, 1400000, 1400000, null },
                { "Other direct customer costs", 200000, 100000, 100000, null },
                { "Total cost of sales", null, null, null, null },
                { "Gross margin", null, null, null, null },
                { "Weighting", null, null, null, null },
                { null, null, null, null, null },
                { "Other costs:", null, null, null, null },
                { "Customer acquisition", 105000, 120000, 235000, null },
                { "Customer marketing", 150000, 125000, 275000, null },
                { "Customer termination", 80000, 190000, 140000, null },
                { "Total other customer costs", null, null, null, null },
                { "Customer profit by segment", null, null, null, null },
                { "Weighting", null, null, null, null },
                { null, null, null, null, null },
                { "Summary Metrics:", "[Segment Name]", "[Segment Name]", "[Segment Name]", "Trend" },
                { "Average cost per acquired customer", null, null, null, null },
                { "Average cost per terminated customer", null, null, null, null },
                { "Average marketing cost per active customer", null, null, null, null },
                { "Average profit (loss) per customer", null, null, null, null },
            };

            IWorksheet worksheet = workbook.Worksheets[0];

            worksheet.Name     = "Customer Profitability";
            worksheet.TabColor = Color.FromRGB(131, 172, 121);
            worksheet.SheetView.DisplayGridlines = false;

            //Set Value.
            worksheet.Range["B2"].Value     = "[Company Name]";
            worksheet.Range["B3"].Value     = "Customer Profitability Analysis";
            worksheet.Range["B4"].Value     = "[Date]";
            worksheet.Range["B6"].Value     = "Gray cells will be calculated for you. You do not need to enter anything into them.";
            worksheet.Range["B7:F37"].Value = data;

            //Set formula.
            worksheet.Range["F9:F11"].Formula  = "=SUM(C9:E9)";
            worksheet.Range["C12:F12"].Formula = "=SUM(C9:C11)";

            worksheet.Range["C16:E16"].Formula = "=+C15/$F$15";
            worksheet.Range["F15:F16"].Formula = "=SUM(C15:E15)";

            worksheet.Range["F19:F20"].Formula = "=SUM(C19:E19)";
            worksheet.Range["C21:F21"].Formula = "=SUM(C19:C20)";
            worksheet.Range["C22:F22"].Formula = "=+C15-C21";
            worksheet.Range["C23:E23"].Formula = "=MAX(0, MIN(1,C22/$F$22))";
            worksheet.Range["F23"].Formula     = "=SUM(C23:E23)";

            worksheet.Range["F26:F28"].Formula = "=SUM(C26:E26)";
            worksheet.Range["C29:F29"].Formula = "=SUM(C26:C28)";
            worksheet.Range["C30:E30"].Formula = "=+C22-C29";
            worksheet.Range["C31:E31"].Formula = "=MAX(0,MIN(1, C30/$F$30))";
            worksheet.Range["F30:F31"].Formula = "=SUM(C30:E30)";

            worksheet.Range["C34:E34"].Formula = "=+C26/C10";
            worksheet.Range["C35:E35"].Formula = "=-C28/C11";
            worksheet.Range["C36:E36"].Formula = "=+C27/C12";
            worksheet.Range["C37:E37"].Formula = "=+C30/C12";

            //Change the range's RowHeight and ColumnWidth.
            worksheet.StandardHeight     = 15;
            worksheet.StandardWidth      = 9.140625;
            worksheet.Rows[0].RowHeight  = 9.95;
            worksheet.Rows[1].RowHeight  = 33;
            worksheet.Rows[2].RowHeight  = 27;
            worksheet.Rows[3].RowHeight  = 19.5;
            worksheet.Rows[4].RowHeight  = 9;
            worksheet.Rows[5].RowHeight  = 19.5;
            worksheet.Rows[6].RowHeight  = 18;
            worksheet.Rows[12].RowHeight = 9;
            worksheet.Rows[16].RowHeight = 9;
            worksheet.Rows[23].RowHeight = 9;
            worksheet.Rows[31].RowHeight = 9;

            worksheet.Columns[0].ColumnWidth = 1.85546875;
            worksheet.Columns[1].ColumnWidth = 46.7109375;
            worksheet.Columns[2].ColumnWidth = 16.42578125;
            worksheet.Columns[3].ColumnWidth = 16.42578125;
            worksheet.Columns[4].ColumnWidth = 16.42578125;
            worksheet.Columns[5].ColumnWidth = 16.42578125;

            //Modify the build in name styles.
            var nameStyle_Normal = workbook.Styles["Normal"];

            nameStyle_Normal.VerticalAlignment = VerticalAlignment.Center;
            nameStyle_Normal.Font.ThemeColor   = ThemeColor.Dark1;
            nameStyle_Normal.Font.TintAndShade = 0.249946592608417;
            nameStyle_Normal.Font.Size         = 10;

            var nameStyle_Heading_1 = workbook.Styles["Heading 1"];

            nameStyle_Heading_1.HorizontalAlignment = HorizontalAlignment.Left;
            nameStyle_Heading_1.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Heading_1.Font.ThemeFont      = ThemeFont.Major;
            nameStyle_Heading_1.Font.Bold           = false;
            nameStyle_Heading_1.Font.Size           = 24;
            nameStyle_Heading_1.Font.ThemeColor     = ThemeColor.Dark1;
            nameStyle_Heading_1.Font.TintAndShade   = 0.249946592608417;
            nameStyle_Heading_1.Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.None;
            nameStyle_Heading_1.IncludeAlignment = true;

            var nameStyle_Heading_2 = workbook.Styles["Heading 2"];

            nameStyle_Heading_2.HorizontalAlignment = HorizontalAlignment.Left;
            nameStyle_Heading_2.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Heading_2.Font.ThemeFont      = ThemeFont.Major;
            nameStyle_Heading_2.Font.Bold           = false;
            nameStyle_Heading_2.Font.Size           = 20;
            nameStyle_Heading_2.Font.ThemeColor     = ThemeColor.Dark1;
            nameStyle_Heading_2.Font.TintAndShade   = 0.249946592608417;
            nameStyle_Heading_2.Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.None;
            nameStyle_Heading_2.Interior.ThemeColor   = ThemeColor.Accent3;
            nameStyle_Heading_2.Interior.TintAndShade = 0.39994506668294322;
            nameStyle_Heading_2.IncludeNumber         = true;
            nameStyle_Heading_2.IncludePatterns       = true;

            var nameStyle_Heading_3 = workbook.Styles["Heading 3"];

            nameStyle_Heading_3.HorizontalAlignment = HorizontalAlignment.Left;
            nameStyle_Heading_3.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Heading_3.Font.ThemeFont      = ThemeFont.Major;
            nameStyle_Heading_3.Font.Bold           = false;
            nameStyle_Heading_3.Font.Size           = 14;
            nameStyle_Heading_3.Font.ThemeColor     = ThemeColor.Dark1;
            nameStyle_Heading_3.Font.TintAndShade   = 0.249946592608417;
            nameStyle_Heading_3.Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.None;
            nameStyle_Heading_3.IncludeAlignment = true;
            nameStyle_Heading_3.IncludePatterns  = true;

            var nameStyle_Heading_4 = workbook.Styles["Heading 4"];

            nameStyle_Heading_4.HorizontalAlignment = HorizontalAlignment.Left;
            nameStyle_Heading_4.VerticalAlignment   = VerticalAlignment.Center;
            nameStyle_Heading_4.Font.ThemeFont      = ThemeFont.Major;
            nameStyle_Heading_4.Font.Bold           = true;
            nameStyle_Heading_4.Font.Size           = 10;
            nameStyle_Heading_4.Font.ThemeColor     = ThemeColor.Light1;
            nameStyle_Heading_4.Font.TintAndShade   = -0.0499893185216834;
            nameStyle_Heading_4.Borders[BordersIndex.EdgeBottom].LineStyle = BorderLineStyle.None;
            nameStyle_Heading_4.Interior.ThemeColor   = ThemeColor.Accent3;
            nameStyle_Heading_4.Interior.TintAndShade = -0.249946592608417;
            nameStyle_Heading_4.IncludeAlignment      = true;
            nameStyle_Heading_4.IncludeBorder         = true;
            nameStyle_Heading_4.IncludePatterns       = true;

            //Apply the above name styles on ranges.
            worksheet.Range["B2:F2"].Style   = workbook.Styles["Heading 1"];
            worksheet.Range["B3:F3"].Style   = workbook.Styles["Heading 2"];
            worksheet.Range["B4:F4"].Style   = workbook.Styles["Heading 3"];
            worksheet.Range["B8:F8"].Style   = workbook.Styles["Heading 4"];
            worksheet.Range["B14:F14"].Style = workbook.Styles["Heading 4"];
            worksheet.Range["B18:F18"].Style = workbook.Styles["Heading 4"];
            worksheet.Range["B25:F25"].Style = workbook.Styles["Heading 4"];
            worksheet.Range["B33:F33"].Style = workbook.Styles["Heading 4"];

            //Set NumberFormat.
            worksheet.Range["C9:F12"].NumberFormat  = "0_);[Red](0)";
            worksheet.Range["C15:F15"].NumberFormat = "\"$\"#,##0.00_);[Red](\"$\"#,##0.00)";
            worksheet.Range["C16:F16"].NumberFormat = "0%";
            worksheet.Range["C19:F22"].NumberFormat = "\"$\"#,##0.00_);[Red](\"$\"#,##0.00)";
            worksheet.Range["C23:F23"].NumberFormat = "0%";
            worksheet.Range["C26:F30"].NumberFormat = "\"$\"#,##0.00_);[Red](\"$\"#,##0.00)";
            worksheet.Range["C31:F31"].NumberFormat = "0%";
            worksheet.Range["C34:F37"].NumberFormat = "\"$\"#,##0.00_);[Red](\"$\"#,##0.00)";

            //Set range's font style.
            worksheet.Range["B6"].Font.TintAndShade      = 0.34998626667073579;
            worksheet.Range["B6"].Font.Size              = 8;
            worksheet.Range["B6"].Font.Italic            = true;
            worksheet.Range["C7:F7"].Font.TintAndShade   = 0;
            worksheet.Range["B9:F12"].Font.TintAndShade  = 0;
            worksheet.Range["B15:F16"].Font.TintAndShade = 0;
            worksheet.Range["B19:F23"].Font.TintAndShade = 0;
            worksheet.Range["B26:F31"].Font.TintAndShade = 0;
            worksheet.Range["B34:F37"].Font.TintAndShade = 0;
            worksheet.Range["C33:F33"].Font.Bold         = false;

            //Set range's alignment.
            worksheet.Range["C7:F7"].HorizontalAlignment   = HorizontalAlignment.Center;
            worksheet.Range["C33:F33"].HorizontalAlignment = HorizontalAlignment.Center;

            //Set range's border
            worksheet.Range["B9:F12"].Borders.LineStyle    = BorderLineStyle.Thin;
            worksheet.Range["B9:F12"].Borders.ThemeColor   = ThemeColor.Accent3;
            worksheet.Range["B9:F12"].Borders.TintAndShade = 0.39994506668294322;

            worksheet.Range["B15:F16"].Borders.LineStyle    = BorderLineStyle.Thin;
            worksheet.Range["B15:F16"].Borders.ThemeColor   = ThemeColor.Accent3;
            worksheet.Range["B15:F16"].Borders.TintAndShade = 0.39994506668294322;

            worksheet.Range["B19:F23"].Borders.LineStyle    = BorderLineStyle.Thin;
            worksheet.Range["B19:F23"].Borders.ThemeColor   = ThemeColor.Accent3;
            worksheet.Range["B19:F23"].Borders.TintAndShade = 0.39994506668294322;

            worksheet.Range["B26:F31"].Borders.LineStyle    = BorderLineStyle.Thin;
            worksheet.Range["B26:F31"].Borders.ThemeColor   = ThemeColor.Accent3;
            worksheet.Range["B26:F31"].Borders.TintAndShade = 0.39994506668294322;

            worksheet.Range["B34:F37"].Borders.LineStyle    = BorderLineStyle.Thin;
            worksheet.Range["B34:F37"].Borders.ThemeColor   = ThemeColor.Accent3;
            worksheet.Range["B34:F37"].Borders.TintAndShade = 0.39994506668294322;

            //Set range's fill.
            worksheet.Range["F9:F12"].Interior.ThemeColor    = ThemeColor.Light1;
            worksheet.Range["F9:F12"].Interior.TintAndShade  = -0.0499893185216834;
            worksheet.Range["C12:E12"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["C12:E12"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["F15:F16"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["F15:F16"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["C16:E16"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["C16:E16"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["F19:F23"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["F19:F23"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["C21:E23"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["C21:E23"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["F26:F31"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["F26:F31"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["C29:E31"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["C29:E31"].Interior.TintAndShade = -0.0499893185216834;
            worksheet.Range["C34:E37"].Interior.ThemeColor   = ThemeColor.Light1;
            worksheet.Range["C34:E37"].Interior.TintAndShade = -0.0499893185216834;

            //create a new group of sparklines.
            ISparklineGroup sparklineGroup = worksheet.Range["F34:F37"].SparklineGroups.Add(SparkType.Line, "C34:E37");

            sparklineGroup.SeriesColor.ThemeColor               = ThemeColor.Accent3;
            sparklineGroup.SeriesColor.TintAndShade             = -0.249977111117893;
            sparklineGroup.Points.Negative.Color.ThemeColor     = ThemeColor.Accent4;
            sparklineGroup.Points.Markers.Color.ThemeColor      = ThemeColor.Accent4;
            sparklineGroup.Points.Markers.Color.TintAndShade    = -0.249977111117893;
            sparklineGroup.Points.Highpoint.Color.ThemeColor    = ThemeColor.Accent4;
            sparklineGroup.Points.Highpoint.Color.TintAndShade  = -0.249977111117893;
            sparklineGroup.Points.Lowpoint.Color.ThemeColor     = ThemeColor.Accent4;
            sparklineGroup.Points.Lowpoint.Color.TintAndShade   = -0.249977111117893;
            sparklineGroup.Points.Firstpoint.Color.ThemeColor   = ThemeColor.Accent4;
            sparklineGroup.Points.Firstpoint.Color.TintAndShade = -0.249977111117893;
            sparklineGroup.Points.Lastpoint.Color.ThemeColor    = ThemeColor.Accent4;
            sparklineGroup.Points.Lastpoint.Color.TintAndShade  = -0.249977111117893;
            sparklineGroup.Points.Negative.Visible              = false;
            sparklineGroup.Points.Firstpoint.Visible            = false;
            sparklineGroup.Points.Lastpoint.Visible             = false;

            //Add chart.
            IShape shape = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 9.75, 576.95, 590.25, 237);

            shape.Name = "Chart 3";

            //Add Series.
            ISeries series1 = shape.Chart.SeriesCollection.NewSeries();

            series1.Formula = "=SERIES('Customer Profitability'!$B$34,'Customer Profitability'!$C$33:$E$33,'Customer Profitability'!$C$34:$E$34,1)";
            series1.Format.Fill.Color.ObjectThemeColor = ThemeColor.Accent2;

            ISeries series2 = shape.Chart.SeriesCollection.NewSeries();

            series2.Formula = "=SERIES('Customer Profitability'!$B$35,'Customer Profitability'!$C$33:$E$33,'Customer Profitability'!$C$35:$E$35,2)";
            series2.Format.Fill.Color.ObjectThemeColor = ThemeColor.Accent4;

            ISeries series3 = shape.Chart.SeriesCollection.NewSeries();

            series3.Formula = "=SERIES('Customer Profitability'!$B$36,'Customer Profitability'!$C$33:$E$33,'Customer Profitability'!$C$36:$E$36,3)";
            series3.Format.Fill.Color.ObjectThemeColor = ThemeColor.Accent3;

            ISeries series4 = shape.Chart.SeriesCollection.NewSeries();

            series4.Formula = "=SERIES('Customer Profitability'!$B$37,'Customer Profitability'!$C$33:$E$33,'Customer Profitability'!$C$37:$E$37,4)";
            series4.Format.Fill.Color.ObjectThemeColor = ThemeColor.Accent5;

            //Set the char group's Overlap and GapWidth.
            shape.Chart.ColumnGroups[0].Overlap  = 0;
            shape.Chart.ColumnGroups[0].GapWidth = 199;

            //Set the chart's title format.
            var chartTitle = shape.Chart.ChartTitle;

            chartTitle.Text           = "Summary Metrics per Customer Segment";
            chartTitle.Font.ThemeFont = ThemeFont.Major;
            chartTitle.Font.Color.ObjectThemeColor = ThemeColor.Dark1;
            chartTitle.Font.Size = 20;

            //Set the chart legend's position.
            shape.Chart.Legend.Position = LegendPosition.Top;

            //Set category axis format.
            IAxis category_axis = shape.Chart.Axes.Item(AxisType.Category);

            category_axis.HasTitle                 = true;
            category_axis.AxisTitle.Text           = "SEGMENT";
            category_axis.AxisTitle.Font.Size      = 9;
            category_axis.AxisTitle.Font.ThemeFont = ThemeFont.Minor;

            //Set value axis format.
            IAxis value_axis = shape.Chart.Axes.Item(AxisType.Value);

            value_axis.CrossesAt         = -200000;
            value_axis.HasMinorGridlines = true;
            value_axis.MinorGridlines.Format.Line.Color.ObjectThemeColor = ThemeColor.Dark1;
            value_axis.MinorGridlines.Format.Line.Color.Brightness       = 0.95;

            //Create customize theme.
            Themes themes = new Themes();
            ITheme theme  = themes.Add("test");

            theme.ThemeColorScheme[ThemeColor.Dark1].RGB              = Color.FromRGB(0, 0, 0);
            theme.ThemeColorScheme[ThemeColor.Light1].RGB             = Color.FromRGB(255, 255, 255);
            theme.ThemeColorScheme[ThemeColor.Dark2].RGB              = Color.FromRGB(77, 70, 70);
            theme.ThemeColorScheme[ThemeColor.Light2].RGB             = Color.FromRGB(255, 251, 239);
            theme.ThemeColorScheme[ThemeColor.Accent1].RGB            = Color.FromRGB(255, 225, 132);
            theme.ThemeColorScheme[ThemeColor.Accent2].RGB            = Color.FromRGB(102, 173, 166);
            theme.ThemeColorScheme[ThemeColor.Accent3].RGB            = Color.FromRGB(131, 172, 121);
            theme.ThemeColorScheme[ThemeColor.Accent4].RGB            = Color.FromRGB(254, 191, 102);
            theme.ThemeColorScheme[ThemeColor.Accent5].RGB            = Color.FromRGB(219, 112, 87);
            theme.ThemeColorScheme[ThemeColor.Accent6].RGB            = Color.FromRGB(165, 115, 137);
            theme.ThemeColorScheme[ThemeColor.Hyperlink].RGB          = Color.FromRGB(102, 173, 166);
            theme.ThemeColorScheme[ThemeColor.FollowedHyperlink].RGB  = Color.FromRGB(165, 115, 137);
            theme.ThemeFontScheme.Major[FontLanguageIndex.Latin].Name = "Marion";
            theme.ThemeFontScheme.Minor[FontLanguageIndex.Latin].Name = "Marion";

            //Apply the above custom theme.
            workbook.Theme = theme;

            //Set active cell.
            worksheet.Range["B7"].Activate();
        }
Ejemplo n.º 28
0
        public Semi_PieChartFeatures(ChartView BaseChart)
        {
            pie1                 = new Pie();
            var                  = new Variables.Variables();
            this.BaseChart       = BaseChart;
            tool_dataPointSelect = new DataPointSelection(BaseChart);

            BaseChart.Chart.Header.Text = "Percentage of animals in the zoo (%)";
            BaseChart.Chart.Series.Add(pie1);
            BaseChart.Chart.Legend.Visible = true;

            pie1.SeriesColor         = var.GetPaletteBasic[0];
            pie1.Chart.Zoom.Allow    = false;
            pie1.Chart.Panning.Allow = ScrollModes.None;

            pie1.AutoCircleResize = true;
            pie1.RecalcOptions    = RecalcOptions.OnModify;
            pie1.DefaultNullValue = 0;
            pie1.Circled          = true;
            pie1.AutoPenColor     = false;
            pie1.DarkPen          = false;
            pie1.Pen.Width        = 3;
            pie1.Pen.Style        = DashStyle.Solid;
            pie1.Pen.Visible      = true;
            pie1.Pen.Color        = Color.White;
            pie1.AngleSize        = 180;
            pie1.VertAxis         = VerticalAxis.Both;
            pie1.HorizAxis        = HorizontalAxis.Both;

            pie1.CustomXRadius = BaseChart.Chart.Axes.Bottom.MaxXValue;
            for (int i = 0; i < var.GetValorSemiPie1.Length; i++)
            {
                pie1.Add(var.GetValorSemiPie1[i], var.GetPaletteBasic[i]);
            }

            pie1.Title = "pieAnimals";

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinYValue, BaseChart.Chart.Axes.Bottom.MaxXValue);

            BaseChart.Chart.Axes.Bottom.Increment = 5;
            BaseChart.Chart.Axes.Left.Increment   = 5;

            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Left.Ticks           = new Axis.TicksPen {
                Width = 2, Visible = true, Color = Color.FromRgb(200, 200, 200), EndCap = PenLineCap.Flat, Style = DashStyle.Solid, Length = 10,
            };
            BaseChart.Chart.Axes.Bottom.Visible = true;

            BaseChart.Chart.Axes.Left.Title.Angle    = 90;
            BaseChart.Chart.Axes.Left.Grid.Visible   = false;
            BaseChart.Chart.Axes.Bottom.Grid.Visible = false;
            BaseChart.Chart.Legend.LegendStyle       = LegendStyles.Values;
            BaseChart.Chart.Legend.Alignment         = LegendAlignments.Bottom;
            BaseChart.Chart.Legend.AutoSize          = true;
            BaseChart.Chart.Legend.ResizeChart       = true;
            BaseChart.Chart.Legend.TextAlign         = TextAlignment.Center;
            BaseChart.Chart.Legend.Font.Size         = 13;

            BaseChart.Chart.SubHeader.Visible      = true;
            BaseChart.Chart.SubHeader.Text         = "A";
            BaseChart.Chart.SubHeader.Font.Size    = 80;
            BaseChart.Chart.SubHeader.Color        = Color.White;
            BaseChart.Chart.SubHeader.Transparency = 100;

            BaseChart.Chart.Legend.Symbol.Position = LegendSymbolPosition.Right;

            // Themes Marks
            Themes.AplicarMarksTheme1(BaseChart);

            pie1.Marks.Pen.Visible                    = false;
            pie1.Marks.FollowSeriesColor              = false;
            pie1.Marks.Style                          = MarksStyles.Percent;
            pie1.AutoCircleResize                     = false;
            pie1.Marks.Brush.Transparency             = 100;
            pie1.MarksPie.VertCenter                  = true;
            pie1.Marks.Transparent                    = true;
            pie1.Marks.Frame.Transparency             = 100;
            BaseChart.Chart.Series[0].Marks.Font.Size = 18;
            pie1.MarksPie.InsideSlice                 = true;
            BaseChart.Chart.Panel.MarginLeft          = 5;
            pie1.MarksPie.LegSize                     = 20;
            pie1.MarksPie.VertCenter                  = true;
            pie1.MarksPie.Rotated                     = true;
            if (App.ScreenWidth < 600)
            {
                pie1.Marks.Font.Size = 15;
            }
            else
            {
                pie1.Marks.Font.Size = 18;
            }

            BaseChart.Chart.ClickSeries += tool_dataPointSelect.PieChart_ClickSeries;
        }
Ejemplo n.º 29
0
 public void Remove(ThemeViewModel theme)
 {
     Themes.Remove(theme);
     CurrentTheme = Themes.FirstOrDefault();
 }
Ejemplo n.º 30
0
        public GatorOscillProFunctionChart(ChartView BaseChart)
        {
#if !TEE_STD
            candle    = new Candle();
            line      = new Line();
            alligator = new AlligatorFunction();
            volume    = new Volume();
            gator     = new GatorFunction();
            var       = new Variables.Variables();
            leftAxis  = new Axis();

            BaseChart.Chart.Title.Text = "Gator Oscillator";

            Themes.CandleGodStyle(candle);
            Themes.DoubleAxisChart(BaseChart);
            Themes.CustomAxisLeft(leftAxis);

            FillSampleValues(candle, 60, 200);

            candle.Title              = "Data Source";
            candle.HorizAxis          = HorizontalAxis.Bottom;
            candle.VertAxis           = VerticalAxis.Left;
            candle.Marks.Transparency = 100;

            line.Title           = "Alligator";
            line.DataSource      = candle;
            line.Function        = alligator;
            line.HorizAxis       = HorizontalAxis.Bottom;
            line.VertAxis        = VerticalAxis.Left;
            line.LinePen.Width   = 2;
            line.Marks.DrawEvery = 8;

            FillSampleValues(volume, 15);
            volume.Title           = "Gator";
            volume.UseOrigin       = true;
            volume.DataSource      = candle;
            volume.Function        = gator;
            volume.HorizAxis       = HorizontalAxis.Bottom;
            volume.VertAxis        = VerticalAxis.Custom;
            volume.CustomVertAxis  = leftAxis;
            volume.LinePen.Width   = 2;
            volume.Marks.DrawEvery = 5;

            alligator.LipsPen.Color         = var.GetPaletteBasic[2];
            alligator.LipsPen.Width         = 3;
            alligator.TeethPen.Color        = var.GetPaletteBasic[3];
            alligator.TeethPen.Width        = 3;
            alligator.Lips.Marks.DrawEvery  = 5;
            alligator.Teeth.Marks.DrawEvery = 5;

            gator.Bottom.Marks.Transparency = 100;

            leftAxis.Automatic = true;
            leftAxis.Increment = 1;
            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Custom.Add(leftAxis);
            BaseChart.Chart.Axes.Bottom.Automatic = true;
            BaseChart.Chart.Legend.Visible        = false;
            BaseChart.Chart.Axes.Left.Increment   = 10;

            BaseChart.Chart.Series.Add(candle);
            BaseChart.Chart.Series.Add(line);
            BaseChart.Chart.Series.Add(volume);
#endif
        }
Ejemplo n.º 31
0
 /// <summary>
 /// Change the current theme. Existing controls are not affected
 /// </summary>
 /// <param name="theme"></param>
 public static void SetTheme(Themes theme)
 {
     log.Debug("Theme set to " + Enum.GetName(typeof(Themes), theme));
     _currentTheme = theme;
 }
Ejemplo n.º 32
0
 public static async Task InitializeAsync()
 {
     Theme = await LoadThemeFromSettingsAsync();
 }
        public MoneyFlowProFunctionChart(ChartView BaseChart)
        {
            candle            = new Candle();
            volume            = new Volume();
            line              = new Line();
            moneyFlowFunction = new MoneyFlowFunction();
            var       = new Variables.Variables();
            rightAxis = new Axis();

            BaseChart.Chart.Header.Text = "Money Flow Index";

            BaseChart.Chart.Series.Add(candle);
            BaseChart.Chart.Series.Add(volume);
            BaseChart.Chart.Series.Add(line);

            Themes.CandleGodStyle(candle);
            Themes.CustomAxisRight(rightAxis);
            Themes.UpdateAxes(BaseChart.Chart.Axes.Left, BaseChart.Chart.Axes.Bottom);
            Themes.DoubleAxisChart(BaseChart);
            BaseChart.Chart.Axes.Custom.Add(rightAxis);

            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Bottom.Automatic        = true;
            rightAxis.Automatic = true;

            candle.FillSampleValues(15);
            candle.Title     = "Candle";
            candle.HorizAxis = HorizontalAxis.Bottom;
            candle.VertAxis  = VerticalAxis.Left;

            volume.HorizAxis          = HorizontalAxis.Bottom;
            volume.VertAxis           = VerticalAxis.Custom;
            volume.CustomVertAxis     = rightAxis;
            volume.XValues.DataMember = "X";
            volume.XValues.Order      = ValueListOrder.Ascending;
            volume.YValues.DataMember = "Y";
            volume.Title = "Volume";
            volume.FillSampleValues(20);
            volume.LinePen.Width = 3;

            line.HorizAxis      = HorizontalAxis.Bottom;
            line.VertAxis       = VerticalAxis.Custom;
            line.CustomVertAxis = rightAxis;
            line.DataSource     = candle;
            line.Function       = moneyFlowFunction;
            line.LinePen.Width  = 3;
            line.Color          = var.GetPaletteBasic[2];
            line.Title          = "Line";

            moneyFlowFunction.Series       = candle;
            moneyFlowFunction.Volume       = volume;
            moneyFlowFunction.CMFStyle     = CMFStyle.Histogram;
            moneyFlowFunction.Volume.Color = var.GetPaletteBasic[3];

            BaseChart.Chart.Axes.Custom.Add(rightAxis);

            rightAxis.Automatic = true;
            BaseChart.Chart.Axes.Left.Automatic   = true;
            BaseChart.Chart.Axes.Bottom.Automatic = true;
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Draw the preview graph widget
        /// </summary>
        public void DrawWidget(Vector2 mainWidgetSize)
        {
            bool         showToolTip      = false;
            PlottedGraph?latestHoverGraph = null;
            TraceRecord? activeTrace      = ActiveTrace;

            if (activeTrace == null)
            {
                return;
            }


            float captionHeight = ImGui.CalcTextSize("123456789").Y;

            DrawnPreviewGraphs = activeTrace.GetPlottedGraphs();
            List <int> indexes = GetGraphOrder(trace: activeTrace, graphs: DrawnPreviewGraphs);
            uint       captionBackgroundcolor = Themes.GetThemeColourUINT(Themes.eThemeColour.PreviewTextBackground);

            ImGui.PushStyleVar(ImGuiStyleVar.CellPadding, new Vector2(0, CONSTANTS.UI.PREVIEW_PANE_Y_SEP));

            //Graph drawing loop
            if (ImGui.BeginTable("PrevGraphsTable", 1, ImGuiTableFlags.Borders, new Vector2(CONSTANTS.UI.PREVIEW_PANE_WIDTH, ImGui.GetContentRegionAvail().Y)))
            {
                foreach (int graphIdx in indexes)
                {
                    PlottedGraph plot     = DrawnPreviewGraphs[graphIdx];
                    float        xPadding = CONSTANTS.UI.PREVIEW_PANE_X_PADDING;
                    if (plot == null || plot.GraphNodeCount() == 0)
                    {
                        continue;
                    }

                    ImGui.TableNextRow();
                    ImGui.TableSetColumnIndex(0);

                    if (DrawPreviewGraph(plot, xPadding, captionHeight, captionBackgroundcolor, out bool canHover, mainWidgetSize))
                    {
                        var MainGraphs = plot.InternalProtoGraph.TraceData.GetPlottedGraphs();
                        HandleClickedGraph(MainGraphs[graphIdx]);
                    }

                    if (canHover && ImGui.IsItemHovered(ImGuiHoveredFlags.None) && !(ImGui.IsMouseDown(ImGuiMouseButton.Left)))
                    {
                        latestHoverGraph = plot;
                        showToolTip      = true;
                    }
                }
                ImGui.EndTable();
            }
            ImGui.PopStyleVar();


            ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(5, 5));
            ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(5, 5));
            ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(5, 5));
            ImGui.PushStyleColor(ImGuiCol.Border, 0x77999999);

            HoveredGraph = latestHoverGraph;
            bool showedCtx = HandlePreviewGraphContextMenu();

            bool veryRecentPopup = showedCtx || _lastCtxMenu.AddMilliseconds(250) > DateTime.Now;

            if (showToolTip && !veryRecentPopup && HoveredGraph is not null)
            {
                DrawGraphTooltip(HoveredGraph);
            }
            ImGui.PopStyleVar(3);
            ImGui.PopStyleColor();
        }
Ejemplo n.º 35
0
 public static bool Register(Page page, Themes theme)
 {
     return Register(page, theme == Themes.Default ? jQuery.Configuration.Theme : theme.ToString());
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Draw a preview graph texture on the preview pane
        /// </summary>
        /// <param name="plot">The graph being drawn</param>
        /// <param name="xPadding">horizontal padding</param>
        /// <param name="captionHeight">height of the caption</param>
        /// <param name="captionBackgroundcolor">contrast background colour of the caption</param>
        /// <param name="canHover">output flag states if we can safely draw a mouseover tooltip</param>
        /// <param name="mainWidgetSize">Size of the maingraph widget, used for projecting the zoom envelope</param>
        /// <returns>The graph was clicked</returns>
        private bool DrawPreviewGraph(PlottedGraph plot, float xPadding, float captionHeight, uint captionBackgroundcolor, out bool canHover, Vector2 mainWidgetSize)
        {
            ImDrawListPtr imdp    = ImGui.GetWindowDrawList(); //draw on and clipped to this window
            bool          clicked = false;

            canHover = false;
            if (plot == null)
            {
                return(clicked);
            }

            int graphNodeCount = plot.GraphNodeCount();

            if (graphNodeCount == 0)
            {
                return(clicked);
            }

            plot.GetLatestTexture(out Texture previewTexture);
            if (previewTexture == null)
            {
                return(clicked);
            }

            bool isSelected = plot.TID == selectedGraphTID;

            canHover = true;

            //copy in the actual rendered graph
            ImGui.SetCursorPosY(ImGui.GetCursorPosY());
            Vector2 subGraphPosition = ImGui.GetCursorScreenPos() + new Vector2(xPadding, 0);

            IntPtr CPUframeBufferTextureId = _ImGuiController !.GetOrCreateImGuiBinding(_gd !.ResourceFactory, previewTexture, $"PreviewPlot{plot.TID}");

            imdp.AddImage(user_texture_id: CPUframeBufferTextureId,
                          p_min: subGraphPosition,
                          p_max: new Vector2(subGraphPosition.X + EachGraphWidth, subGraphPosition.Y + EachGraphHeight),
                          uv_min: new Vector2(0, 1),
                          uv_max: new Vector2(1, 0));

            float borderThickness     = Themes.GetThemeSize(Themes.eThemeSize.PreviewSelectedBorder);
            float halfBorderThickness = (float)Math.Floor(borderThickness / 2f);

            if (isSelected)
            {
                DrawPreviewZoomEnvelope(plot, subGraphPosition);

                //Draw the thicker selected graph border
                if (borderThickness > 0)
                {
                    imdp.AddRect(
                        p_min: new Vector2(subGraphPosition.X + halfBorderThickness, subGraphPosition.Y + halfBorderThickness),
                        p_max: new Vector2((subGraphPosition.X + EachGraphWidth - halfBorderThickness), subGraphPosition.Y + EachGraphHeight - halfBorderThickness),
                        col: GetGraphBorderColour(plot), 0, ImDrawFlags.None, borderThickness);
                }
            }

            //write the caption
            string Caption = $"TID:{plot.TID} {graphNodeCount} nodes {(isSelected ? "[Selected]" : "")}";

            ImGui.SetCursorPosX(ImGui.GetCursorPosX());
            Vector2 captionBGStart = subGraphPosition + new Vector2(borderThickness, borderThickness);
            Vector2 captionBGEnd   = new Vector2((captionBGStart.X + EachGraphWidth - borderThickness * 2), captionBGStart.Y + captionHeight);

            imdp.AddRectFilled(p_min: captionBGStart, p_max: captionBGEnd, col: captionBackgroundcolor);
            ImGui.PushStyleColor(ImGuiCol.Text, Themes.GetThemeColourUINT(Themes.eThemeColour.PreviewText));
            ImGui.SetCursorPosX(ImGui.GetCursorPosX() + CONSTANTS.UI.PREVIEW_PANE_X_PADDING + borderThickness + 1);
            ImGui.SetCursorPosY(ImGui.GetCursorPosY() + borderThickness);
            ImGui.Text(Caption);
            ImGui.PopStyleColor();
            ImGui.SetCursorPosX(ImGui.GetCursorPosX() + EachGraphWidth - 48);

            //live thread activity plot
            if (ActiveTrace is not null && !ActiveTrace.WasLoadedFromSave)
            {
                ImGui.SetCursorPosY(ImGui.GetCursorPosY() - captionHeight);

                float maxVal;
                float[]? invalues = null;
                if (plot.InternalProtoGraph.TraceReader != null)
                {
                    plot.InternalProtoGraph.TraceReader.RecentMessageRates(out invalues);
                }
                if (invalues == null || invalues.Length == 0)
                {
                    invalues = new List <float>()
                    {
                        0, 0, 0, 0, 0
                    }.ToArray();
                    maxVal = 100;
                }
                else
                {
                    maxVal = invalues.Max();
                }
                ImGui.PushStyleColor(ImGuiCol.FrameBg, captionBackgroundcolor);
                ImGui.PlotLines("", ref invalues[0], invalues.Length, 0, "", 0, maxVal, new Vector2(40, captionHeight));
                if (ImGui.IsItemHovered())
                {
                    canHover = false; //The PlotLines widget doesn't allow disabling the mouseover, so have to prevent our mousover to avoid a merged tooltip
                }
                ImGui.PopStyleColor();
            }


            //invisible button to detect graph click

            ImGui.SetCursorPos(new Vector2(1, ImGui.GetCursorPosY() - (float)(captionHeight)));
            if (ImGui.InvisibleButton("PrevGraphBtn" + plot.TID, new Vector2(EachGraphWidth, EachGraphHeight - 2)) || ImGui.IsItemActive())
            {
                clicked = true;
                if (isSelected)
                {
                    Vector2 clickPos    = ImGui.GetMousePos();
                    Vector2 clickOffset = clickPos - subGraphPosition;
                    clickOffset.Y = EachGraphHeight - clickOffset.Y;
                    plot.MoveCameraToPreviewClick(clickOffset, new Vector2(EachGraphWidth, EachGraphHeight),
                                                  mainGraphWidgetSize: mainWidgetSize, PreviewProjection);
                }
            }
            return(clicked);
        }
Ejemplo n.º 37
0
        public void Reset()
        {
            Properties.Settings.Default.Reset();
            this.inst = GetInstance("Inst", Instances.Prod);
            this.ssologin = GetBool("SSOLogin", false);
            this.debug = GetBool("Debug", false);
            this.showalllogins = GetBool("ShowAllLogins", false);
            this.soapversion = GetString("SoapVersion", "29.0");
            this.devurl = GetString("DevUrl", "https://dev-CS--IRIS----RKSB1-CS17-my-salesforce-com.iris-dev.rowini.net:29443");
            this.devorgid = GetString("DevOrgId", "00Dg0000003Nc8C");
            this.iturl = GetString("ITUrl", "");
            this.itorgid = GetString("ITOrgId", "");
            this.uaturl = GetString("UATUrl", "");
            this.uatorgid = GetString("UATOrgId", "");
            this.produrl = GetString("ProdUrl", "");
            this.prodorgid = GetString("ProdOrgId", "");

            this.reportsdevurl = GetString("ReportsDevUrl", "");
            this.reportsiturl = GetString("ReportsITUrl", "");
            this.reportsuaturl = GetString("ReportsUATUrl", "");
            this.reportsprodurl = GetString("ReportsProdUrl", "");

            this.theme = GetTheme("Theme", Themes.Windows8);
            this.themecolor = GetString("ThemeColor", "#DE5827");

        }
Ejemplo n.º 38
0
        // Constructor del "LineChart"
        public InterpolatingChartFeatures(ChartView BaseChart)
        {
            // Variables
            line1                  = new Line();
            var                    = new Variables.Variables();
            this.BaseChart         = BaseChart;
            tool_interpolatingLine = new Tools.InterpolatingLine(BaseChart);

            // -------------------------------------------------------
            // PROPIEDADES DEL "BASECHART"
            // -------------------------------------------------------

            //
            // ADD SERIES
            //

            BaseChart.Chart.Series.Add(line1);
            //BaseChart.Chart.Series.Add(line2);
            //BaseChart.Chart.Series.Add(line3);

            //
            // LEFT AXES
            //

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue + 100);
            BaseChart.Chart.Axes.Left.Visible            = true;
            BaseChart.Chart.Axes.Left.Title.Visible      = false;
            BaseChart.Chart.Axes.Left.Labels.ValueFormat = "0";
            BaseChart.Chart.Axes.Left.Increment          = 10;
            BaseChart.Chart.Axes.Left.AxisPen.Visible    = false;
            BaseChart.Chart.Axes.Left.Ticks.Visible      = false;
            BaseChart.Chart.Axes.Left.Grid.Visible       = true;

            //
            // BOTTOM AXES
            //

            BaseChart.Chart.Axes.Bottom.Labels.ValueFormat = "0";
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue + 50);
            BaseChart.Chart.Axes.Bottom.Title.Visible = false;
            BaseChart.Chart.Axes.Left.Increment       = 10;
            BaseChart.Chart.Axes.Bottom.Grid.Visible  = false;
            BaseChart.Chart.Axes.Bottom.Visible       = true;
            BaseChart.Chart.Axes.Bottom.Ticks.Visible = true;
            BaseChart.Chart.Axes.Bottom.Ticks         = new Axis.TicksPen {
                Width = 2, Visible = true, Color = Color.FromArgb(200, 200, 200), EndCap = PenLineCap.Flat, Style = DashStyle.Solid, Length = 10,
            };

            //
            // HEADER
            //

            BaseChart.Chart.Header.Text = "Interpolating Line";

            //
            // LEGEND
            //

            BaseChart.Chart.Legend.Visible     = false;
            BaseChart.Chart.Legend.LegendStyle = LegendStyles.Series;

            //
            // PANEL
            //

            BaseChart.Chart.Panel.MarginLeft = 4;

            //
            // EVENTOS
            //

            BaseChart.Chart.ClickSeries += null;

            // -------------------------------------------------------
            // SERIES
            // -------------------------------------------------------

            //
            // LINE 1
            //

            line1.SeriesColor      = var.GetPaletteBasic[0];
            line1.RecalcOptions    = RecalcOptions.OnModify;
            line1.Title            = "Line1";
            line1.ClickableLine    = true;
            line1.DefaultNullValue = 0;
            line1.Color            = var.GetPaletteBasic[0];
            line1.SeriesColor      = var.GetPaletteBasic[0];
            line1.Visible          = true;
            for (int i = 0; i < var.GetValorInterpolLine1.Length; i++)
            {
                line1.Add(var.GetValorInterpolLine1[i]);
            }
            line1.Chart.Zoom.Allow    = false;
            line1.Chart.Panning.Allow = ScrollModes.None;
            line1.Pointer.Visible     = true;
            line1.VertAxis            = VerticalAxis.Both;
            line1.HorizAxis           = HorizontalAxis.Both;

            //
            // MARKS
            //

            Themes.AplicarMarksTheme1(BaseChart);

            AddCursorTool();
        }
Ejemplo n.º 39
0
        private void SetTheme(string name, Themes? val)
        {
            if (!PropertyExists(name))
            {

            }
            else
            {
                string strval = "";
                switch (val)
                {
                    case Themes.Windows8:
                        strval = "Windows8";
                        break;
                    case Themes.Dark:
                        strval = "Dark";
                        break;
                    case Themes.Office:
                        strval = "Office";
                        break;
                    default:
                        strval = "Windows8";
                        break;
                }
                Properties.Settings.Default[name] = strval;
            }
        }
Ejemplo n.º 40
0
 /// <summary>
 /// Method for getting theme by the name.
 /// </summary>
 /// <param name="themeName"> Theme name which is same as folder name.</param>
 /// <returns>Return the theme object.</returns>
 public static Theme GetThemeByName(string themeName)
 {
     return(Themes.Where(x => x.ThemeName == themeName).FirstOrDefault());
 }
Ejemplo n.º 41
0
 public DefaultThemeLoader(string themeName, Themes themes)
 {
     _themeName = themeName;
     _themes = themes;
 }
 /// <summary>
 /// Changes the theme for the picker to the theme provided in the parameter
 /// </summary>
 /// <param name="newTheme">The new theme to be applied</param>
 public void ChangeTheme(Themes newTheme)
 {
     Theme = newTheme;
 }
 private static void SetThemeSpecific(Themes theme)
 {
     switch (theme)
     {
         case Themes.Office2013:
             Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.White);
             ApplicationThemeViewModel.SelectedTheme = "Office2013";
             break;
         case Themes.VisualStudio2013:
             VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Light);
             ApplicationThemeViewModel.SelectedTheme = "VisualStudio2013";
             break;
         case Themes.VisualStudio2013_Blue:
             VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
             ApplicationThemeViewModel.SelectedTheme = "VisualStudio2013_Blue";
             break;
         case Themes.VisualStudio2013_Dark:
             VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
             ApplicationThemeViewModel.SelectedTheme = "VisualStudio2013_Dark";
             break;
         default:
             break;
     }
 }
Ejemplo n.º 44
0
 /// <summary>Initializes a new instance of the <see cref="Theme" /> class.</summary>
 /// <param name="theme">The theme.</param>
 public Theme(Themes theme) : this()
 {
     LoadThemeFromResources(theme);
 }
Ejemplo n.º 45
0
        public static void Main(string[] args)
        {
            if (!log4net.LogManager.GetRepository().Configured)
            {
                log4net.Config.BasicConfigurator.Configure();
            }

            log4net.ILog logger = log4net.LogManager.GetLogger("Flatland.Program");

            logger.Info("Starting up Flatland");

            var settings = new FlatlandSettings()
            {
                IsDebugMode       = false,
                ScreenWidth       = DisplayDevice.Default.Width,
                ScreenHeight      = DisplayDevice.Default.Height,
                Fullscreen        = false,
                Tiles             = 0, Players = 0, Port = 0, PlayerSort = PlayerSort.Random,
                CollisionBehavior = CollisionBehavior.Allow,
                GameType          = FlatlandGameType.Normal
            };

            logger.Debug("Parsing command-line options");

            // Parse command-line options
            bool showHelp = false;

            var options = new OptionSet()
            {
                { "h|?|help", "Show this help message",
                  v => showHelp = !string.IsNullOrEmpty(v) },

                { "debug", "Enable debug mode (random commands can be issued with 'R')",
                  v => settings.IsDebugMode = !string.IsNullOrEmpty(v) },

                { "screen-width=", "Screen width in pixels (default: current)",
                  v => settings.ScreenWidth = Convert.ToInt32(v) },

                { "screen-height=", "Screen heigh in pixels (default: current)",
                  v => settings.ScreenHeight = Convert.ToInt32(v) },

                { "full-screen", "Enables full-screen mode",
                  v => settings.Fullscreen = !string.IsNullOrEmpty(v) },

                { "tiles=", "Number of tiles in a row or column (default: maximum)",
                  v => settings.Tiles = Convert.ToInt32(v) },

                { "players=", "Number of players (required)",
                  v => settings.Players = Convert.ToInt32(v) },

                { "port=", "Network port of input server",
                  v => settings.Port = Convert.ToInt32(v) },

                { "data-file=", "Path to the output data file",
                  v => settings.DataFilePath = v },

                { "player-sort=", "Initial arrangement of players (Random, SpreadOut, Clustered)",
                  v => settings.PlayerSort = (PlayerSort)Enum.Parse(typeof(PlayerSort), v) },

                { "collision-behavior=", "Behavior for when players collide (Block, Allow)",
                  v => settings.CollisionBehavior = (CollisionBehavior)Enum.Parse(typeof(CollisionBehavior), v) },

                { "team-info=", "Information about a team in the format [Index,Theme,MoveSeconds,Kind,Wrap] (Kind = Normal, Predator, Prey)",
                  v => settings.Teams.AddRange(CLIObject.FromString <FlatlandTeamInfo>(v, "TeamIndex", "ThemeName", "MoveSeconds", "Kind", "WrappedMovement", "ScoringSystem")) },

                { "fixed-tiles=", "List of fixed tiles in the format [X1,Y1][X2,Y2]...",
                  v => settings.FixedTiles.UnionWith(CLIObject.FromString <FixedTile>(v, "X", "Y")) },

                { "description=", "Text to display at the top of the screen during gameplay",
                  v => settings.GameDescription = v },

                { "game-type=", "Type of Flatland game to play (Normal, NQueens)",
                  v => settings.GameType = (FlatlandGameType)Enum.Parse(typeof(FlatlandGameType), v) }
            };

            options.Parse(args);

            if (showHelp)
            {
                options.WriteOptionDescriptions(Console.Out);
                return;
            }

            if (settings.Players < 1)
            {
                logger.Fatal("players option is required");
                return;
            }

            if (settings.Teams.Count < 1)
            {
                logger.Fatal("at least team one is required");
                return;
            }
            else
            {
                // Set team names based on index
                foreach (var team in settings.Teams)
                {
                    team.TeamName = ((char)(((int)'A') + team.TeamIndex)).ToString();
                    team.Theme    = Themes.GetTheme((ThemeColor)Enum.Parse(typeof(ThemeColor), team.ThemeName));
                }
            }

            // Calculate number of pixels
            var requestedPixels = settings.Tiles * settings.Tiles;

            if (requestedPixels < settings.Players)
            {
                settings.Tiles = (int)Math.Ceiling(Math.Sqrt(settings.Players));
                logger.WarnFormat("Setting number of tiles to {0}x{0} to accomodate players", settings.Tiles);
            }

            // Make sure there are enough tiles for all players
            if ((settings.CollisionBehavior == CollisionBehavior.Block) &&
                (((settings.Tiles * settings.Tiles) - settings.FixedTiles.Count) < settings.Players))
            {
                logger.Fatal("Not enough tiles for players!");
                return;
            }

            if (settings.IsDebugMode)
            {
                logger.Info("Debug mode is enabled");
            }

            using (var game = new FlatlandWindow(settings))
            {
                // Start game
                logger.Debug("Running game loop");
                game.Run(0, 0);
            }
        }
Ejemplo n.º 46
0
 /// <summary>Initializes a new instance of the <see cref="StyleManager" /> class.</summary>
 /// <param name="themes">The internal themes.</param>
 public StyleManager(Themes themes) : this()
 {
     _theme = new Theme(themes);
 }
Ejemplo n.º 47
0
        private void OnNeighborAdd(Cube cube1, Cube.Side side1, Cube cube2, Cube.Side side2)
        {
            Log.Debug("Neighbor add: {0}.{1} <-> {2}.{3}", cube1.UniqueId, side1, cube2.UniqueId, side2);

              CubeWrapper wrapper1 = (CubeWrapper)cube1.userData;
              CubeWrapper wrapper2 = (CubeWrapper)cube2.userData;

              if (wrapper1 != null && wrapper2 != null) {
            if ((wrapper1.mType == CubeType.SELECTOR && wrapper2.mType == CubeType.SELECTABLE) || (wrapper2.mType == CubeType.SELECTOR && wrapper1.mType == CubeType.SELECTABLE)) {
              Cube.Side selectorSide;
              Cube.Side selectableSide;
              CubeWrapper selectorWrapper;
              CubeWrapper selectableWrapper;

              if (wrapper1.mType == CubeType.SELECTOR) {
            selectorSide = side1;
            selectableSide = side2;
            selectorWrapper = wrapper1;
            selectableWrapper = wrapper2;
              }

              else {
            selectorSide = side2;
            selectableSide = side1;
            selectorWrapper = wrapper2;
            selectableWrapper = wrapper1;
              }

              if (selectorSide == Cube.Side.BOTTOM) {
            switch (currentPhase) {
                        case (PhaseType.MODESELECT):
                            if (selectableSide == Cube.Side.TOP) {
                                currentMode = GameModes.FREELIB;
                                currentPhase = PhaseType.NAMESELECT;
                                readyToChangeState = true;
                            }
                            else if (selectableSide == Cube.Side.BOTTOM) {
                                currentMode = GameModes.FREETHEME;
                                currentPhase = PhaseType.NAMESELECT;
                                readyToChangeState = true;
                            }

                            break;

                        case (PhaseType.NAMESELECT):

                            currentPlayer = nameSelector(selectableSide, selectableWrapper);
                            currentPhase = PhaseType.THEMESELECT;
                            readyToChangeState = true;
                            break;

                        case (PhaseType.BEATSELECT):

                            string sample = beatSelector(selectableSide, selectableWrapper);
                            sampleMusic = Sounds.CreateSound(sample);

                            if (mMusic.IsPlaying) mMusic.Pause();

                            sampleMusic.Play(1, -1);
                            currentPhase = PhaseType.BEATSELECT2;
                            readyToChangeState = true;
                            break;

                        case (PhaseType.THEMESELECT):

                            currentTheme = themeSelector(selectableSide, selectableWrapper);
                            currentPhase = PhaseType.BEATSELECT;
                            readyToChangeState = true;
                            break;

                        default:
                            break;

            }
             	  }
            }
              }
        }
Ejemplo n.º 48
0
 /// <summary>Initializes a new instance of the <see cref="StyleManager" /> class.</summary>
 /// <param name="form">The form.</param>
 /// <param name="theme">The style.</param>
 public StyleManager(Form form, Themes theme) : this()
 {
     _theme = new Theme(theme);
     AddFormToManage(form);
 }
Ejemplo n.º 49
0
 /// <summary>
 /// Change the current theme. Existing controls are not affected
 /// </summary>
 /// <param name="theme"></param>
 public static void SetTheme(Themes theme)
 {
     log.Debug("Theme set to " + Enum.GetName(typeof (Themes), theme));
     _currentTheme = theme;
 }
Ejemplo n.º 50
0
 internal void RenderTheme(Themes.Theme theme) {
     if (theme == null) return;
     var image = theme.Image;
     var accent = theme.Accent;
     if (theme is Themes.DefaultTheme) {
         image = ((Themes.DefaultTheme) theme).Image;
         accent = ((Themes.DefaultTheme) theme).Accent;
     }
         MeCore.MainWindow.gridBG.Opacity = 0;
         MeCore.MainWindow.gridBG.Background = new ImageBrush
         {
             ImageSource = image,
             Stretch = Stretch.UniformToFill
         };
         var ani = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(0.25));
         ani.Completed += async delegate
         {
             await System.Threading.Tasks.TaskEx.Delay(250);
             MeCore.MainWindow.gridParent.Background = new ImageBrush
             {
                 ImageSource = image,
                 Stretch = Stretch.UniformToFill
             };
             MeCore.MainWindow.gridBG.Opacity = 0;
         };
         MeCore.MainWindow.gridBG.BeginAnimation(OpacityProperty, ani);
     
     Tuple<AppTheme, Accent> AppTheme = ThemeManager.DetectAppStyle(Application.Current);
     ThemeManager.ChangeAppStyle(Application.Current, accent, AppTheme.Item1);
 }