public SimpleSyntaxEditor(string text, SyntaxLanguageStyle language) { ActiproSoftware.SyntaxEditor.SyntaxEditor editor = new ActiproSoftware.SyntaxEditor.SyntaxEditor { Dock = DockStyle.Fill }; editor.set_IndicatorMarginVisible(false); editor.set_ScrollBarType(0); this._editor = editor; base.Controls.Add(this._editor); try { this.Font = new Font("Consolas", 10f); if (this.Font.Name != "Consolas") { this.Font = new Font("Courier New", 10f); } } catch { } string name = language.ToString(); if (name == "VB") { name = name + "DotNet"; } if (language != SyntaxLanguageStyle.None) { this._editor.get_Document().set_Language(DocumentManager.GetDynamicLanguage(name, SystemColors.Window.GetBrightness())); this._editor.get_Document().get_Outlining().set_Mode(2); this._editor.set_BracketHighlightingVisible(true); } this._editor.get_Document().set_ReadOnly(true); VisualStudio2005SyntaxEditorRenderer renderer = new VisualStudio2005SyntaxEditorRenderer(); SimpleBorder border = new SimpleBorder(); border.set_Style(0); renderer.set_Border(border); VisualStudio2005SyntaxEditorRenderer renderer2 = renderer; this._editor.set_Renderer(renderer2); this.Text = text; }
public void setchartfxStyle(ChartFX.WebForms.Chart FX, ChartFX.WebForms.Gallery ChartGallery, string title, int AxisX_Step, int X_ScaleUnit, int Y_ScaleUnit, bool showTargetLine, int TargetQty) { //FX.Height = Unit.Pixel(180); //FX.Width = Unit.Pixel(210); //FX.EnableViewState = false; FX.Gallery = ChartGallery; FX.AllSeries.FillMode = FillMode.Gradient; GradientBackground myGradient = new GradientBackground(GradientType.Radial); //myGradient.ColorFrom = Color.Black; //myGradient.ColorTo = Color.Black; myGradient.Angle = 45; SimpleBorder myBorder = new SimpleBorder(SimpleBorderType.Etched); //myBorder.Color = Color.Gray; myBorder.InternalOpposite = false; FX.Background = myGradient; FX.Border = myBorder; FX.LegendBox.Visible = false; FX.RenderFormat = "Image"; //FX.AllSeries.Border.Color = Color.Black; TitleDockable oTitle = new TitleDockable(); oTitle.Text = title; oTitle.TextColor = Color.Red; FX.Titles.Add(oTitle); FX.AxisX.ForceZero = true; FX.AxisX.ScrollPosition = 200; FX.AxisY2.Grids.Major.Visible = false; FX.AxisX.Grids.Major.Visible = false; //FX.ForeColor = Color.Yellow; //FX.ChartAreaRectangle.Location. FX.PlotAreaMargin.Top = 20; FX.PlotAreaMargin.Left = 10; FX.PlotAreaMargin.Bottom = 10; FX.PlotAreaMargin.Right = 10; if (AxisX_Step > 0) { FX.AxisX.Step = double.Parse(AxisX_Step.ToString()); } if (showTargetLine == true) { ShowTagLine_FX(FX, TargetQty); } if (X_ScaleUnit > 0) { FX.AxisX.ScaleUnit = double.Parse(X_ScaleUnit.ToString()); } if (Y_ScaleUnit > 0) { FX.AxisY.ScaleUnit = double.Parse(Y_ScaleUnit.ToString()); } FX.ToolBar.Visible = false; }
public void printFrameWithBorders() { Console.WriteLine(SimpleBorder.getUpperBorder(sizeX_ + 2)); for (int i = 0; i < sizeY_; i++)// Las filas hay que imprimirlas al revés { Console.Write(SimpleBorder.getBorder(3)); for (int j = 0; j < sizeX_; j++) { Console.Write(fr_[i][j]); } Console.Write(SimpleBorder.getBorder(3)); Console.WriteLine(); } Console.WriteLine(SimpleBorder.getLowerBorder(sizeX_ + 2)); }
public SimpleSyntaxEditor(string text, SyntaxLanguageStyle language) { ActiproSoftware.SyntaxEditor.SyntaxEditor editor = new ActiproSoftware.SyntaxEditor.SyntaxEditor { Dock = DockStyle.Fill }; editor.set_IndicatorMarginVisible(false); editor.set_ScrollBarType(0); this._editor = editor; base.Controls.Add(this._editor); try { this.Font = new Font("Consolas", 10f); if (this.Font.Name != "Consolas") { this.Font = new Font("Courier New", 10f); } } catch { } string name = language.ToString(); if (name == "VB") { name = name + "DotNet"; } if (language != SyntaxLanguageStyle.None) { this._editor.get_Document().set_Language(DocumentManager.GetDynamicLanguage(name, SystemColors.Window.GetBrightness())); this._editor.get_Document().get_Outlining().set_Mode(2); this._editor.set_BracketHighlightingVisible(true); } this._editor.get_Document().set_ReadOnly(true); VisualStudio2005SyntaxEditorRenderer renderer = new VisualStudio2005SyntaxEditorRenderer(); SimpleBorder border = new SimpleBorder(); border.set_Style(0); renderer.set_Border(border); VisualStudio2005SyntaxEditorRenderer renderer2 = renderer; this._editor.set_Renderer(renderer2); this.Text = text; }
internal QueryControl(RunnableQuery q, SchemaTree schemaTree) { EventHandler onClick = null; EventHandler handler2 = null; EventHandler handler3 = null; EventHandler handler4 = null; SplitterCancelEventHandler handler5 = null; this._browserHidden = true; Timer timer = new Timer { Interval = 0x2710, Enabled = true }; this._autoSaveTimer = timer; this._executionTrackingTimer = new Timer(); this._pluginWinButtons = new List<ToolStripButton>(); this._query = new RunnableQuery(); this.NextQueryRequest = delegate (object sender, EventArgs e) { }; this.PreviousQueryRequest = delegate (object sender, EventArgs e) { }; this._lambdaData = new MemoryStream(); this._ilDirty = true; this._ilData = new MemoryStream(); this._queryCount = 0; Timer timer2 = new Timer { Interval = 200 }; this._refreshTimer = timer2; Timer timer3 = new Timer { Interval = 200 }; this._clockTimer = timer3; this._firstResultsShow = true; this._lastQueryKind = QueryLanguage.SQL; this._suppressPullCount = 0; this._random = new Random(); this.components = null; this._query = q; this._schemaTree = schemaTree; try { this.Font = FontManager.GetDefaultFont(); } catch { } this.InitializeComponent(); this.CheckIsMyExtensions(); this._pluginWinManager = new PluginWindowManager(this); this._pluginWinButtonMenu = new ContextMenuStrip(this.components); if (onClick == null) { onClick = (sender, e) => this.CloseCurrentVisualizer(); } this._pluginWinButtonMenu.Items.Add("Close visualizer (Shift+F4 or Middle-Click or Ctrl+Click)", Resources.Delete, onClick); if (this.btnExecute.Height > 0x20) { this.btnExecute.Height -= 3; this.cboLanguage.Margin = new Padding(this.cboLanguage.Margin.Left, 2, this.cboLanguage.Margin.Right, 4); this.cboDb.Margin = new Padding(this.cboDb.Margin.Left, 2, this.cboDb.Margin.Right, 4); } else if (this.btnExecute.Height > 0x1d) { this.btnExecute.Height -= 2; } else if (this.btnExecute.Height > 0x18) { this.btnExecute.Height--; } this.btnCancel.Height = this.btnExecute.Height; this.btnText.Height = this.btnGrids.Height = this.btnExecute.Height - 1; if ((IntPtr.Size == 4) && (this.btnExecute.Height > 0x1b)) { Padding margin = this.cboLanguage.Margin; this.cboLanguage.Margin = new Padding(margin.Left, margin.Top, margin.Right, margin.Bottom - 1); margin = this.cboDb.Margin; this.cboDb.Margin = new Padding(margin.Left, margin.Top, margin.Right, margin.Bottom - 1); } if (this.btnExecute.Height > 40) { this.btnExecute.Image = ControlUtil.ResizeImage(this.btnExecute.Image, this.btnExecute.Width, this.btnExecute.Height, true); this.btnCancel.Image = ControlUtil.ResizeImage(this.btnCancel.Image, this.btnCancel.Width, this.btnCancel.Height, true); this.btnGrids.Image = ControlUtil.ResizeImage(this.btnGrids.Image, (this.btnGrids.Width * 3) / 4, (this.btnGrids.Height * 3) / 4, true); this.btnText.Image = ControlUtil.ResizeImage(this.btnText.Image, (this.btnText.Width * 3) / 4, (this.btnText.Height * 3) / 4, true); } this.UpdateAutocompletionMsg(); try { this.txtError.Font = new Font("Verdana", 8.25f); this.txtSQL.Font = new Font("Verdana", 9.5f); this.btnActivateAutocompletion.Font = new Font("Verdana", 8f, FontStyle.Bold); this.lblOptimize.Font = new Font("Verdana", 7f, FontStyle.Bold); } catch { } this.txtSQL.get_Document().set_Language(DocumentManager.GetDynamicLanguage("SQL", SystemColors.Window.GetBrightness())); this.txtSQL.get_Document().get_Outlining().set_Mode(2); this.txtSQL.set_BracketHighlightingVisible(true); this.txtSQL.get_Document().set_ReadOnly(true); VisualStudio2005SyntaxEditorRenderer renderer = new VisualStudio2005SyntaxEditorRenderer(); SimpleBorder border = new SimpleBorder(); border.set_Style(0); renderer.set_Border(border); VisualStudio2005SyntaxEditorRenderer renderer2 = renderer; this.txtSQL.set_Renderer(renderer2); this._docMan = new DocumentManager(this._query, this); this.CreateEditor(); this.PropagateOptions(); this.UpdateEditorZoom(); this.CreateBrowser(); this._browserHidden = true; this.panBottom.BorderStyle = BorderStyle.None; this.tsOutput.BackColor = Color.Transparent; this.tsOutput.Renderer = new OutputToolsRenderer(); this.statusStrip.BackColor = Color.Transparent; this.statusStrip.Padding = new Padding(this.statusStrip.Padding.Left, this.statusStrip.Padding.Top, this.statusStrip.Padding.Left, this.statusStrip.Padding.Bottom); this.PullData(QueryChangedEventArgs.Refresh); this.ToggleResultsCollapse(); this._query.QueryCompiled += new EventHandler<QueryCompilationEventArgs>(this._query_QueryCompiled); this._query.PluginsReady += new EventHandler(this._query_PluginsReady); this._query.CustomClickCompleted += new EventHandler(this._query_CustomClickCompleted); this._query.QueryCompleted += new EventHandler<QueryStatusEventArgs>(this._query_QueryCompleted); this._query.QueryChanged += new EventHandler<QueryChangedEventArgs>(this._query_QueryChanged); this._query.ReadLineRequested += new EventHandler<ReadLineEventArgs>(this._query_ReadLineRequested); this._editor.TextChanged += new EventHandler(this._editor_TextChanged); this._editor.add_SelectionChanged(new SelectionEventHandler(this, (IntPtr) this._editor_SelectionChanged)); this._editor.RepositoryDropped += new EventHandler<QueryEditor.RepositoryEventArgs>(this._editor_RepositoryDropped); this._schemaTree.AfterSelect += new TreeViewEventHandler(this._schemaTree_AfterSelect); this._docMan.CheckForRepositoryChange(); this._refreshTimer.Tick += new EventHandler(this.RefreshTimer_Tick); this._clockTimer.Tick += new EventHandler(this.ClockTimer_Tick); this._autoSaveTimer.Tick += new EventHandler(this.AutoSaveTimer_Tick); if (handler2 == null) { handler2 = (sender, e) => this.ReportMainThreadPosition(); } this._executionTrackingTimer.Tick += handler2; if (SystemColors.Window.GetBrightness() < 0.5f) { this.llDbUseCurrent.ForeColor = SystemColors.HotTrack; } this.ExtendOutputSplitter(); if (handler3 == null) { handler3 = (sender, e) => this.UpdateErrorHeight(); } this.panError.SizeChanged += handler3; this.statusStrip.Parent = null; base.Controls.Add(this.statusStrip); this.statusStrip.SendToBack(); if (handler4 == null) { handler4 = (sender, e) => this.RequestWinManagerRelocation(); } EventHandler handler6 = handler4; this.panOutput.Resize += handler6; for (Control control = this.panOutput; control != null; control = control.Parent) { control.Move += handler6; } this._query.PluginWindowManager = this._pluginWinManager; this.queryProgressBar.Margin = new Padding(3, 3, 0, 1); this.tsOutput.Padding = new Padding(0, 0, 0, 2); this.splitContainer.SplitterWidth--; if (handler5 == null) { handler5 = delegate (object sender, SplitterCancelEventArgs e) { if (Control.MouseButtons == MouseButtons.Left) { MainForm.Instance.IsSplitting = true; } if ((this.panOutput.BackColor == MainForm.Instance.TransparencyKey) && (this.panOutput.BackColor != Program.LightTransparencyKey)) { this.panOutput.BackColor = MainForm.Instance.TransparencyKey = Program.LightTransparencyKey; } }; } this.splitContainer.SplitterMoving += handler5; this.panOutput.BorderStyle = BorderStyle.None; this.panOutput.BorderColor = Color.FromArgb(160, 160, 160); this.lblSyncDb.Cursor = Cursors.Hand; this.toolTip.ShowAlways = true; this.EnableControls(); this.panBottom.Layout += new LayoutEventHandler(this.panBottom_Layout); }