コード例 #1
0
ファイル: Settings.cs プロジェクト: Ales999/plena
        private void SaveChart()
        {
            ChartInfo chartInfo = (ChartInfo)pgrdChart.SelectedObject;

            Properties.Settings.Default.GridVertical     = chartInfo.GridVertical;
            Properties.Settings.Default.GridHorizontal   = chartInfo.GridHorizontal;
            Properties.Settings.Default.PanelSeparator   = chartInfo.PanelSeparator;
            Properties.Settings.Default.SemiLogScale     = chartInfo.SemiLogScale;
            Properties.Settings.Default.PaddingTop       = int.Parse(chartInfo.PaddingTop.ToString());
            Properties.Settings.Default.PaddingBottom    = int.Parse(chartInfo.PaddingBottom.ToString());
            Properties.Settings.Default.PaddingRight     = int.Parse(chartInfo.PaddingRight.ToString());
            Properties.Settings.Default.ChartViewport    = int.Parse(chartInfo.ChartViewport.ToString());
            Properties.Settings.Default.History          = int.Parse(chartInfo.History.ToString());
            Properties.Settings.Default.Decimals         = int.Parse(chartInfo.Decimals.ToString());
            Properties.Settings.Default.VisiblePortfolio = chartInfo.VisiblePortfolio;

            if (chartInfo.Position.Equals(Program.LanguageDefault.DictionarySettings["LessChart"]))
            {
                if (!Properties.Settings.Default.TabDataPosition.Equals("Less"))
                {
                    Properties.Settings.Default.TabDataPosition = "Less";
                    frmMain.GInstance.ReconfigureTabsChart();
                }
            }
            else if (chartInfo.Position.Equals(Program.LanguageDefault.DictionarySettings["BottomChart"]))
            {
                if (!Properties.Settings.Default.TabDataPosition.Equals("Bottom"))
                {
                    Properties.Settings.Default.TabDataPosition = "Bottom";
                    frmMain.GInstance.ReconfigureTabsChart();
                }
            }

            var schemes = Scheme.Instance().Schemes.Where(s => s.Value == chartInfo.ColorSchemes).FirstOrDefault();

            Properties.Settings.Default.SchemeColor = schemes.Key;

            Properties.Settings.Default.Save();

            //frmMain2.GInstance.LoadAllChartSettings();

            //frmMain2.GInstance.LoadColorScheme();

            //frmMain2.GInstance.UpdateChartColors();
        }
コード例 #2
0
ファイル: Settings.cs プロジェクト: Ales999/plena
        private void LoadConfigChart()
        {
            ConfigurePropertyGridChart();

            btnApplyChart.Text = Program.LanguageDefault.DictionarySettings["btnApply"];

            ChartInfo chartInfo = new ChartInfo
            {
                GridHorizontal   = Properties.Settings.Default.GridHorizontal,
                GridVertical     = Properties.Settings.Default.GridVertical,
                SemiLogScale     = Properties.Settings.Default.SemiLogScale,
                PanelSeparator   = Properties.Settings.Default.PanelSeparator,
                Decimals         = int.Parse(Properties.Settings.Default.Decimals.ToString()),
                History          = int.Parse(Properties.Settings.Default.History.ToString()),
                ChartViewport    = int.Parse(Properties.Settings.Default.ChartViewport.ToString()),
                PaddingTop       = int.Parse(Properties.Settings.Default.PaddingTop.ToString()),
                PaddingBottom    = int.Parse(Properties.Settings.Default.PaddingBottom.ToString()),
                PaddingRight     = int.Parse(Properties.Settings.Default.PaddingRight.ToString()),
                VisiblePortfolio = Properties.Settings.Default.VisiblePortfolio,
            };

            switch (Properties.Settings.Default.SchemeColor)
            {
            case "SchemeBeige":
                chartInfo.ColorSchemes = Program.LanguageDefault.DictionarySettings["SchemeBeige"];
                break;

            case "SchemeBlue":
                chartInfo.ColorSchemes = Program.LanguageDefault.DictionarySettings["SchemeBlue"];
                break;

            case "SchemeDark":
                chartInfo.ColorSchemes = Program.LanguageDefault.DictionarySettings["SchemeDark"];
                break;

            case "SchemeGreen":
                chartInfo.ColorSchemes = Program.LanguageDefault.DictionarySettings["SchemeGreen"];
                break;

            case "SchemeMono":
                chartInfo.ColorSchemes = Program.LanguageDefault.DictionarySettings["SchemeMono"];
                break;

            case "SchemeWhite":
                chartInfo.ColorSchemes = Program.LanguageDefault.DictionarySettings["SchemeWhite"];
                break;
            }

            switch (Properties.Settings.Default.TabDataPosition)
            {
            case "Less":
                chartInfo.Position = Program.LanguageDefault.DictionarySettings["LessChart"];
                break;

            case "Bottom":
                chartInfo.Position = Program.LanguageDefault.DictionarySettings["BottomChart"];
                break;
            }

            pgrdChart.SelectedObject = chartInfo;
        }