当前位置: 首页>>代码示例>>C#>>正文


C# Settings.Exists方法代码示例

本文整理汇总了C#中Settings.Exists方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.Exists方法的具体用法?C# Settings.Exists怎么用?C# Settings.Exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings的用法示例。


在下文中一共展示了Settings.Exists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckSettings

 private static bool CheckSettings(Settings s)
 {
     return (
          s.Exists("size") && s.GetTypeByName("size") == typeof(int) &&
          s.Exists("roughness") && s.GetTypeByName("roughness") == typeof(double) &&
          s.Exists("seed") && s.GetTypeByName("seed") == typeof(int) &&
          s.Exists("waterlevel") && s.GetTypeByName("waterlevel") == typeof(int)
          );
 }
开发者ID:rombolshak,项目名称:TerrainGen,代码行数:9,代码来源:FactorialModel.cs

示例2: CheckSettings

 private bool CheckSettings(Settings s)
 {
     return (
         s.Exists("width") && s.GetTypeByName("width") == typeof(int) &&
         s.Exists("height") && s.GetTypeByName("height") == typeof(int) &&
         s.Exists("seed") && s.GetTypeByName("seed") == typeof(int) &&
         s.Exists("waterlevel") && s.GetTypeByName("waterlevel") == typeof(int)
         );
 }
开发者ID:rombolshak,项目名称:TerrainGen,代码行数:9,代码来源:HillModel.cs

示例3: SetTheme

        public void SetTheme(Settings settings)
        {
            var w = Stopwatch.StartNew();
            if (settings.Exists("editor.ForeColor"))
            {
                editor1.ForeColor = editor2.ForeColor = settings.GetColor("editor.ForeColor");
                SplitFCTB.ColorStyle1 = new ColorStyle(settings.GetSolidBrush("editor.ForeColor"));
            }
            if (settings.Exists("editor.BackColor"))
            {
                editor1.EditorBackColor = editor2.EditorBackColor = settings.GetColor("editor.BackColor");
            }
            if (settings.Exists("editor.IndentBackColor"))
            {
                editor1.editor1.IndentBackColor = editor1.editor2.IndentBackColor =
                    editor2.editor1.IndentBackColor = editor2.editor2.IndentBackColor = settings.GetColor("editor.IndentBackColor");
            }
            if (settings.Exists("editor.LineNumberColor"))
            {
                editor1.LineNumberColor = editor2.LineNumberColor = settings.GetColor("editor.LineNumberColor");
            }
            if (settings.Exists("editor.SelectionColor"))
            {
                editor1.SelectionColor = editor2.SelectionColor = settings.GetColor("editor.SelectionColor");
            }
            if (settings.Exists("editor.CaretColor"))
            {
                editor1.CaretColor = editor2.CaretColor = settings.GetColor("editor.CaretColor");
            }
            if (settings.Exists("editor.Font"))
            {
                try
                {
                    editor1.editor1.Font = editor1.editor2.Font = editor2.editor1.Font = editor2.editor2.Font = new Font(settings.GetString("editor.Font"), editor1.editor1.Font.Size);
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message, "Error in \"4Hud Theme.txt\"");
                }
            }

            if (settings.Exists("treeview.ForeColor"))
            {
                treeView.ForeColor = treeViewSearch.ForeColor = settings.GetColor("treeview.ForeColor");
            }
            if (settings.Exists("treeview.BackColor"))
            {
                treeView.BackColor = treeViewSearch.BackColor = settings.GetColor("treeview.BackColor");
            }

            if (settings.Exists("split.Bg"))
            {
                splitContainer.BackColor = editor1.btnClose.FlatAppearance.BorderColor = editor1.btnClose.FlatAppearance.CheckedBackColor = editor1.btnClose.BackColor = editor1.btnClose.FlatAppearance.MouseDownBackColor = editor1.btnClose.FlatAppearance.MouseOverBackColor = editor1.CloseButtonBorder =
                    split.BackColor = editor2.btnClose.FlatAppearance.BorderColor = editor2.btnClose.FlatAppearance.CheckedBackColor = editor2.btnClose.BackColor = editor2.btnClose.FlatAppearance.MouseDownBackColor = editor2.btnClose.FlatAppearance.MouseOverBackColor = editor2.CloseButtonBorder =
                    editor1.BackColor = editor2.BackColor = splitContainer.Panel1.BackColor =
                    settings.GetColor("split.Bg");

            }

            if (settings.Exists("color.ColorName"))
                SplitFCTB.ColorNameStyle = new TextStyle(settings.GetSolidBrush("color.ColorName"), null, FontStyle.Regular);

            if (settings.Exists("color.Comment"))
                SplitFCTB.CommentStyle = new TextStyle(settings.GetSolidBrush("color.Comment"), null, FontStyle.Regular);

            if (settings.Exists("color.Enabled"))
                SplitFCTB.EnabledStyle = new MarkerStyle(settings.GetSolidBrush("color.Enabled"));

            if (settings.Exists("color.Disabled"))
                SplitFCTB.DisabledStyle = new MarkerStyle(settings.GetSolidBrush("color.Disabled"));

            if (settings.Exists("color.Minmode"))
                SplitFCTB.MinModeStyle = new TextStyle(settings.GetSolidBrush("color.Minmode"), null, FontStyle.Regular);

            if (settings.Exists("color.Keywords"))
                SplitFCTB.NameStyle = new TextStyle(settings.GetSolidBrush("color.Keywords"), null, FontStyle.Regular);

            if (settings.Exists("color.Pos1"))
                SplitFCTB.PosStyle1 = new TextStyle(settings.GetSolidBrush("color.Pos1"), null, FontStyle.Regular);

            if (settings.Exists("color.Pos2"))
                SplitFCTB.PosStyle2 = new TextStyle(settings.GetSolidBrush("color.Pos2"), null, FontStyle.Regular);

               //if (settings.Exists("color.Pos2"))
               //    SplitFCTB.UnderlinedStyle = new TextStyle(settings.GetSolidBrush("color.Pos2"), null, FontStyle.Regular);

            w.Stop();
            Console.WriteLine(w.Elapsed.TotalMilliseconds);
        }
开发者ID:Knightshade,项目名称:4Hud,代码行数:89,代码来源:Form1.cs


注:本文中的Settings.Exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。