/// <summary> /// Default constructor for creating a new instance of hte Layout form /// </summary> public LayoutForm() { InitializeComponent(); if (Mono.IsRunningOnMono()) { // On Mac and possibly other Mono platforms, GdipCreateLineBrushFromRect // in gdiplus native lib returns InvalidParameter in Mono file LinearGradientBrush.cs // if a StripPanel's Width or Height is 0, so force them to non-0. _toolStripContainer1.TopToolStripPanel.Size = new Size(_toolStripContainer1.TopToolStripPanel.Size.Width, 1); _toolStripContainer1.BottomToolStripPanel.Size = new Size(_toolStripContainer1.BottomToolStripPanel.Size.Width, 1); _toolStripContainer1.LeftToolStripPanel.Size = new Size(1, _toolStripContainer1.LeftToolStripPanel.Size.Height); _toolStripContainer1.RightToolStripPanel.Size = new Size(1, _toolStripContainer1.RightToolStripPanel.Size.Height); } }
/// <summary> /// Handles the Click event of the PrintLayout control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void PrintLayoutClick(object sender, EventArgs e) { // In Mono show the dialog only if printers installed else show error message. if (Mono.IsRunningOnMono()) { if (!new PrinterSettings().IsValid) { MessageBox.Show(Msg.NoPrintersInstalled, Msg.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } using var layout = new LayoutForm(); layout.MapControl = App.Map as Map; layout.ShowDialog(); }
/// <summary> /// Initializes a new instance of the <see cref="LayoutForm"/> class. /// </summary> public LayoutForm() { InitializeComponent(); if (Mono.IsRunningOnMono()) { // On Mac and possibly other Mono platforms, GdipCreateLineBrushFromRect // in gdiplus native lib returns InvalidParameter in Mono file LinearGradientBrush.cs // if a StripPanel's Width or Height is 0, so force them to non-0. _toolStripContainer1.TopToolStripPanel.Size = new Size(_toolStripContainer1.TopToolStripPanel.Size.Width, 1); _toolStripContainer1.BottomToolStripPanel.Size = new Size(_toolStripContainer1.BottomToolStripPanel.Size.Width, 1); _toolStripContainer1.LeftToolStripPanel.Size = new Size(1, _toolStripContainer1.LeftToolStripPanel.Size.Height); _toolStripContainer1.RightToolStripPanel.Size = new Size(1, _toolStripContainer1.RightToolStripPanel.Size.Height); } #region 临时 _layoutMenuStrip1.Items.Add(new ToolStripButton("添加矩形框", null, onClick: addRectangle)); #endregion }
/// <summary> /// Gets the directories in Directories and those nested one level deep. /// </summary> /// <returns>The directories in Directories and those nested one level deep.</returns> private IEnumerable <string> GetDirectoriesNestedOneLevel() { // Visit each directory in Directories Property (usually set by application) Directories.Add(Mono.IsRunningOnMono() ? "Mono Extensions" : "Windows Extensions"); foreach (string directory in Directories.Union(new[] { "Data Extensions", "Tools" })) { string path = Path.Combine(BaseDirectory, directory); if (Directory.Exists(path)) { yield return(path); // Add all of the directories in here, nested one level deep. var dirs = Directory.EnumerateDirectories(path, "*", SearchOption.TopDirectoryOnly); foreach (var dir in dirs) { yield return(dir); } } } }