コード例 #1
0
        public void Reset()
        {
            Language = new CultureInfo("en");

            CodeEditor = (CodeEditorType)Enum.GetValues(typeof(CodeEditorType)).GetValue(0);

            FunctionsOrder = FunctionsOrder.Default;
            TooltipType    = TooltipType.Default;

            ExpressionFont = CustomFonts.GetMathFont(15.75F);
            ScriptingFont  = CustomFonts.GetScriptingFont(12);

            ShowReturnTypeInExpression     = false;
            ShowParametersTypeInExpression = true;

            ShowReturnTypeInScripting     = true;
            ShowParametersTypeInScripting = true;

            NumericalOutputNotation = NumericalOutputNotationType.MathematicalNotation;

            ScriptingDirectory       = DefaultScriptingDirectory;
            CustomFunctionsDirectory = DefaultCustomFunctionsDirectory;

            CalculationsErrors = CalculationsErrors.ReturnNAN;

            WorkingDirectory = DefaultWorkingDirectory;
        }
コード例 #2
0
        public void SetFont(Font font)
        {
            // Configuring the default style with properties
            // we have common to every lexer style saves time.
            StyleResetDefault();
            if (font.FontFamily.Name == "Cambria")
            {
                Font = CustomFonts.GetMathFont(font.Size);
                Styles[Style.Default].Font = CustomFonts.GetMathFont(font.Size).Name;

                _autocompleteMenu.Font = CustomFonts.GetMathFont(font.Size);
            }
            else if (font.FontFamily.Name == "Consolas")
            {
                Font = CustomFonts.GetScriptingFont(font.Size);
                Styles[Style.Default].Font = CustomFonts.GetScriptingFont(font.Size).Name;

                _autocompleteMenu.Font = CustomFonts.GetScriptingFont(font.Size);
            }
            else
            {
                Styles[Style.Default].Font = font.Name;
                Font = font;
                _autocompleteMenu.Font = font;
            }
            Styles[Style.Default].Size = (int)font.Size;

            StyleClearAll();

            // Configure the CPP (C#) lexer styles
            Styles[Style.Cpp.Default].ForeColor        = Color.Silver;              /////////////////////
            Styles[Style.Cpp.Comment].ForeColor        = Color.FromArgb(0, 128, 0); // Green
            Styles[Style.Cpp.CommentLine].ForeColor    = Color.FromArgb(0, 128, 0); // Green
            Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128);
            // Gray
            Styles[Style.Cpp.Number].ForeColor       = Color.Olive;
            Styles[Style.Cpp.Word].ForeColor         = Color.Blue;
            Styles[Style.Cpp.Word2].ForeColor        = Color.Teal;
            Styles[Style.Cpp.String].ForeColor       = Color.FromArgb(163, 21, 21); // Red
            Styles[Style.Cpp.Character].ForeColor    = Color.FromArgb(163, 21, 21); // Red
            Styles[Style.Cpp.Verbatim].ForeColor     = Color.FromArgb(163, 21, 21); // Red
            Styles[Style.Cpp.StringEol].BackColor    = Color.Pink;
            Styles[Style.Cpp.Operator].ForeColor     = Color.Purple;
            Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon;
            Styles[Style.BraceLight].BackColor       = Color.LightGray;
            Styles[Style.BraceLight].ForeColor       = Color.BlueViolet;
            Styles[Style.BraceBad].ForeColor         = Color.Red;
            //this.Styles[Style.Cpp.CommentDoc]

            Lexer = Lexer.Cpp;
        }
コード例 #3
0
 public void SetFont(Font font)
 {
     if (font.FontFamily.Name == "Cambria")
     {
         Font = CustomFonts.GetMathFont(font.Size);
     }
     else if (font.FontFamily.Name == "Consolas")
     {
         Font = CustomFonts.GetScriptingFont(font.Size);
     }
     else
     {
         Font = font;
     }
 }
コード例 #4
0
 public void SetFont(Font font)
 {
     if (font.FontFamily.Name == "Cambria")
     {
         FontFamily = new FontFamily(CustomFonts.GetMathFont(font.Size).FontFamily.Name);
     }
     else if (font.FontFamily.Name == "Consolas")
     {
         FontFamily = new FontFamily(CustomFonts.GetScriptingFont(font.Size).FontFamily.Name);
     }
     else
     {
         FontFamily = new FontFamily(font.FontFamily.Name);
     }
     FontSize = font.Size;
     //this.FontWeight =  FontWeights.
     FontStyle = ConvertFontStyle(CreateFontStyle(font));
 }
コード例 #5
0
        public BenchmarkForm()
        {
            InitializeComponent();

            benchmark = new Benchmark();


            functionsTestBackgroundWorker.DoWork             += benchmark.mathFunctionsCalculationSpeedTest;
            functionsTestBackgroundWorker.ProgressChanged    += FunctionsTestBackgroundWorker_ProgressChanged;
            functionsTestBackgroundWorker.RunWorkerCompleted += FunctionsTestBackgroundWorker_RunWorkerCompleted;

            memoryTestBackgroundWorker.DoWork             += benchmark.memoryAllocationSpeedTest;
            memoryTestBackgroundWorker.ProgressChanged    += memoryTestBackgroundWorker_ProgressChanged;
            memoryTestBackgroundWorker.RunWorkerCompleted += memoryTestBackgroundWorker_RunWorkerCompleted;
            this.Icon = GraphicsResources.computator_net_icon;
            this.memoryTestRichTextBox.Font    = CustomFonts.GetScriptingFont(10.2F);
            this.functionsTestRichTextBox.Font = CustomFonts.GetScriptingFont(10.2F);
        }