From 04c7f601548402c26647524ae30e13324e55f819 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Sat, 12 Apr 2025 01:21:08 -0400 Subject: [PATCH 1/5] Added basic BreadCrumb control. --- .../JexusManager.BreadCrumb.Demo.csproj | 15 + JexusManager.BreadCrumb.Demo/MainForm.cs | 288 +++++++++++++++++ JexusManager.BreadCrumb.Demo/Program.cs | 19 ++ JexusManager.Breadcrumb/BreadcrumbControl.cs | 305 ++++++++++++++++++ JexusManager.Breadcrumb/BreadcrumbItem.cs | 44 +++ .../BreadcrumbItemClickedEventArgs.cs | 31 ++ .../JexusManager.Breadcrumb.csproj | 16 + .../ToolStripBreadcrumbItem.cs | 140 ++++++++ 8 files changed, 858 insertions(+) create mode 100644 JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj create mode 100644 JexusManager.BreadCrumb.Demo/MainForm.cs create mode 100644 JexusManager.BreadCrumb.Demo/Program.cs create mode 100644 JexusManager.Breadcrumb/BreadcrumbControl.cs create mode 100644 JexusManager.Breadcrumb/BreadcrumbItem.cs create mode 100644 JexusManager.Breadcrumb/BreadcrumbItemClickedEventArgs.cs create mode 100644 JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj create mode 100644 JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs diff --git a/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj b/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj new file mode 100644 index 00000000..738d1700 --- /dev/null +++ b/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj @@ -0,0 +1,15 @@ + + + + net9.0-windows + true + WinExe + JexusManager.BreadCrumb.Demo + enable + + + + + + + diff --git a/JexusManager.BreadCrumb.Demo/MainForm.cs b/JexusManager.BreadCrumb.Demo/MainForm.cs new file mode 100644 index 00000000..4880c645 --- /dev/null +++ b/JexusManager.BreadCrumb.Demo/MainForm.cs @@ -0,0 +1,288 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using JexusManager.Breadcrumb; + +namespace JexusManager.BreadCrumb.Demo +{ + public partial class MainForm : Form + { + private readonly BreadcrumbControl _breadcrumb; + private readonly ToolStripBreadcrumbItem _toolStripBreadcrumb; + private readonly Panel _contentPanel; + private readonly ListBox _navigationHistoryListBox; public MainForm() + { + Text = "BreadCrumb Control Demo"; + Size = new Size(800, 600); + StartPosition = FormStartPosition.CenterScreen; + + // Create the standard breadcrumb control + _breadcrumb = new BreadcrumbControl + { + Dock = DockStyle.Top, + Height = 30, + Margin = new Padding(10), + Font = new Font("Segoe UI", 9F), + HighlightColor = Color.FromArgb(0, 120, 215) + }; + _breadcrumb.ItemClicked += Breadcrumb_ItemClicked; + + // Create a ToolStrip with breadcrumb + var toolStrip = new ToolStrip + { + Dock = DockStyle.Top, + GripStyle = ToolStripGripStyle.Hidden, + RenderMode = ToolStripRenderMode.System + }; + + // Add some standard ToolStrip items + toolStrip.Items.Add(new ToolStripButton("Home", null, (s, e) => InitializeNavigation()) + { + DisplayStyle = ToolStripItemDisplayStyle.Image, + Image = SystemIcons.Application.ToBitmap() + }); + + toolStrip.Items.Add(new ToolStripSeparator()); + + // Create the ToolStripBreadcrumbItem + _toolStripBreadcrumb = new ToolStripBreadcrumbItem + { + Width = 500, + Font = new Font("Segoe UI", 9F), + HighlightColor = Color.FromArgb(0, 120, 215) + }; + _toolStripBreadcrumb.ItemClicked += ToolStripBreadcrumb_ItemClicked; + + toolStrip.Items.Add(_toolStripBreadcrumb); + + // Create the content panel + _contentPanel = new Panel + { + Dock = DockStyle.Fill, + BackColor = SystemColors.Window, + Padding = new Padding(10) + }; + + // Create navigation history list + _navigationHistoryListBox = new ListBox + { + Dock = DockStyle.Right, + Width = 250, + Font = new Font("Segoe UI", 9F), + BorderStyle = BorderStyle.FixedSingle + }; + + // Create a splitter between panels + var splitter = new Splitter + { + Dock = DockStyle.Right, + Width = 3, + BackColor = SystemColors.ControlDark + }; + + // Create buttons for demonstration + var buttonPanel = new FlowLayoutPanel + { + Dock = DockStyle.Bottom, + Height = 40, + Padding = new Padding(5), + FlowDirection = FlowDirection.RightToLeft + }; + + var resetButton = new Button + { + Text = "Reset Navigation", + Height = 30, + Width = 150, + Margin = new Padding(5, 0, 0, 0) + }; + resetButton.Click += ResetButton_Click; + + var navigateButton = new Button + { + Text = "Navigate Deeper", + Height = 30, + Width = 150, + Margin = new Padding(5, 0, 0, 0) + }; + navigateButton.Click += NavigateButton_Click; // Add a label for each breadcrumb implementation + var standardLabel = new Label + { + Text = "Standard Breadcrumb Control:", + Dock = DockStyle.Top, + Height = 20, + Font = new Font("Segoe UI", 8F), + ForeColor = SystemColors.GrayText, + Padding = new Padding(10, 3, 0, 0) + }; + + var toolstripLabel = new Label + { + Text = "ToolStrip Breadcrumb Control:", + Dock = DockStyle.Top, + Height = 20, + Font = new Font("Segoe UI", 8F), + ForeColor = SystemColors.GrayText, + Padding = new Padding(10, 3, 0, 0) + }; + + // Add controls to the form + buttonPanel.Controls.Add(resetButton); + buttonPanel.Controls.Add(navigateButton); + + Controls.Add(_contentPanel); + Controls.Add(splitter); + Controls.Add(_navigationHistoryListBox); + Controls.Add(buttonPanel); + Controls.Add(_breadcrumb); + Controls.Add(standardLabel); + Controls.Add(toolStrip); + Controls.Add(toolstripLabel); + + // Initialize with Home + InitializeNavigation(); + } private void InitializeNavigation() + { + // Initialize standard breadcrumb + _breadcrumb.Clear(); + _breadcrumb.AddItem("Home", "home"); + + // Initialize toolstrip breadcrumb + _toolStripBreadcrumb.Clear(); + _toolStripBreadcrumb.AddItem("Home", "home"); + + UpdateContentPanel("Home Page"); + AddToNavigationHistory("Navigated to Home"); + } + + private void ToolStripBreadcrumb_ItemClicked(object sender, BreadcrumbItemClickedEventArgs e) + { + // If we click on an item, remove all items after it + while (_toolStripBreadcrumb.Items.Count > e.Index + 1) + { + _toolStripBreadcrumb.RemoveLastItem(); + } + + // Also sync the standard breadcrumb to match + _breadcrumb.Clear(); + foreach (var item in _toolStripBreadcrumb.Items) + { + _breadcrumb.AddItem(item.Text, item.Tag); + } + + // Update the content panel based on the clicked item + UpdateContentPanel($"{e.Item.Text} Page (ToolStrip)"); + AddToNavigationHistory($"Navigated to {e.Item.Text} via ToolStrip breadcrumb"); + } + + private void Breadcrumb_ItemClicked(object sender, BreadcrumbItemClickedEventArgs e) + { + // If we click on an item, remove all items after it + while (_breadcrumb.Items.Count > e.Index + 1) + { + _breadcrumb.RemoveLastItem(); + } + + // Update the content panel based on the clicked item + UpdateContentPanel($"{e.Item.Text} Page"); + AddToNavigationHistory($"Navigated to {e.Item.Text} via breadcrumb"); + } private void NavigateButton_Click(object sender, EventArgs e) + { + // Generate a new level based on the current path + string[] sections = { "Settings", "Users", "Products", "Reports", "Services" }; + string[] subsections = { "List", "Details", "Edit", "Create", "Delete", "Properties" }; + + Random random = new Random(); + + string newSection; + + // If we're at the beginning, pick a main section + if (_breadcrumb.Items.Count <= 1) + { + newSection = sections[random.Next(sections.Length)]; + } + // Otherwise, add a subsection + else + { + newSection = subsections[random.Next(subsections.Length)]; + } + + // Add the new item to both breadcrumb controls + string tagValue = $"level_{_breadcrumb.Items.Count}"; + _breadcrumb.AddItem(newSection, tagValue); + _toolStripBreadcrumb.AddItem(newSection, tagValue); + + // Update the content panel + UpdateContentPanel($"{newSection} Page"); + + // Add to navigation history + AddToNavigationHistory($"Navigated to {newSection}"); + } + + private void ResetButton_Click(object sender, EventArgs e) + { + InitializeNavigation(); + } + + private void UpdateContentPanel(string content) + { + // Clear existing controls + _contentPanel.Controls.Clear(); + + // Create a label to display the current "page" + var contentLabel = new Label + { + Text = content, + Font = new Font("Segoe UI", 16F, FontStyle.Bold), + AutoSize = true, + Location = new Point(20, 20) + }; + + // Create a label to show current breadcrumb path + var fullPathLabel = new Label + { + Text = "Current Path: " + GetFullPath(), + Font = new Font("Segoe UI", 10F), + AutoSize = true, + Location = new Point(20, 60) + }; + + // Add a description about what to do + var descriptionLabel = new Label + { + Text = "Use the 'Navigate Deeper' button to navigate to a new section.\n" + + "Click on any item in the breadcrumb trail to navigate back to that level.\n" + + "The 'Reset Navigation' button will clear the path and return to Home.", + Font = new Font("Segoe UI", 9F), + AutoSize = true, + Location = new Point(20, 100) + }; + + _contentPanel.Controls.Add(contentLabel); + _contentPanel.Controls.Add(fullPathLabel); + _contentPanel.Controls.Add(descriptionLabel); + } + + private string GetFullPath() + { + string path = string.Empty; + + for (int i = 0; i < _breadcrumb.Items.Count; i++) + { + path += _breadcrumb.Items[i].Text; + + if (i < _breadcrumb.Items.Count - 1) + { + path += " > "; + } + } + + return path; + } + + private void AddToNavigationHistory(string action) + { + _navigationHistoryListBox.Items.Insert(0, $"[{DateTime.Now.ToLongTimeString()}] {action}"); + } + } +} diff --git a/JexusManager.BreadCrumb.Demo/Program.cs b/JexusManager.BreadCrumb.Demo/Program.cs new file mode 100644 index 00000000..db8979e6 --- /dev/null +++ b/JexusManager.BreadCrumb.Demo/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace JexusManager.BreadCrumb.Demo +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/JexusManager.Breadcrumb/BreadcrumbControl.cs b/JexusManager.Breadcrumb/BreadcrumbControl.cs new file mode 100644 index 00000000..b09709c7 --- /dev/null +++ b/JexusManager.Breadcrumb/BreadcrumbControl.cs @@ -0,0 +1,305 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace JexusManager.Breadcrumb +{ + /// + /// A breadcrumb navigation control for Windows Forms applications. + /// + [ToolboxItem(true)] + public class BreadcrumbControl : Control + { + private readonly List _items = new List(); + private int _selectedIndex = -1; + private int _hoveredIndex = -1; + private bool _mouseDown = false; + private Font _boldFont; + + /// + /// Occurs when a breadcrumb item is clicked. + /// + public event EventHandler ItemClicked; + + /// + /// Gets or sets the selected item index. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int SelectedIndex + { + get => _selectedIndex; + set + { + if (_selectedIndex != value && value >= -1 && value < _items.Count) + { + _selectedIndex = value; + Invalidate(); + } + } + } + + /// + /// Gets the collection of breadcrumb items. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public List Items => _items; + + /// + /// Gets or sets the separator character between items. + /// + [Category("Appearance")] + [DefaultValue(">")] + public string Separator { get; set; } = ">"; + + /// + /// Gets or sets the background color for highlighted items. + /// + [Category("Appearance")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] + public Color HighlightColor { get; set; } = SystemColors.Highlight; + + /// + /// Initializes a new instance of the BreadcrumbControl class. + /// + public BreadcrumbControl() + { + SetStyle(ControlStyles.OptimizedDoubleBuffer | + ControlStyles.AllPaintingInWmPaint | + ControlStyles.UserPaint | + ControlStyles.ResizeRedraw, true); + + this.BackColor = SystemColors.Window; + this.ForeColor = SystemColors.WindowText; + + _boldFont = new Font(this.Font, FontStyle.Bold); + } + + /// + /// Clears all items from the breadcrumb control. + /// + public void Clear() + { + _items.Clear(); + _selectedIndex = -1; + _hoveredIndex = -1; + Invalidate(); + } + + /// + /// Adds a new item to the breadcrumb control. + /// + /// The text of the item. + /// The tag object associated with the item. + /// The newly added BreadcrumbItem. + public BreadcrumbItem AddItem(string text, object tag = null) + { + var item = new BreadcrumbItem(text, tag); + _items.Add(item); + Invalidate(); + return item; + } + + /// + /// Removes the last item from the breadcrumb control. + /// + public void RemoveLastItem() + { + if (_items.Count > 0) + { + _items.RemoveAt(_items.Count - 1); + if (_selectedIndex >= _items.Count) + { + _selectedIndex = _items.Count - 1; + } + Invalidate(); + } + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + _boldFont?.Dispose(); + } + base.Dispose(disposing); + } + + /// + /// Raises the Paint event. + /// + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + Graphics g = e.Graphics; + g.SmoothingMode = SmoothingMode.AntiAlias; + + // Track locations and widths for hit testing + int x = Padding.Left; + + for (int i = 0; i < _items.Count; i++) + { + BreadcrumbItem item = _items[i]; + + // Determine font and colors based on state + Font itemFont = i == _selectedIndex ? _boldFont : Font; + Color textColor = ForeColor; + Brush backgroundBrush = null; + + if (i == _hoveredIndex) + { + backgroundBrush = new SolidBrush(Color.FromArgb(40, HighlightColor)); + if (_mouseDown) + { + backgroundBrush = new SolidBrush(Color.FromArgb(70, HighlightColor)); + } + } + + // Measure text + SizeF textSize = g.MeasureString(item.Text, itemFont); + int itemWidth = (int)Math.Ceiling(textSize.Width) + 10; // Add padding + int itemHeight = (int)Math.Ceiling(textSize.Height) + 4; // Add padding + + // Set the item's bounds for hit testing + item.Bounds = new Rectangle(x, (Height - itemHeight) / 2, itemWidth, itemHeight); + + // Draw background if hovered/selected + if (backgroundBrush != null) + { + using (GraphicsPath path = RoundedRectangle(item.Bounds, 3)) + { + g.FillPath(backgroundBrush, path); + } + backgroundBrush.Dispose(); + } + + // Draw text + using (Brush textBrush = new SolidBrush(textColor)) + { + g.DrawString(item.Text, itemFont, textBrush, + x + 5, (Height - textSize.Height) / 2); + } + + // Update x position + x += itemWidth; + + // Draw separator if not the last item + if (i < _items.Count - 1) + { + using Brush separatorBrush = new SolidBrush(Color.FromArgb(180, ForeColor)); + SizeF sepSize = g.MeasureString(Separator, Font); + g.DrawString(Separator, Font, separatorBrush, + x + 2, (Height - sepSize.Height) / 2); + x += (int)Math.Ceiling(sepSize.Width) + 6; + } + } + } + + /// + /// Creates a rounded rectangle path. + /// + private GraphicsPath RoundedRectangle(Rectangle bounds, int radius) + { + int diameter = radius * 2; + Rectangle arc = new Rectangle(bounds.Location, new Size(diameter, diameter)); + GraphicsPath path = new GraphicsPath(); + + // Top left arc + path.AddArc(arc, 180, 90); + + // Top right arc + arc.X = bounds.Right - diameter; + path.AddArc(arc, 270, 90); + + // Bottom right arc + arc.Y = bounds.Bottom - diameter; + path.AddArc(arc, 0, 90); + + // Bottom left arc + arc.X = bounds.Left; + path.AddArc(arc, 90, 90); + + path.CloseFigure(); + return path; + } + + /// + /// Raises the MouseMove event. + /// + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + int oldHoveredIndex = _hoveredIndex; + _hoveredIndex = -1; + + for (int i = 0; i < _items.Count; i++) + { + if (_items[i].Bounds.Contains(e.Location)) + { + _hoveredIndex = i; + break; + } + } + + if (oldHoveredIndex != _hoveredIndex) + { + Invalidate(); + Cursor = _hoveredIndex >= 0 ? Cursors.Hand : Cursors.Default; + } + } + + /// + /// Raises the MouseDown event. + /// + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + if (e.Button == MouseButtons.Left) + { + _mouseDown = true; + Invalidate(); + } + } + + /// + /// Raises the MouseUp event. + /// + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + if (e.Button == MouseButtons.Left) + { + _mouseDown = false; + if (_hoveredIndex >= 0) + { + _selectedIndex = _hoveredIndex; + ItemClicked?.Invoke(this, new BreadcrumbItemClickedEventArgs(_items[_hoveredIndex], _hoveredIndex)); + } + Invalidate(); + } + } + + /// + /// Raises the MouseLeave event. + /// + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + if (_hoveredIndex >= 0) + { + _hoveredIndex = -1; + Invalidate(); + } + Cursor = Cursors.Default; + } + } +} diff --git a/JexusManager.Breadcrumb/BreadcrumbItem.cs b/JexusManager.Breadcrumb/BreadcrumbItem.cs new file mode 100644 index 00000000..a38bfd15 --- /dev/null +++ b/JexusManager.Breadcrumb/BreadcrumbItem.cs @@ -0,0 +1,44 @@ +using System.Drawing; + +namespace JexusManager.Breadcrumb +{ + /// + /// Represents an individual item in a breadcrumb navigation control. + /// + public class BreadcrumbItem + { + /// + /// Gets or sets the display text of the breadcrumb item. + /// + public string Text { get; set; } + + /// + /// Gets or sets the tag object associated with this breadcrumb item. + /// + public object? Tag { get; set; } + + /// + /// Gets or sets the bounds rectangle for this item. + /// + internal Rectangle Bounds { get; set; } + + /// + /// Initializes a new instance of the BreadcrumbItem class. + /// + /// The display text of the breadcrumb item. + /// The tag object associated with this breadcrumb item. + public BreadcrumbItem(string text, object? tag = null) + { + Text = text; + Tag = tag; + } + + /// + /// Returns a string representation of this breadcrumb item. + /// + public override string ToString() + { + return Text; + } + } +} diff --git a/JexusManager.Breadcrumb/BreadcrumbItemClickedEventArgs.cs b/JexusManager.Breadcrumb/BreadcrumbItemClickedEventArgs.cs new file mode 100644 index 00000000..81c5c205 --- /dev/null +++ b/JexusManager.Breadcrumb/BreadcrumbItemClickedEventArgs.cs @@ -0,0 +1,31 @@ +using System; + +namespace JexusManager.Breadcrumb +{ + /// + /// Provides data for the BreadcrumbControl.ItemClicked event. + /// + public class BreadcrumbItemClickedEventArgs : EventArgs + { + /// + /// Gets the BreadcrumbItem that was clicked. + /// + public BreadcrumbItem Item { get; } + + /// + /// Gets the index of the BreadcrumbItem that was clicked. + /// + public int Index { get; } + + /// + /// Initializes a new instance of the BreadcrumbItemClickedEventArgs class. + /// + /// The BreadcrumbItem that was clicked. + /// The index of the BreadcrumbItem that was clicked. + public BreadcrumbItemClickedEventArgs(BreadcrumbItem item, int index) + { + Item = item; + Index = index; + } + } +} diff --git a/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj b/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj new file mode 100644 index 00000000..8a0ace73 --- /dev/null +++ b/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj @@ -0,0 +1,16 @@ + + + + net9.0-windows + true + true + ..\JexusManager\JexusManager.snk + JexusManager.Breadcrumb + enable + + + + $(DefineConstants)TRACE;DESIGN + + + diff --git a/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs b/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs new file mode 100644 index 00000000..57a1e899 --- /dev/null +++ b/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs @@ -0,0 +1,140 @@ +using System.Windows.Forms; +using System.Drawing; +using System.ComponentModel; + +namespace JexusManager.Breadcrumb +{ + /// + /// A ToolStripControlHost that wraps a BreadcrumbControl for use in ToolStrip containers. + /// + [ToolboxItem(true)] + public class ToolStripBreadcrumbItem : ToolStripControlHost + { + /// + /// Gets the underlying BreadcrumbControl being hosted. + /// + public BreadcrumbControl BreadcrumbControl => Control as BreadcrumbControl; + + /// + /// Initializes a new instance of the ToolStripBreadcrumbItem class. + /// + public ToolStripBreadcrumbItem() : base(CreateControlInstance()) + { + // Set default appearance + AutoSize = false; + } private static Control CreateControlInstance() + { + return new BreadcrumbControl + { + Margin = new Padding(0), + Padding = new Padding(0) + }; + } + + /// + /// Gets or sets the selected item index in the breadcrumb control. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int SelectedIndex + { + get => BreadcrumbControl.SelectedIndex; + set => BreadcrumbControl.SelectedIndex = value; + } + + /// + /// Gets the collection of breadcrumb items. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public System.Collections.Generic.List Items => BreadcrumbControl.Items; + + /// + /// Gets or sets the separator character between items. + /// + [Category("Appearance")] + [DefaultValue(">")] + public string Separator + { + get => BreadcrumbControl.Separator; + set => BreadcrumbControl.Separator = value; + } + + /// + /// Gets or sets the background color for highlighted items. + /// + [Category("Appearance")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] + public Color HighlightColor + { + get => BreadcrumbControl.HighlightColor; + set => BreadcrumbControl.HighlightColor = value; + } + + /// + /// Subscribes to events from the hosted control. + /// + protected override void OnSubscribeControlEvents(Control control) + { + base.OnSubscribeControlEvents(control); + + // Subscribe to events from the BreadcrumbControl + if (control is BreadcrumbControl breadcrumbControl) + { + breadcrumbControl.ItemClicked += BreadcrumbControl_ItemClicked; + } + } + + /// + /// Unsubscribes from events from the hosted control. + /// + protected override void OnUnsubscribeControlEvents(Control control) + { + base.OnUnsubscribeControlEvents(control); + + // Unsubscribe from events from the BreadcrumbControl + if (control is BreadcrumbControl breadcrumbControl) + { + breadcrumbControl.ItemClicked -= BreadcrumbControl_ItemClicked; + } + } + + // Forward events from the BreadcrumbControl + private void BreadcrumbControl_ItemClicked(object sender, BreadcrumbItemClickedEventArgs e) + { + ItemClicked?.Invoke(this, e); + } + + /// + /// Occurs when a breadcrumb item is clicked. + /// + public event System.EventHandler ItemClicked; + + /// + /// Clears all items from the breadcrumb control. + /// + public void Clear() + { + BreadcrumbControl.Clear(); + } + + /// + /// Adds a new item to the breadcrumb control. + /// + /// The text of the item. + /// The tag object associated with the item. + /// The newly added BreadcrumbItem. + public BreadcrumbItem AddItem(string text, object tag = null) + { + return BreadcrumbControl.AddItem(text, tag); + } + + /// + /// Removes the last item from the breadcrumb control. + /// + public void RemoveLastItem() + { + BreadcrumbControl.RemoveLastItem(); + } + } +} From baf53ca57a1f9226e18c8e3680d45090a392899e Mon Sep 17 00:00:00 2001 From: Lex Li Date: Sat, 12 Apr 2025 12:56:17 -0400 Subject: [PATCH 2/5] Improved breadcrumb control. --- JexusManager.BreadCrumb.Demo/MainForm.cs | 42 +- JexusManager.Breadcrumb/BreadcrumbControl.cs | 1056 +++++++++++++++-- JexusManager.Breadcrumb/BreadcrumbItem.cs | 24 +- .../BreadcrumbItemEventArgs.cs | 31 + .../ToolStripBreadcrumbItem.cs | 43 +- 5 files changed, 1073 insertions(+), 123 deletions(-) create mode 100644 JexusManager.Breadcrumb/BreadcrumbItemEventArgs.cs diff --git a/JexusManager.BreadCrumb.Demo/MainForm.cs b/JexusManager.BreadCrumb.Demo/MainForm.cs index 4880c645..7e20d870 100644 --- a/JexusManager.BreadCrumb.Demo/MainForm.cs +++ b/JexusManager.BreadCrumb.Demo/MainForm.cs @@ -10,7 +10,7 @@ public partial class MainForm : Form private readonly BreadcrumbControl _breadcrumb; private readonly ToolStripBreadcrumbItem _toolStripBreadcrumb; private readonly Panel _contentPanel; - private readonly ListBox _navigationHistoryListBox; public MainForm() + private readonly ListBox _navigationHistoryListBox; public MainForm() { Text = "BreadCrumb Control Demo"; Size = new Size(800, 600); @@ -26,7 +26,7 @@ public partial class MainForm : Form HighlightColor = Color.FromArgb(0, 120, 215) }; _breadcrumb.ItemClicked += Breadcrumb_ItemClicked; - + // Create a ToolStrip with breadcrumb var toolStrip = new ToolStrip { @@ -34,16 +34,16 @@ public partial class MainForm : Form GripStyle = ToolStripGripStyle.Hidden, RenderMode = ToolStripRenderMode.System }; - + // Add some standard ToolStrip items toolStrip.Items.Add(new ToolStripButton("Home", null, (s, e) => InitializeNavigation()) { DisplayStyle = ToolStripItemDisplayStyle.Image, Image = SystemIcons.Application.ToBitmap() }); - + toolStrip.Items.Add(new ToolStripSeparator()); - + // Create the ToolStripBreadcrumbItem _toolStripBreadcrumb = new ToolStripBreadcrumbItem { @@ -52,7 +52,7 @@ public partial class MainForm : Form HighlightColor = Color.FromArgb(0, 120, 215) }; _toolStripBreadcrumb.ItemClicked += ToolStripBreadcrumb_ItemClicked; - + toolStrip.Items.Add(_toolStripBreadcrumb); // Create the content panel @@ -115,7 +115,7 @@ public partial class MainForm : Form ForeColor = SystemColors.GrayText, Padding = new Padding(10, 3, 0, 0) }; - + var toolstripLabel = new Label { Text = "ToolStrip Breadcrumb Control:", @@ -141,20 +141,21 @@ public partial class MainForm : Form // Initialize with Home InitializeNavigation(); - } private void InitializeNavigation() + } + private void InitializeNavigation() { // Initialize standard breadcrumb _breadcrumb.Clear(); _breadcrumb.AddItem("Home", "home"); - + // Initialize toolstrip breadcrumb _toolStripBreadcrumb.Clear(); _toolStripBreadcrumb.AddItem("Home", "home"); - + UpdateContentPanel("Home Page"); AddToNavigationHistory("Navigated to Home"); } - + private void ToolStripBreadcrumb_ItemClicked(object sender, BreadcrumbItemClickedEventArgs e) { // If we click on an item, remove all items after it @@ -162,7 +163,7 @@ private void ToolStripBreadcrumb_ItemClicked(object sender, BreadcrumbItemClicke { _toolStripBreadcrumb.RemoveLastItem(); } - + // Also sync the standard breadcrumb to match _breadcrumb.Clear(); foreach (var item in _toolStripBreadcrumb.Items) @@ -186,16 +187,17 @@ private void Breadcrumb_ItemClicked(object sender, BreadcrumbItemClickedEventArg // Update the content panel based on the clicked item UpdateContentPanel($"{e.Item.Text} Page"); AddToNavigationHistory($"Navigated to {e.Item.Text} via breadcrumb"); - } private void NavigateButton_Click(object sender, EventArgs e) + } + private void NavigateButton_Click(object sender, EventArgs e) { // Generate a new level based on the current path string[] sections = { "Settings", "Users", "Products", "Reports", "Services" }; string[] subsections = { "List", "Details", "Edit", "Create", "Delete", "Properties" }; Random random = new Random(); - + string newSection; - + // If we're at the beginning, pick a main section if (_breadcrumb.Items.Count <= 1) { @@ -211,10 +213,10 @@ private void Breadcrumb_ItemClicked(object sender, BreadcrumbItemClickedEventArg string tagValue = $"level_{_breadcrumb.Items.Count}"; _breadcrumb.AddItem(newSection, tagValue); _toolStripBreadcrumb.AddItem(newSection, tagValue); - + // Update the content panel UpdateContentPanel($"{newSection} Page"); - + // Add to navigation history AddToNavigationHistory($"Navigated to {newSection}"); } @@ -266,17 +268,17 @@ private void UpdateContentPanel(string content) private string GetFullPath() { string path = string.Empty; - + for (int i = 0; i < _breadcrumb.Items.Count; i++) { path += _breadcrumb.Items[i].Text; - + if (i < _breadcrumb.Items.Count - 1) { path += " > "; } } - + return path; } diff --git a/JexusManager.Breadcrumb/BreadcrumbControl.cs b/JexusManager.Breadcrumb/BreadcrumbControl.cs index b09709c7..64f2a6db 100644 --- a/JexusManager.Breadcrumb/BreadcrumbControl.cs +++ b/JexusManager.Breadcrumb/BreadcrumbControl.cs @@ -18,6 +18,28 @@ public class BreadcrumbControl : Control private int _hoveredIndex = -1; private bool _mouseDown = false; private Font _boldFont; + private int _scrollOffset = 0; + private bool _showScrollButtons = false; + private Rectangle _leftScrollButtonRect; + private Rectangle _rightScrollButtonRect; + private bool _leftScrollHovered; + private bool _rightScrollHovered; + + // Fields for textbox mode + private bool _inTextBoxMode = false; + private TextBox _pathTextBox; + private string _pathSeparator = "\\"; + private BorderStyle _borderStyle = BorderStyle.Fixed3D; + + // Fields for context menu + private ContextMenuStrip _contextMenu; + private int _contextMenuSourceIndex = -1; + private bool _showDropdownButtons = true; + private int _dropdownButtonWidth = 16; + private bool _showIconArea = true; + private int _iconSize = 16; + private Rectangle _iconAreaRect; + private bool _showSelectedItemIcon = true; /// /// Occurs when a breadcrumb item is clicked. @@ -29,8 +51,8 @@ public class BreadcrumbControl : Control /// [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int SelectedIndex - { + public int SelectedIndex + { get => _selectedIndex; set { @@ -50,33 +72,177 @@ public int SelectedIndex public List Items => _items; /// - /// Gets or sets the separator character between items. + /// Gets or sets the background color for highlighted items. /// [Category("Appearance")] - [DefaultValue(">")] - public string Separator { get; set; } = ">"; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] + public Color HighlightColor { get; set; } = SystemColors.Highlight; /// - /// Gets or sets the background color for highlighted items. + /// Gets or sets whether horizontal scrolling is enabled. + /// + [Category("Behavior")] + [DefaultValue(true)] + public bool EnableScrolling { get; set; } = true; + + /// + /// Gets or sets the width of the scroll buttons. /// [Category("Appearance")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] - public Color HighlightColor { get; set; } = SystemColors.Highlight; + [DefaultValue(16)] + public int ScrollButtonWidth { get; set; } = 16; + + /// + /// Gets the total width of all items. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int TotalItemsWidth { get; private set; } + + /// + /// Gets or sets the border style for the control. + /// + [Category("Appearance")] + [DefaultValue(BorderStyle.Fixed3D)] + public BorderStyle BorderStyle + { + get => _borderStyle; + set + { + if (_borderStyle != value) + { + _borderStyle = value; + Invalidate(); + } + } + } + + /// + /// Gets or sets the character used to separate path components in text mode. + /// + [Category("Behavior")] + [DefaultValue("\\")] + public string PathSeparator + { + get => _pathSeparator; + set + { + if (value != null && _pathSeparator != value) + { + _pathSeparator = value; + if (_inTextBoxMode && _pathTextBox != null) + { + _pathTextBox.Text = GetFullPath(); + } + } + } + } + + /// + /// Gets or sets whether the control allows entering text mode by clicking on empty areas. + /// + [Category("Behavior")] + [DefaultValue(true)] + public bool AllowTextMode { get; set; } = true; + + /// + /// Gets or sets whether the control is currently in text editing mode. + /// + [Browsable(false)] + public bool IsInTextMode => _inTextBoxMode; + + /// + /// Gets or sets whether to show dropdown buttons for breadcrumb items. + /// + [Category("Behavior")] + [DefaultValue(true)] + public bool ShowDropdownButtons + { + get => _showDropdownButtons; + set + { + if (_showDropdownButtons != value) + { + _showDropdownButtons = value; + Invalidate(); + } + } + } /// - /// Initializes a new instance of the BreadcrumbControl class. + /// Gets or sets the width of the dropdown buttons. /// + [Category("Appearance")] + [DefaultValue(16)] + public int DropdownButtonWidth + { + get => _dropdownButtonWidth; + set + { + if (_dropdownButtonWidth != value && value > 0) + { + _dropdownButtonWidth = value; + Invalidate(); + } + } + } /// + /// Gets or sets whether to show a dedicated icon area on the left. + /// + [Category("Appearance")] + [DefaultValue(true)] + public bool ShowIconArea + { + get => _showIconArea; + set + { + if (_showIconArea != value) + { + _showIconArea = value; + Invalidate(); + } + } + } + + /// + /// Gets or sets the size of icons used in the breadcrumb control. + /// + [Category("Appearance")] + [DefaultValue(16)] + public int IconSize + { + get => _iconSize; + set + { + if (_iconSize != value && value > 0) + { + _iconSize = value; + Invalidate(); + } + } + } + + /// + /// Occurs when the control requests child items for a breadcrumb item. + /// + public event EventHandler ItemChildrenRequested; /// + /// Initializes a new instance of the BreadcrumbControl class. + /// public BreadcrumbControl() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); - + this.BackColor = SystemColors.Window; this.ForeColor = SystemColors.WindowText; - + _boldFont = new Font(this.Font, FontStyle.Bold); + + // Initialize context menu + _contextMenu = new ContextMenuStrip(); + _contextMenu.Opening += ContextMenu_Opening; + _contextMenu.Closed += ContextMenu_Closed; } /// @@ -104,6 +270,21 @@ public BreadcrumbItem AddItem(string text, object tag = null) return item; } + /// + /// Adds a new item to the breadcrumb control. + /// + /// The text of the item. + /// The tag object associated with the item. + /// The icon to display for this item. + /// The newly added BreadcrumbItem. + public BreadcrumbItem AddItem(string text, object tag = null, Image icon = null) + { + var item = new BreadcrumbItem(text, tag, icon); + _items.Add(item); + Invalidate(); + return item; + } + /// /// Removes the last item from the breadcrumb control. /// @@ -130,30 +311,108 @@ protected override void Dispose(bool disposing) _boldFont?.Dispose(); } base.Dispose(disposing); - } - - /// - /// Raises the Paint event. - /// + } /// + /// Raises the Paint event. + /// protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); - + Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; - - // Track locations and widths for hit testing + + // If in text mode, we don't draw breadcrumb items + if (_inTextBoxMode) + { + // Just draw the border + DrawBorder(g); + return; + } + + int availableWidth = Width - Padding.Horizontal; + int contentWidth = MeasureTotalItemsWidth(g); + TotalItemsWidth = contentWidth; + + // Determine if we need to show scroll buttons + _showScrollButtons = EnableScrolling && contentWidth > availableWidth; + + // Adjust available width if scroll buttons are visible + if (_showScrollButtons) + { + availableWidth -= ScrollButtonWidth * 2; + } + + // Ensure scroll offset is within valid range + if (_scrollOffset < 0) + { + _scrollOffset = 0; + } + else if (_scrollOffset > Math.Max(0, contentWidth - availableWidth)) + { + _scrollOffset = Math.Max(0, contentWidth - availableWidth); + } + + // Draw scroll buttons if needed + if (_showScrollButtons) + { + DrawScrollButtons(g); + } + // Calculate starting x position int x = Padding.Left; - + + // Add space for icon area if enabled + int iconAreaWidth = 0; + if (_showIconArea && _selectedIndex >= 0 && _selectedIndex < _items.Count && _items[_selectedIndex].Icon != null) + { + iconAreaWidth = IconSize + 8; // Icon width plus padding + + // Draw icon area with subtle separator + _iconAreaRect = new Rectangle(x, 0, iconAreaWidth, Height); + + // Draw a light background for the icon area + using (Brush iconAreaBrush = new SolidBrush(Color.FromArgb(20, SystemColors.ControlDark))) + { + g.FillRectangle(iconAreaBrush, _iconAreaRect); + } + + // Draw a subtle separator line + using (Pen separatorPen = new Pen(Color.FromArgb(100, SystemColors.ControlDark))) + { + g.DrawLine(separatorPen, + x + iconAreaWidth - 1, 0, + x + iconAreaWidth - 1, Height); + } + + // Draw the icon centered in the icon area + if (_items[_selectedIndex].Icon != null) + { + int iconX = x + (iconAreaWidth - IconSize) / 2; + int iconY = (Height - IconSize) / 2; + g.DrawImage(_items[_selectedIndex].Icon, new Rectangle(iconX, iconY, IconSize, IconSize)); + } + + // Update starting position for breadcrumb items + x += iconAreaWidth; + } + + if (_showScrollButtons) + { + x += ScrollButtonWidth; + } + + // Apply scroll offset + x -= _scrollOffset; + + // Draw items for (int i = 0; i < _items.Count; i++) { BreadcrumbItem item = _items[i]; - + // Determine font and colors based on state Font itemFont = i == _selectedIndex ? _boldFont : Font; Color textColor = ForeColor; Brush backgroundBrush = null; - + if (i == _hoveredIndex) { backgroundBrush = new SolidBrush(Color.FromArgb(40, HighlightColor)); @@ -162,45 +421,264 @@ protected override void OnPaint(PaintEventArgs e) backgroundBrush = new SolidBrush(Color.FromArgb(70, HighlightColor)); } } - + // Measure text SizeF textSize = g.MeasureString(item.Text, itemFont); - int itemWidth = (int)Math.Ceiling(textSize.Width) + 10; // Add padding + + // Add extra width for dropdown button if needed + int dropdownButtonSpace = (_showDropdownButtons) ? DropdownButtonWidth : 0; + + // Add space for icon if this is the selected item and ShowSelectedItemIcon is true + int iconSpace = 0; + if (i == _selectedIndex && _showSelectedItemIcon && item.Icon != null) + { + iconSpace = IconSize + 4; // Icon width plus a little padding + } + + int itemWidth = (int)Math.Ceiling(textSize.Width) + 10 + dropdownButtonSpace + iconSpace; // Add padding int itemHeight = (int)Math.Ceiling(textSize.Height) + 4; // Add padding - - // Set the item's bounds for hit testing - item.Bounds = new Rectangle(x, (Height - itemHeight) / 2, itemWidth, itemHeight); - - // Draw background if hovered/selected - if (backgroundBrush != null) - { - using (GraphicsPath path = RoundedRectangle(item.Bounds, 3)) + + // Calculate the bounds for this item + Rectangle itemBounds = new Rectangle(x, (Height - itemHeight) / 2, itemWidth, itemHeight); + item.Bounds = itemBounds; + + // Calculate dropdown button bounds if needed + if (_showDropdownButtons) + { + item.DropdownButtonBounds = new Rectangle( + itemBounds.Right - DropdownButtonWidth - 2, + itemBounds.Y, + DropdownButtonWidth, + itemBounds.Height); + } + + // Check if item is at least partially visible + if (itemBounds.Right > Padding.Left + (_showScrollButtons ? ScrollButtonWidth : 0) && + itemBounds.Left < Width - Padding.Right - (_showScrollButtons ? ScrollButtonWidth : 0)) + { + // Draw background if hovered/selected + if (backgroundBrush != null) { - g.FillPath(backgroundBrush, path); + // Make sure we clip to visible area + Rectangle visibleBounds = Rectangle.Intersect(itemBounds, + new Rectangle( + Padding.Left + (_showScrollButtons ? ScrollButtonWidth : 0), + 0, + Width - Padding.Horizontal - (_showScrollButtons ? ScrollButtonWidth * 2 : 0), + Height)); + + if (!visibleBounds.IsEmpty) + { + using GraphicsPath path = RoundedRectangle(visibleBounds, 3); + g.FillPath(backgroundBrush, path); + } + + backgroundBrush.Dispose(); } - backgroundBrush.Dispose(); - } - - // Draw text - using (Brush textBrush = new SolidBrush(textColor)) + + // Create a clipping region to avoid drawing outside visible area + Rectangle clipRect = new Rectangle( + Padding.Left + (_showScrollButtons ? ScrollButtonWidth : 0), + 0, + Width - Padding.Horizontal - (_showScrollButtons ? ScrollButtonWidth * 2 : 0), + Height); + + Region oldClip = g.Clip; + g.Clip = new Region(clipRect); // Set initial text position - no more inline icon drawing as we have dedicated icon area + int textX = x + 5; + + // Draw text + using (Brush textBrush = new SolidBrush(textColor)) + { + g.DrawString(item.Text, itemFont, textBrush, + textX, (Height - textSize.Height) / 2); + } // Draw dropdown button if enabled + if (_showDropdownButtons) + { + // Draw a small solid triangle dropdown indicator + int arrowX = itemBounds.Right - DropdownButtonWidth / 2 - 2; + int arrowY = itemBounds.Y + itemBounds.Height / 2; + int arrowSize = 4; + + Point[] trianglePoints = new Point[] + { + new Point(arrowX - arrowSize, arrowY - arrowSize), + new Point(arrowX, arrowY), + new Point(arrowX - arrowSize, arrowY + arrowSize) + }; + + using Brush triangleBrush = new SolidBrush(Color.FromArgb(180, textColor)); + g.FillPolygon(triangleBrush, trianglePoints); + } + + g.Clip = oldClip; + } // Update x position + x += itemWidth; + } + + // Draw the border + DrawBorder(g); + } + + /// + /// Draws the border around the control. + /// + private void DrawBorder(Graphics g) + { + if (_borderStyle == BorderStyle.None) + return; + + Color borderColor = SystemColors.ControlDark; + Rectangle borderRect = new Rectangle(0, 0, Width - 1, Height - 1); + + // Draw the appropriate border style + if (_borderStyle == BorderStyle.FixedSingle) + { + using Pen borderPen = new Pen(borderColor); + g.DrawRectangle(borderPen, borderRect); + } + else if (_borderStyle == BorderStyle.Fixed3D) + { + // Draw 3D border + using (Pen outerPen = new Pen(SystemColors.ControlDark)) { - g.DrawString(item.Text, itemFont, textBrush, - x + 5, (Height - textSize.Height) / 2); + g.DrawRectangle(outerPen, borderRect); } - - // Update x position - x += itemWidth; - - // Draw separator if not the last item - if (i < _items.Count - 1) + + using Pen innerPen = new Pen(SystemColors.ControlLightLight); + Rectangle innerRect = new Rectangle(1, 1, Width - 3, Height - 3); + g.DrawRectangle(innerPen, innerRect); + } + } + /// + /// Draws the left and right scroll buttons when scrolling is active. + /// + private void DrawScrollButtons(Graphics g) + { + int buttonSize = ScrollButtonWidth; + int yCenter = Height / 2; + + // Left scroll button + _leftScrollButtonRect = new Rectangle(Padding.Left, 0, buttonSize, Height); + bool leftEnabled = _scrollOffset > 0; + + // Right scroll button + _rightScrollButtonRect = new Rectangle(Width - Padding.Right - buttonSize, 0, buttonSize, Height); + bool rightEnabled = _scrollOffset < Math.Max(0, TotalItemsWidth - (Width - Padding.Horizontal - buttonSize * 2)); + + // Draw left button + Color leftBgColor = _leftScrollHovered + ? Color.FromArgb(leftEnabled ? 100 : 50, HighlightColor) + : Color.FromArgb(leftEnabled ? 60 : 30, SystemColors.ControlDark); + + Color leftArrowColor = leftEnabled + ? ForeColor + : Color.FromArgb(120, SystemColors.ControlDark); + + using (Brush bgBrush = new SolidBrush(leftBgColor)) + { + // Draw a rounded rectangle for the left button background + using GraphicsPath path = RoundedRectangle(new Rectangle( + _leftScrollButtonRect.X, + (_leftScrollButtonRect.Height - _leftScrollButtonRect.Width) / 2, + _leftScrollButtonRect.Width, + _leftScrollButtonRect.Width), 3); + g.FillPath(bgBrush, path); + + // Add a subtle border + using Pen borderPen = new Pen(Color.FromArgb(30, SystemColors.ControlDarkDark)); + g.DrawPath(borderPen, path); + } + + // Draw right button + Color rightBgColor = _rightScrollHovered + ? Color.FromArgb(rightEnabled ? 100 : 50, HighlightColor) + : Color.FromArgb(rightEnabled ? 60 : 30, SystemColors.ControlDark); + + Color rightArrowColor = rightEnabled + ? ForeColor + : Color.FromArgb(120, SystemColors.ControlDark); + + using (Brush bgBrush = new SolidBrush(rightBgColor)) + { + // Draw a rounded rectangle for the right button background + using GraphicsPath path = RoundedRectangle(new Rectangle( + _rightScrollButtonRect.X, + (_rightScrollButtonRect.Height - _rightScrollButtonRect.Width) / 2, + _rightScrollButtonRect.Width, + _rightScrollButtonRect.Width), 3); + g.FillPath(bgBrush, path); + + // Add a subtle border + using Pen borderPen = new Pen(Color.FromArgb(30, SystemColors.ControlDarkDark)); + g.DrawPath(borderPen, path); + } + + // Draw left arrow with a more distinct appearance + using (Pen arrowPen = new Pen(leftArrowColor, 2.0f)) + { + int centerX = _leftScrollButtonRect.X + _leftScrollButtonRect.Width / 2; + int centerY = Height / 2; + int arrowSize = 4; + + // Draw a left-pointing triangle + Point[] arrowPoints = new Point[] + { + new Point(centerX + arrowSize, centerY - arrowSize), + new Point(centerX - arrowSize, centerY), + new Point(centerX + arrowSize, centerY + arrowSize) + }; + + g.DrawLines(arrowPen, arrowPoints); + } + + // Draw right arrow with a more distinct appearance + using (Pen arrowPen = new Pen(rightArrowColor, 2.0f)) + { + int centerX = _rightScrollButtonRect.X + _rightScrollButtonRect.Width / 2; + int centerY = Height / 2; + int arrowSize = 4; + + // Draw a right-pointing triangle + Point[] arrowPoints = new Point[] + { + new Point(centerX - arrowSize, centerY - arrowSize), + new Point(centerX + arrowSize, centerY), + new Point(centerX - arrowSize, centerY + arrowSize) + }; + + g.DrawLines(arrowPen, arrowPoints); + } + } + + /// + /// Measures the total width required to display all items. + /// + private int MeasureTotalItemsWidth(Graphics g) + { + int totalWidth = 0; + + for (int i = 0; i < _items.Count; i++) + { + // Measure item + Font itemFont = i == _selectedIndex ? _boldFont : Font; + SizeF textSize = g.MeasureString(_items[i].Text, itemFont); + + // Add extra width for dropdown button if needed + int dropdownButtonSpace = (_showDropdownButtons) ? DropdownButtonWidth : 0; + // Add space for icon if this is the first item and ShowFirstItemIcon is true + int iconSpace = 0; + if (i == 0 && _showSelectedItemIcon && _items[i].Icon != null) { - using Brush separatorBrush = new SolidBrush(Color.FromArgb(180, ForeColor)); - SizeF sepSize = g.MeasureString(Separator, Font); - g.DrawString(Separator, Font, separatorBrush, - x + 2, (Height - sepSize.Height) / 2); - x += (int)Math.Ceiling(sepSize.Width) + 6; + iconSpace = IconSize + 4; // Icon width plus a little padding } + + int itemWidth = (int)Math.Ceiling(textSize.Width) + 10 + dropdownButtonSpace + iconSpace; // Add padding + + totalWidth += itemWidth; } + + return totalWidth; } /// @@ -229,31 +707,56 @@ private GraphicsPath RoundedRectangle(Rectangle bounds, int radius) path.CloseFigure(); return path; - } - - /// - /// Raises the MouseMove event. - /// + } /// + /// Raises the MouseMove event. + /// protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); - + + // Check if hovering over scroll buttons + bool oldLeftHovered = _leftScrollHovered; + bool oldRightHovered = _rightScrollHovered; + + _leftScrollHovered = _showScrollButtons && _leftScrollButtonRect.Contains(e.Location); + _rightScrollHovered = _showScrollButtons && _rightScrollButtonRect.Contains(e.Location); + + // Only check for item hovering if not hovering over scroll buttons int oldHoveredIndex = _hoveredIndex; _hoveredIndex = -1; - - for (int i = 0; i < _items.Count; i++) + + if (!_leftScrollHovered && !_rightScrollHovered) { - if (_items[i].Bounds.Contains(e.Location)) + for (int i = 0; i < _items.Count; i++) { - _hoveredIndex = i; - break; + if (_items[i].Bounds.Contains(e.Location)) + { + _hoveredIndex = i; + break; + } } } - - if (oldHoveredIndex != _hoveredIndex) + + // Check if we need to repaint + if (oldHoveredIndex != _hoveredIndex || + oldLeftHovered != _leftScrollHovered || + oldRightHovered != _rightScrollHovered) { Invalidate(); - Cursor = _hoveredIndex >= 0 ? Cursors.Hand : Cursors.Default; + } + + // Update cursor + if (_hoveredIndex >= 0) + { + Cursor = Cursors.Hand; + } + else if (_leftScrollHovered || _rightScrollHovered) + { + Cursor = Cursors.Hand; + } + else + { + Cursor = Cursors.Default; } } @@ -266,24 +769,57 @@ protected override void OnMouseDown(MouseEventArgs e) if (e.Button == MouseButtons.Left) { _mouseDown = true; + + // Check for scroll button clicks + if (_leftScrollHovered) + { + ScrollLeft(); + } + else if (_rightScrollHovered) + { + ScrollRight(); + } + Invalidate(); } - } - - /// - /// Raises the MouseUp event. - /// + } /// + /// Raises the MouseUp event. + /// protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == MouseButtons.Left) { _mouseDown = false; - if (_hoveredIndex >= 0) + + // Only process clicks when not in text mode + if (!_inTextBoxMode) { - _selectedIndex = _hoveredIndex; - ItemClicked?.Invoke(this, new BreadcrumbItemClickedEventArgs(_items[_hoveredIndex], _hoveredIndex)); + // If clicking on scroll buttons, they're handled in MouseDown + if (_hoveredIndex >= 0 && !_leftScrollHovered && !_rightScrollHovered) + { + BreadcrumbItem item = _items[_hoveredIndex]; + + // Check if click was on dropdown button + if (_showDropdownButtons && item.DropdownButtonBounds.Contains(e.Location)) + { + // Show the dropdown context menu + ShowDropdownMenu(_hoveredIndex, item.DropdownButtonBounds); + } + else + { + // Normal item click + _selectedIndex = _hoveredIndex; + ItemClicked?.Invoke(this, new BreadcrumbItemClickedEventArgs(item, _hoveredIndex)); + } + } + else if (!_leftScrollHovered && !_rightScrollHovered && AllowTextMode) + { + // Click on empty area - enter text mode + EnterTextMode(); + } } + Invalidate(); } } @@ -294,12 +830,382 @@ protected override void OnMouseUp(MouseEventArgs e) protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); - if (_hoveredIndex >= 0) + + bool needsInvalidate = _hoveredIndex >= 0 || _leftScrollHovered || _rightScrollHovered; + + _hoveredIndex = -1; + _leftScrollHovered = false; + _rightScrollHovered = false; + + if (needsInvalidate) { - _hoveredIndex = -1; Invalidate(); } + Cursor = Cursors.Default; } + + /// + /// Scrolls the items to the left (revealing items on the right). + /// + public void ScrollRight() + { + if (_showScrollButtons) + { + int visibleWidth = Width - Padding.Horizontal - (ScrollButtonWidth * 2); + _scrollOffset += Math.Min(visibleWidth / 2, 50); // Scroll by half the visible area or 50px, whichever is smaller + + // Make sure we don't scroll too far + int maxOffset = Math.Max(0, TotalItemsWidth - visibleWidth); + if (_scrollOffset > maxOffset) + { + _scrollOffset = maxOffset; + } + + Invalidate(); + } + } + + /// + /// Scrolls the items to the right (revealing items on the left). + /// + public void ScrollLeft() + { + if (_showScrollButtons) + { + int visibleWidth = Width - Padding.Horizontal - (ScrollButtonWidth * 2); + _scrollOffset -= Math.Min(visibleWidth / 2, 50); // Scroll by half the visible area or 50px, whichever is smaller + + // Make sure we don't scroll too far + if (_scrollOffset < 0) + { + _scrollOffset = 0; + } + + Invalidate(); + } + } + + /// + /// Ensures the specified item is visible in the current view. + /// + /// The index of the item to scroll into view. + public void EnsureVisible(int index) + { + if (index < 0 || index >= _items.Count || !_showScrollButtons) + return; + + BreadcrumbItem item = _items[index]; + + // Calculate visible area + int visibleLeft = Padding.Left + ScrollButtonWidth; + int visibleWidth = Width - Padding.Horizontal - (ScrollButtonWidth * 2); + int visibleRight = visibleLeft + visibleWidth; + + // Calculate item's current position + int itemLeft = item.Bounds.Left + _scrollOffset; + int itemRight = item.Bounds.Right + _scrollOffset; + + // If item is to the left of visible area, scroll left + if (itemLeft < visibleLeft) + { + _scrollOffset = itemLeft - Padding.Left - ScrollButtonWidth; + } + // If item is to the right of visible area, scroll right + else if (itemRight > visibleRight) + { + _scrollOffset = itemRight - visibleWidth - Padding.Left - ScrollButtonWidth; + } + + // Ensure scroll offset is within valid range + if (_scrollOffset < 0) + { + _scrollOffset = 0; + } + else + { + int maxOffset = Math.Max(0, TotalItemsWidth - visibleWidth); + if (_scrollOffset > maxOffset) + { + _scrollOffset = maxOffset; + } + } + + Invalidate(); + } + + /// + /// Gets the full path representation of the breadcrumb items. + /// + /// A string representing the full path. + public string GetFullPath() + { + if (_items.Count == 0) + return string.Empty; + + string path = string.Empty; + + for (int i = 0; i < _items.Count; i++) + { + path += _items[i].Text; + + if (i < _items.Count - 1) + { + path += PathSeparator; + } + } + + return path; + } + + /// + /// Enters text editing mode. + /// + public void EnterTextMode() + { + if (_inTextBoxMode || !AllowTextMode) + return; + + _inTextBoxMode = true; + + // Create the text box if it doesn't exist + if (_pathTextBox == null) + { + _pathTextBox = new TextBox(); + _pathTextBox.BorderStyle = BorderStyle.None; + _pathTextBox.Font = this.Font; + _pathTextBox.KeyDown += PathTextBox_KeyDown; + _pathTextBox.LostFocus += PathTextBox_LostFocus; + Controls.Add(_pathTextBox); + } + + // Set initial path text + _pathTextBox.Text = GetFullPath(); + + // Position and size the text box + _pathTextBox.Location = new Point(Padding.Left + 3, (Height - _pathTextBox.Height) / 2); + _pathTextBox.Width = Width - Padding.Horizontal - 6; + _pathTextBox.Visible = true; + _pathTextBox.BringToFront(); + _pathTextBox.Focus(); + _pathTextBox.SelectAll(); + + Invalidate(); + } + + /// + /// Exits text editing mode. + /// + /// Whether to apply any changes made in the text box. + public void ExitTextMode(bool applyChanges) + { + if (!_inTextBoxMode) + return; + + _inTextBoxMode = false; + + if (_pathTextBox != null) + { + if (applyChanges) + { + TryNavigateToPath(_pathTextBox.Text); + } + + _pathTextBox.Visible = false; + } + + Invalidate(); + } + + /// + /// Tries to navigate to the specified path. + /// + /// The path to navigate to. + /// True if navigation was successful, false otherwise. + public bool TryNavigateToPath(string path) + { + if (string.IsNullOrEmpty(path)) + return false; + + // Split the path into segments + string[] segments = path.Split(new[] { PathSeparator }, StringSplitOptions.None); + + // Validate segments against current items + bool validPath = true; + int matchedSegments = 0; + + for (int i = 0; i < segments.Length && i < _items.Count; i++) + { + if (segments[i] != _items[i].Text) + { + validPath = false; + break; + } + + matchedSegments++; + } + + // If path starts with valid segments but has more segments than current path, + // we could potentially extend the path (but we won't here, just consider it valid) + if (validPath && matchedSegments == _items.Count && segments.Length > _items.Count) + { + // Path is valid but has additional segments we don't have navigation for + // For this implementation, we'll consider this invalid + validPath = false; + } + + // If path is valid but shorter than current path, truncate current path + if (validPath && matchedSegments < _items.Count) + { + while (_items.Count > matchedSegments) + { + _items.RemoveAt(_items.Count - 1); + } + + if (_items.Count > 0) + { + _selectedIndex = _items.Count - 1; + ItemClicked?.Invoke(this, new BreadcrumbItemClickedEventArgs(_items[_selectedIndex], _selectedIndex)); + } + else + { + _selectedIndex = -1; + } + } + + return validPath; + } + + private void PathTextBox_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + ExitTextMode(true); + e.SuppressKeyPress = true; + e.Handled = true; + } + else if (e.KeyCode == Keys.Escape) + { + ExitTextMode(false); + e.SuppressKeyPress = true; + e.Handled = true; + } + } + + private void PathTextBox_LostFocus(object sender, EventArgs e) + { + // Exit text mode when focus is lost + BeginInvoke(new Action(() => ExitTextMode(false))); + } + + /// + /// Shows the dropdown menu for a breadcrumb item. + /// + /// The index of the item to show the dropdown for. + /// The bounds of the dropdown button. + private void ShowDropdownMenu(int itemIndex, Rectangle dropdownButtonBounds) + { + if (itemIndex < 0 || itemIndex >= _items.Count) + return; + + // Set the current context menu source + _contextMenuSourceIndex = itemIndex; + + // Position the context menu + Point menuLocation = PointToScreen(new Point( + dropdownButtonBounds.Right - dropdownButtonBounds.Width, + dropdownButtonBounds.Bottom)); + + // Show the context menu + _contextMenu.Show(menuLocation); + } + + /// + /// Handles the Opening event of the context menu. + /// + private void ContextMenu_Opening(object sender, CancelEventArgs e) + { + // Clear existing items + _contextMenu.Items.Clear(); + + if (_contextMenuSourceIndex < 0 || _contextMenuSourceIndex >= _items.Count) + { + e.Cancel = true; + return; + } + + BreadcrumbItem sourceItem = _items[_contextMenuSourceIndex]; + + // Check if the item has any child items + if (sourceItem.ChildItems.Count == 0) + { + // Raise event to request child items + ItemChildrenRequested?.Invoke(this, new BreadcrumbItemEventArgs(sourceItem, _contextMenuSourceIndex)); + } + + // If there are still no child items, cancel the menu + if (sourceItem.ChildItems.Count == 0) + { + e.Cancel = true; + return; + } + + // Add items to the context menu + foreach (BreadcrumbItem childItem in sourceItem.ChildItems) + { + ToolStripMenuItem menuItem = new ToolStripMenuItem(childItem.Text); + + // Set the tag to the child item for reference + menuItem.Tag = childItem; + + // Add an icon if available + if (childItem.Icon != null) + { + menuItem.Image = childItem.Icon; + } + + // Handle click event + menuItem.Click += DropdownMenuItem_Click; + + // Add to the menu + _contextMenu.Items.Add(menuItem); + } + } + + /// + /// Handles the Closed event of the context menu. + /// + private void ContextMenu_Closed(object sender, ToolStripDropDownClosedEventArgs e) + { + _contextMenuSourceIndex = -1; + } + + /// + /// Handles the Click event of a dropdown menu item. + /// + private void DropdownMenuItem_Click(object sender, EventArgs e) + { + if (sender is ToolStripMenuItem menuItem && menuItem.Tag is BreadcrumbItem selectedChildItem) + { + // If we're not at the end of the breadcrumb, trim the trail + if (_contextMenuSourceIndex < _items.Count - 1) + { + while (_items.Count > _contextMenuSourceIndex + 1) + { + _items.RemoveAt(_items.Count - 1); + } + } + + // Add the selected child item to the breadcrumb + _items.Add(selectedChildItem); + _selectedIndex = _items.Count - 1; + + // Notify of navigation + ItemClicked?.Invoke(this, new BreadcrumbItemClickedEventArgs(selectedChildItem, _selectedIndex)); + + // Redraw + Invalidate(); + } + } } } diff --git a/JexusManager.Breadcrumb/BreadcrumbItem.cs b/JexusManager.Breadcrumb/BreadcrumbItem.cs index a38bfd15..98b88663 100644 --- a/JexusManager.Breadcrumb/BreadcrumbItem.cs +++ b/JexusManager.Breadcrumb/BreadcrumbItem.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Drawing; namespace JexusManager.Breadcrumb @@ -17,20 +18,35 @@ public class BreadcrumbItem /// public object? Tag { get; set; } + /// + /// Gets or sets the icon associated with this breadcrumb item. + /// + public Image? Icon { get; set; } + + /// + /// Gets the collection of child items for this breadcrumb item. + /// + public List ChildItems { get; } = new List(); + /// /// Gets or sets the bounds rectangle for this item. /// internal Rectangle Bounds { get; set; } /// - /// Initializes a new instance of the BreadcrumbItem class. + /// Gets or sets the bounds of the dropdown arrow button. /// - /// The display text of the breadcrumb item. - /// The tag object associated with this breadcrumb item. - public BreadcrumbItem(string text, object? tag = null) + internal Rectangle DropdownButtonBounds { get; set; } /// + /// Initializes a new instance of the BreadcrumbItem class. + /// + /// The display text of the breadcrumb item. + /// The tag object associated with this breadcrumb item. + /// The icon associated with this breadcrumb item. + public BreadcrumbItem(string text, object? tag = null, Image? icon = null) { Text = text; Tag = tag; + Icon = icon; } /// diff --git a/JexusManager.Breadcrumb/BreadcrumbItemEventArgs.cs b/JexusManager.Breadcrumb/BreadcrumbItemEventArgs.cs new file mode 100644 index 00000000..e26fcc36 --- /dev/null +++ b/JexusManager.Breadcrumb/BreadcrumbItemEventArgs.cs @@ -0,0 +1,31 @@ +using System; + +namespace JexusManager.Breadcrumb +{ + /// + /// Provides data for the BreadcrumbControl.ItemChildrenRequested event. + /// + public class BreadcrumbItemEventArgs : EventArgs + { + /// + /// Gets the BreadcrumbItem for which children are requested. + /// + public BreadcrumbItem Item { get; } + + /// + /// Gets the index of the BreadcrumbItem in the breadcrumb trail. + /// + public int Index { get; } + + /// + /// Initializes a new instance of the BreadcrumbItemEventArgs class. + /// + /// The BreadcrumbItem for which children are requested. + /// The index of the BreadcrumbItem in the breadcrumb trail. + public BreadcrumbItemEventArgs(BreadcrumbItem item, int index) + { + Item = item; + Index = index; + } + } +} diff --git a/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs b/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs index 57a1e899..23dd9b04 100644 --- a/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs +++ b/JexusManager.Breadcrumb/ToolStripBreadcrumbItem.cs @@ -13,21 +13,29 @@ public class ToolStripBreadcrumbItem : ToolStripControlHost /// /// Gets the underlying BreadcrumbControl being hosted. /// - public BreadcrumbControl BreadcrumbControl => Control as BreadcrumbControl; - - /// - /// Initializes a new instance of the ToolStripBreadcrumbItem class. - /// + public BreadcrumbControl BreadcrumbControl => Control as BreadcrumbControl; /// + /// Initializes a new instance of the ToolStripBreadcrumbItem class. + /// public ToolStripBreadcrumbItem() : base(CreateControlInstance()) { // Set default appearance AutoSize = false; - } private static Control CreateControlInstance() + + // Set a minimum width to ensure the breadcrumb is visible + Width = 200; + + // Adjust layout + Padding = new Padding(2); + Margin = new Padding(0, 1, 0, 2); + } + private static Control CreateControlInstance() { return new BreadcrumbControl { Margin = new Padding(0), - Padding = new Padding(0) + Padding = new Padding(0), + Dock = DockStyle.Fill, + Height = 22 // Set an explicit height to ensure visibility }; } @@ -49,17 +57,6 @@ public int SelectedIndex [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public System.Collections.Generic.List Items => BreadcrumbControl.Items; - /// - /// Gets or sets the separator character between items. - /// - [Category("Appearance")] - [DefaultValue(">")] - public string Separator - { - get => BreadcrumbControl.Separator; - set => BreadcrumbControl.Separator = value; - } - /// /// Gets or sets the background color for highlighted items. /// @@ -69,11 +66,9 @@ public Color HighlightColor { get => BreadcrumbControl.HighlightColor; set => BreadcrumbControl.HighlightColor = value; - } - - /// - /// Subscribes to events from the hosted control. - /// + } /// + /// Subscribes to events from the hosted control. + /// protected override void OnSubscribeControlEvents(Control control) { base.OnSubscribeControlEvents(control); @@ -99,7 +94,7 @@ protected override void OnUnsubscribeControlEvents(Control control) } } - // Forward events from the BreadcrumbControl + // Forward events from the BreadcrumbControl // Forward events from the BreadcrumbControl private void BreadcrumbControl_ItemClicked(object sender, BreadcrumbItemClickedEventArgs e) { ItemClicked?.Invoke(this, e); From 500938404cec9772ee4004a331d2bfb7e3af13af Mon Sep 17 00:00:00 2001 From: Lex Li Date: Sat, 12 Apr 2025 23:23:16 -0400 Subject: [PATCH 3/5] Changed minimal Windows version to 10. --- CertificateInstaller/CertificateInstaller.csproj | 2 +- .../JexusManager.BreadCrumb.Demo.csproj | 2 +- JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj | 4 +++- .../JexusManager.Features.Access.csproj | 2 +- JexusManager.Features.Asp/JexusManager.Features.Asp.csproj | 2 +- .../JexusManager.Features.Authentication.csproj | 2 +- .../JexusManager.Features.Authorization.csproj | 2 +- .../JexusManager.Features.Caching.csproj | 2 +- .../JexusManager.Features.Certificates.csproj | 2 +- JexusManager.Features.Cgi/JexusManager.Features.Cgi.csproj | 2 +- .../JexusManager.Features.Compression.csproj | 2 +- .../JexusManager.Features.DefaultDocument.csproj | 2 +- .../JexusManager.Features.DirectoryBrowse.csproj | 2 +- .../JexusManager.Features.FastCgi.csproj | 2 +- .../JexusManager.Features.Handlers.csproj | 2 +- .../JexusManager.Features.HttpApi.csproj | 2 +- .../JexusManager.Features.HttpErrors.csproj | 2 +- .../JexusManager.Features.HttpRedirect.csproj | 2 +- .../JexusManager.Features.IpSecurity.csproj | 2 +- .../JexusManager.Features.IsapiCgiRestriction.csproj | 2 +- .../JexusManager.Features.IsapiFilters.csproj | 2 +- .../JexusManager.Features.Jexus.csproj | 2 +- .../JexusManager.Features.Logging.csproj | 2 +- .../JexusManager.Features.MimeMap.csproj | 2 +- .../JexusManager.Features.Modules.csproj | 2 +- .../JexusManager.Features.RequestFiltering.csproj | 2 +- .../JexusManager.Features.ResponseHeaders.csproj | 2 +- .../JexusManager.Features.Rewrite.csproj | 2 +- .../JexusManager.Features.TraceFailedRequests.csproj | 2 +- JexusManager.Shared/JexusManager.Shared.csproj | 2 +- JexusManager.slnx | 1 + JexusManager/JexusManager.csproj | 3 ++- Microsoft.Web.Administration/CertificateInstallerLocator.cs | 4 ++-- .../Microsoft.Web.Administration.csproj | 2 +- Microsoft.Web.Management/Microsoft.Web.Management.csproj | 4 ++-- Tests.JexusManager/Tests.JexusManager.csproj | 2 +- Tests/Tests.csproj | 2 +- 37 files changed, 42 insertions(+), 38 deletions(-) diff --git a/CertificateInstaller/CertificateInstaller.csproj b/CertificateInstaller/CertificateInstaller.csproj index a343ce0e..2d2a06a3 100644 --- a/CertificateInstaller/CertificateInstaller.csproj +++ b/CertificateInstaller/CertificateInstaller.csproj @@ -7,7 +7,7 @@ CertificateInstaller true ..\JexusManager\JexusManager.snk - net9.0-windows + net9.0-windows10.0.17763.0 app.manifest diff --git a/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj b/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj index 738d1700..b28b9813 100644 --- a/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj +++ b/JexusManager.BreadCrumb.Demo/JexusManager.BreadCrumb.Demo.csproj @@ -1,7 +1,7 @@ - net9.0-windows + net9.0-windows10.0.17763.0 true WinExe JexusManager.BreadCrumb.Demo diff --git a/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj b/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj index 8a0ace73..f57d5146 100644 --- a/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj +++ b/JexusManager.Breadcrumb/JexusManager.Breadcrumb.csproj @@ -1,12 +1,14 @@ - net9.0-windows + net462;net9.0-windows10.0.17763.0 true true ..\JexusManager\JexusManager.snk JexusManager.Breadcrumb enable + latest + True diff --git a/JexusManager.Features.Access/JexusManager.Features.Access.csproj b/JexusManager.Features.Access/JexusManager.Features.Access.csproj index 2b235ffd..6a05a6bd 100644 --- a/JexusManager.Features.Access/JexusManager.Features.Access.csproj +++ b/JexusManager.Features.Access/JexusManager.Features.Access.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Asp/JexusManager.Features.Asp.csproj b/JexusManager.Features.Asp/JexusManager.Features.Asp.csproj index 01f96cb2..3750e241 100644 --- a/JexusManager.Features.Asp/JexusManager.Features.Asp.csproj +++ b/JexusManager.Features.Asp/JexusManager.Features.Asp.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Authentication/JexusManager.Features.Authentication.csproj b/JexusManager.Features.Authentication/JexusManager.Features.Authentication.csproj index 69868045..5b9b3106 100644 --- a/JexusManager.Features.Authentication/JexusManager.Features.Authentication.csproj +++ b/JexusManager.Features.Authentication/JexusManager.Features.Authentication.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Authorization/JexusManager.Features.Authorization.csproj b/JexusManager.Features.Authorization/JexusManager.Features.Authorization.csproj index 04f2c6b8..5d4853d3 100644 --- a/JexusManager.Features.Authorization/JexusManager.Features.Authorization.csproj +++ b/JexusManager.Features.Authorization/JexusManager.Features.Authorization.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Caching/JexusManager.Features.Caching.csproj b/JexusManager.Features.Caching/JexusManager.Features.Caching.csproj index abf55457..27e23989 100644 --- a/JexusManager.Features.Caching/JexusManager.Features.Caching.csproj +++ b/JexusManager.Features.Caching/JexusManager.Features.Caching.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Certificates/JexusManager.Features.Certificates.csproj b/JexusManager.Features.Certificates/JexusManager.Features.Certificates.csproj index 33243965..fae013c1 100644 --- a/JexusManager.Features.Certificates/JexusManager.Features.Certificates.csproj +++ b/JexusManager.Features.Certificates/JexusManager.Features.Certificates.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Cgi/JexusManager.Features.Cgi.csproj b/JexusManager.Features.Cgi/JexusManager.Features.Cgi.csproj index af4392d1..82fa4180 100644 --- a/JexusManager.Features.Cgi/JexusManager.Features.Cgi.csproj +++ b/JexusManager.Features.Cgi/JexusManager.Features.Cgi.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Compression/JexusManager.Features.Compression.csproj b/JexusManager.Features.Compression/JexusManager.Features.Compression.csproj index 489134a7..eb707424 100644 --- a/JexusManager.Features.Compression/JexusManager.Features.Compression.csproj +++ b/JexusManager.Features.Compression/JexusManager.Features.Compression.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.DefaultDocument/JexusManager.Features.DefaultDocument.csproj b/JexusManager.Features.DefaultDocument/JexusManager.Features.DefaultDocument.csproj index 14e6072f..d8a3df68 100644 --- a/JexusManager.Features.DefaultDocument/JexusManager.Features.DefaultDocument.csproj +++ b/JexusManager.Features.DefaultDocument/JexusManager.Features.DefaultDocument.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.DirectoryBrowse/JexusManager.Features.DirectoryBrowse.csproj b/JexusManager.Features.DirectoryBrowse/JexusManager.Features.DirectoryBrowse.csproj index 9bd89b7c..31833a03 100644 --- a/JexusManager.Features.DirectoryBrowse/JexusManager.Features.DirectoryBrowse.csproj +++ b/JexusManager.Features.DirectoryBrowse/JexusManager.Features.DirectoryBrowse.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.FastCgi/JexusManager.Features.FastCgi.csproj b/JexusManager.Features.FastCgi/JexusManager.Features.FastCgi.csproj index 4d90fa37..ecd10aec 100644 --- a/JexusManager.Features.FastCgi/JexusManager.Features.FastCgi.csproj +++ b/JexusManager.Features.FastCgi/JexusManager.Features.FastCgi.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Handlers/JexusManager.Features.Handlers.csproj b/JexusManager.Features.Handlers/JexusManager.Features.Handlers.csproj index c4dd4ab7..f8c67881 100644 --- a/JexusManager.Features.Handlers/JexusManager.Features.Handlers.csproj +++ b/JexusManager.Features.Handlers/JexusManager.Features.Handlers.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.HttpApi/JexusManager.Features.HttpApi.csproj b/JexusManager.Features.HttpApi/JexusManager.Features.HttpApi.csproj index 8c90d4f9..c2b23a94 100644 --- a/JexusManager.Features.HttpApi/JexusManager.Features.HttpApi.csproj +++ b/JexusManager.Features.HttpApi/JexusManager.Features.HttpApi.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.HttpErrors/JexusManager.Features.HttpErrors.csproj b/JexusManager.Features.HttpErrors/JexusManager.Features.HttpErrors.csproj index b3d125fb..913a78e5 100644 --- a/JexusManager.Features.HttpErrors/JexusManager.Features.HttpErrors.csproj +++ b/JexusManager.Features.HttpErrors/JexusManager.Features.HttpErrors.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.HttpRedirect/JexusManager.Features.HttpRedirect.csproj b/JexusManager.Features.HttpRedirect/JexusManager.Features.HttpRedirect.csproj index 242129c1..32543f3a 100644 --- a/JexusManager.Features.HttpRedirect/JexusManager.Features.HttpRedirect.csproj +++ b/JexusManager.Features.HttpRedirect/JexusManager.Features.HttpRedirect.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.IpSecurity/JexusManager.Features.IpSecurity.csproj b/JexusManager.Features.IpSecurity/JexusManager.Features.IpSecurity.csproj index dd113e25..f7783c25 100644 --- a/JexusManager.Features.IpSecurity/JexusManager.Features.IpSecurity.csproj +++ b/JexusManager.Features.IpSecurity/JexusManager.Features.IpSecurity.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.IsapiCgiRestriction/JexusManager.Features.IsapiCgiRestriction.csproj b/JexusManager.Features.IsapiCgiRestriction/JexusManager.Features.IsapiCgiRestriction.csproj index a0cddf20..7e0f7b14 100644 --- a/JexusManager.Features.IsapiCgiRestriction/JexusManager.Features.IsapiCgiRestriction.csproj +++ b/JexusManager.Features.IsapiCgiRestriction/JexusManager.Features.IsapiCgiRestriction.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.IsapiFilters/JexusManager.Features.IsapiFilters.csproj b/JexusManager.Features.IsapiFilters/JexusManager.Features.IsapiFilters.csproj index e46ed872..c90211f5 100644 --- a/JexusManager.Features.IsapiFilters/JexusManager.Features.IsapiFilters.csproj +++ b/JexusManager.Features.IsapiFilters/JexusManager.Features.IsapiFilters.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Jexus/JexusManager.Features.Jexus.csproj b/JexusManager.Features.Jexus/JexusManager.Features.Jexus.csproj index 21698003..e77bc597 100644 --- a/JexusManager.Features.Jexus/JexusManager.Features.Jexus.csproj +++ b/JexusManager.Features.Jexus/JexusManager.Features.Jexus.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Logging/JexusManager.Features.Logging.csproj b/JexusManager.Features.Logging/JexusManager.Features.Logging.csproj index dab66c13..307c3b80 100644 --- a/JexusManager.Features.Logging/JexusManager.Features.Logging.csproj +++ b/JexusManager.Features.Logging/JexusManager.Features.Logging.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.MimeMap/JexusManager.Features.MimeMap.csproj b/JexusManager.Features.MimeMap/JexusManager.Features.MimeMap.csproj index 71910cd7..7f0ad279 100644 --- a/JexusManager.Features.MimeMap/JexusManager.Features.MimeMap.csproj +++ b/JexusManager.Features.MimeMap/JexusManager.Features.MimeMap.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Modules/JexusManager.Features.Modules.csproj b/JexusManager.Features.Modules/JexusManager.Features.Modules.csproj index 67c3d61d..7511d8bd 100644 --- a/JexusManager.Features.Modules/JexusManager.Features.Modules.csproj +++ b/JexusManager.Features.Modules/JexusManager.Features.Modules.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.RequestFiltering/JexusManager.Features.RequestFiltering.csproj b/JexusManager.Features.RequestFiltering/JexusManager.Features.RequestFiltering.csproj index bd1e095f..7a9c2f13 100644 --- a/JexusManager.Features.RequestFiltering/JexusManager.Features.RequestFiltering.csproj +++ b/JexusManager.Features.RequestFiltering/JexusManager.Features.RequestFiltering.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.ResponseHeaders/JexusManager.Features.ResponseHeaders.csproj b/JexusManager.Features.ResponseHeaders/JexusManager.Features.ResponseHeaders.csproj index 38530f49..3f0197b1 100644 --- a/JexusManager.Features.ResponseHeaders/JexusManager.Features.ResponseHeaders.csproj +++ b/JexusManager.Features.ResponseHeaders/JexusManager.Features.ResponseHeaders.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.Rewrite/JexusManager.Features.Rewrite.csproj b/JexusManager.Features.Rewrite/JexusManager.Features.Rewrite.csproj index 3ea19122..9556d0d2 100644 --- a/JexusManager.Features.Rewrite/JexusManager.Features.Rewrite.csproj +++ b/JexusManager.Features.Rewrite/JexusManager.Features.Rewrite.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Features.TraceFailedRequests/JexusManager.Features.TraceFailedRequests.csproj b/JexusManager.Features.TraceFailedRequests/JexusManager.Features.TraceFailedRequests.csproj index e1f39540..358b2d12 100644 --- a/JexusManager.Features.TraceFailedRequests/JexusManager.Features.TraceFailedRequests.csproj +++ b/JexusManager.Features.TraceFailedRequests/JexusManager.Features.TraceFailedRequests.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.Shared/JexusManager.Shared.csproj b/JexusManager.Shared/JexusManager.Shared.csproj index eb1b669c..bf3cea16 100644 --- a/JexusManager.Shared/JexusManager.Shared.csproj +++ b/JexusManager.Shared/JexusManager.Shared.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/JexusManager.slnx b/JexusManager.slnx index da841c50..38c64fcc 100644 --- a/JexusManager.slnx +++ b/JexusManager.slnx @@ -1,6 +1,7 @@ + diff --git a/JexusManager/JexusManager.csproj b/JexusManager/JexusManager.csproj index 51b2c790..67ad5ff4 100644 --- a/JexusManager/JexusManager.csproj +++ b/JexusManager/JexusManager.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true @@ -61,6 +61,7 @@ + diff --git a/Microsoft.Web.Administration/CertificateInstallerLocator.cs b/Microsoft.Web.Administration/CertificateInstallerLocator.cs index 16078ee9..94cab309 100644 --- a/Microsoft.Web.Administration/CertificateInstallerLocator.cs +++ b/Microsoft.Web.Administration/CertificateInstallerLocator.cs @@ -23,13 +23,13 @@ private static string FindMainHelper(string executable) return defaultPath; } - var debugBuild = Path.Combine(Environment.CurrentDirectory, $@"..\..\..\..\CertificateInstaller\bin\Debug\net9.0-windows\{executable}"); + var debugBuild = Path.Combine(Environment.CurrentDirectory, $@"..\..\..\..\CertificateInstaller\bin\Debug\net9.0-windows10.0.17763.0\{executable}"); if (File.Exists(debugBuild)) { return debugBuild; } - var releaseBuild = Path.Combine(Environment.CurrentDirectory, $@"..\..\..\..\CertificateInstaller\bin\Release\net9.0-windows\{executable}"); + var releaseBuild = Path.Combine(Environment.CurrentDirectory, $@"..\..\..\..\CertificateInstaller\bin\Release\net9.0-windows10.0.17763.0\{executable}"); if (File.Exists(releaseBuild)) { return releaseBuild; diff --git a/Microsoft.Web.Administration/Microsoft.Web.Administration.csproj b/Microsoft.Web.Administration/Microsoft.Web.Administration.csproj index f031c570..ff4e1d60 100644 --- a/Microsoft.Web.Administration/Microsoft.Web.Administration.csproj +++ b/Microsoft.Web.Administration/Microsoft.Web.Administration.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/Microsoft.Web.Management/Microsoft.Web.Management.csproj b/Microsoft.Web.Management/Microsoft.Web.Management.csproj index 0398e3b3..63c0f3d3 100644 --- a/Microsoft.Web.Management/Microsoft.Web.Management.csproj +++ b/Microsoft.Web.Management/Microsoft.Web.Management.csproj @@ -1,14 +1,14 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false {17E994B0-5A31-4F79-9796-83A45E87853D} Properties Microsoft.Web.Management Microsoft.Web.Management - net9.0-windows + net9.0-windows10.0.17763.0 diff --git a/Tests.JexusManager/Tests.JexusManager.csproj b/Tests.JexusManager/Tests.JexusManager.csproj index 51a28c6b..983fce08 100644 --- a/Tests.JexusManager/Tests.JexusManager.csproj +++ b/Tests.JexusManager/Tests.JexusManager.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 009af17f..7b7a7fbd 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net9.0-windows10.0.17763.0 true false true From 956e5ef7883f7d4521e3c0b2f6232ec7cfc7de69 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Sun, 13 Apr 2025 04:20:04 -0400 Subject: [PATCH 4/5] Integrated breadcrumb bar in main form. --- CertificateInstaller/Program.cs | 11 +- JexusManager/MainForm.Designer.cs | 486 ++++++++---------- JexusManager/MainForm.cs | 146 +++--- JexusManager/MainForm.resx | 13 +- .../IisExpressServerManager.cs | 2 +- 5 files changed, 296 insertions(+), 362 deletions(-) diff --git a/CertificateInstaller/Program.cs b/CertificateInstaller/Program.cs index 266a8a22..6e3d9cc8 100644 --- a/CertificateInstaller/Program.cs +++ b/CertificateInstaller/Program.cs @@ -206,14 +206,12 @@ int AddCertificate(string p12File, string p12Pwd, string friendlyName, X509Store personal) { - // add certificate - // http://paulstovell.com/blog/x509certificate2 - var x509 = new X509Certificate2( + var x509 = X509CertificateLoader.LoadPkcs12FromFile( p12File, p12Pwd, - X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet - | X509KeyStorageFlags.MachineKeySet) - { FriendlyName = friendlyName }; + X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet + ); + x509.FriendlyName = friendlyName; personal.Add(x509); return 0; } @@ -312,6 +310,7 @@ int QuerySite(string config, string siteId) var command = item.GetCommandLine(); return command != null && command.TrimEnd().EndsWith(toQuery, StringComparison.Ordinal); }); + Log.Debug($"Tried to find {toQuery} with result {found?.Id}"); return found == null ? 0 : found.Id; } diff --git a/JexusManager/MainForm.Designer.cs b/JexusManager/MainForm.Designer.cs index 4aad8d78..e27039c2 100644 --- a/JexusManager/MainForm.Designer.cs +++ b/JexusManager/MainForm.Designer.cs @@ -4,6 +4,7 @@ using System.Windows.Forms; using Crad.Windows.Forms.Actions; + using JexusManager.Breadcrumb; public sealed partial class MainForm { @@ -168,6 +169,9 @@ private void InitializeComponent() toolStripMenuItem47 = new ToolStripMenuItem(); toolStripMenuItem50 = new ToolStripMenuItem(); toolStripMenuItem52 = new ToolStripMenuItem(); + toolStripButton1 = new ToolStripButton(); + toolStripButton2 = new ToolStripButton(); + tsbPath = new ToolStripBreadcrumbItem(); cmsIis = new ContextMenuStrip(components); refreshToolStripMenuItem5 = new ToolStripMenuItem(); toolStripMenuItem23 = new ToolStripSeparator(); @@ -182,21 +186,6 @@ private void InitializeComponent() removeToolStripMenuItem1 = new ToolStripMenuItem(); toolStripMenuItem24 = new ToolStripSeparator(); switchToContentViewToolStripMenuItem3 = new ToolStripMenuItem(); - cmsFarm = new ContextMenuStrip(components); - refreshToolStripMenuItem7 = new ToolStripMenuItem(); - toolStripMenuItem29 = new ToolStripSeparator(); - btnCreateFarm = new ToolStripMenuItem(); - toolStripMenuItem30 = new ToolStripSeparator(); - switchToContentViewToolStripMenuItem4 = new ToolStripMenuItem(); - cmsFarmServer = new ContextMenuStrip(components); - refreshToolStripMenuItem8 = new ToolStripMenuItem(); - btnRemoveFarmServer = new ToolStripMenuItem(); - toolStripMenuItem31 = new ToolStripSeparator(); - btnAddFarmServer = new ToolStripMenuItem(); - toolStripMenuItem32 = new ToolStripSeparator(); - btnRenameFarmServer = new ToolStripMenuItem(); - toolStripMenuItem33 = new ToolStripSeparator(); - switchToContentViewToolStripMenuItem5 = new ToolStripMenuItem(); cmsServers = new ContextMenuStrip(components); refreshToolStripMenuItem9 = new ToolStripMenuItem(); toolStripMenuItem34 = new ToolStripSeparator(); @@ -226,6 +215,7 @@ private void InitializeComponent() toolStripMenuItem56 = new ToolStripMenuItem(); _logSplitter = new SplitContainer(); _logPanel = new Panel(); + tsTop = new ToolStrip(); ((ISupportInitialize)scMain).BeginInit(); scMain.Panel1.SuspendLayout(); scMain.SuspendLayout(); @@ -242,8 +232,6 @@ private void InitializeComponent() ((ISupportInitialize)actionList1).BeginInit(); cmsIis.SuspendLayout(); cmsApplication.SuspendLayout(); - cmsFarm.SuspendLayout(); - cmsFarmServer.SuspendLayout(); cmsServers.SuspendLayout(); cmsVirtualDirectory.SuspendLayout(); cmsPhysicalDirectory.SuspendLayout(); @@ -251,6 +239,7 @@ private void InitializeComponent() _logSplitter.Panel1.SuspendLayout(); _logSplitter.Panel2.SuspendLayout(); _logSplitter.SuspendLayout(); + tsTop.SuspendLayout(); SuspendLayout(); // // scMain @@ -263,7 +252,7 @@ private void InitializeComponent() // scMain.Panel1.Controls.Add(tableLayoutPanel1); scMain.Panel1MinSize = 150; - scMain.Size = new System.Drawing.Size(915, 451); + scMain.Size = new System.Drawing.Size(915, 426); scMain.SplitterDistance = 175; scMain.SplitterWidth = 5; scMain.TabIndex = 0; @@ -283,7 +272,7 @@ private void InitializeComponent() tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 23F)); tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 23F)); - tableLayoutPanel1.Size = new System.Drawing.Size(175, 451); + tableLayoutPanel1.Size = new System.Drawing.Size(175, 426); tableLayoutPanel1.TabIndex = 3; // // panel2 @@ -293,7 +282,7 @@ private void InitializeComponent() panel2.Dock = DockStyle.Fill; panel2.Location = new System.Drawing.Point(3, 30); panel2.Name = "panel2"; - panel2.Size = new System.Drawing.Size(169, 418); + panel2.Size = new System.Drawing.Size(169, 393); panel2.TabIndex = 0; // // treeView1 @@ -303,10 +292,10 @@ private void InitializeComponent() treeView1.ImageIndex = 0; treeView1.ImageList = imageList1; treeView1.LabelEdit = true; - treeView1.Location = new System.Drawing.Point(0, 39); + treeView1.Location = new System.Drawing.Point(0, 25); treeView1.Name = "treeView1"; treeView1.SelectedImageIndex = 0; - treeView1.Size = new System.Drawing.Size(169, 379); + treeView1.Size = new System.Drawing.Size(169, 368); treeView1.TabIndex = 0; treeView1.BeforeLabelEdit += treeView1_BeforeLabelEdit; treeView1.AfterLabelEdit += treeView1_AfterLabelEdit; @@ -328,7 +317,7 @@ private void InitializeComponent() toolStrip2.Location = new System.Drawing.Point(0, 0); toolStrip2.Name = "toolStrip2"; toolStrip2.Padding = new Padding(0, 0, 2, 0); - toolStrip2.Size = new System.Drawing.Size(169, 39); + toolStrip2.Size = new System.Drawing.Size(169, 25); toolStrip2.TabIndex = 6; toolStrip2.Text = "toolStrip2"; // @@ -339,7 +328,7 @@ private void InitializeComponent() toolStripButton3.Image = Main.Properties.Resources.connect_16; toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton3.Name = "toolStripButton3"; - toolStripButton3.Size = new System.Drawing.Size(48, 36); + toolStripButton3.Size = new System.Drawing.Size(32, 22); toolStripButton3.Text = "Create New Connection"; // // btnServer @@ -373,14 +362,14 @@ private void InitializeComponent() btnSave.DisplayStyle = ToolStripItemDisplayStyle.Image; btnSave.Enabled = false; btnSave.Name = "btnSave"; - btnSave.Size = new System.Drawing.Size(36, 36); + btnSave.Size = new System.Drawing.Size(23, 22); btnSave.Text = "Save Connections"; btnSave.ToolTipText = "Save Connections"; // // toolStripSeparator2 // toolStripSeparator2.Name = "toolStripSeparator2"; - toolStripSeparator2.Size = new System.Drawing.Size(6, 39); + toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // btnUp // @@ -389,14 +378,14 @@ private void InitializeComponent() btnUp.DisplayStyle = ToolStripItemDisplayStyle.Image; btnUp.Enabled = false; btnUp.Name = "btnUp"; - btnUp.Size = new System.Drawing.Size(36, 36); + btnUp.Size = new System.Drawing.Size(23, 22); btnUp.Text = "Up One Level"; btnUp.ToolTipText = "Up One Level"; // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new System.Drawing.Size(6, 39); + toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // btnDisconnect // @@ -405,7 +394,7 @@ private void InitializeComponent() btnDisconnect.DisplayStyle = ToolStripItemDisplayStyle.Image; btnDisconnect.Enabled = false; btnDisconnect.Name = "btnDisconnect"; - btnDisconnect.Size = new System.Drawing.Size(36, 36); + btnDisconnect.Size = new System.Drawing.Size(23, 22); btnDisconnect.Text = "Disconnect"; btnDisconnect.ToolTipText = "Disconnect"; // @@ -434,54 +423,54 @@ private void InitializeComponent() // cmsServer.Items.AddRange(new ToolStripItem[] { refreshToolStripMenuItem, toolStripMenuItem1, removeConnectionToolStripMenuItem, toolStripMenuItem4, addWebsiteToolStripMenuItem, toolStripMenuItem2, btnStartServer, btnStopServer, toolStripMenuItem3, btnRenameServer, toolStripMenuItem5, btnOpenConfig, toolStripMenuItem40, switchToContentViewToolStripMenuItem }); cmsServer.Name = "cmsServer"; - cmsServer.Size = new System.Drawing.Size(218, 344); + cmsServer.Size = new System.Drawing.Size(202, 216); // // refreshToolStripMenuItem // refreshToolStripMenuItem.Enabled = false; refreshToolStripMenuItem.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem.Name = "refreshToolStripMenuItem"; - refreshToolStripMenuItem.Size = new System.Drawing.Size(217, 22); + refreshToolStripMenuItem.Size = new System.Drawing.Size(201, 22); refreshToolStripMenuItem.Text = "Refresh"; // // toolStripMenuItem1 // toolStripMenuItem1.Name = "toolStripMenuItem1"; - toolStripMenuItem1.Size = new System.Drawing.Size(214, 6); + toolStripMenuItem1.Size = new System.Drawing.Size(198, 6); // // removeConnectionToolStripMenuItem // actionList1.SetAction(removeConnectionToolStripMenuItem, actDisconnect); removeConnectionToolStripMenuItem.Enabled = false; removeConnectionToolStripMenuItem.Name = "removeConnectionToolStripMenuItem"; - removeConnectionToolStripMenuItem.Size = new System.Drawing.Size(217, 22); + removeConnectionToolStripMenuItem.Size = new System.Drawing.Size(201, 22); removeConnectionToolStripMenuItem.Text = "Disconnect"; removeConnectionToolStripMenuItem.ToolTipText = "Disconnect"; // // toolStripMenuItem4 // toolStripMenuItem4.Name = "toolStripMenuItem4"; - toolStripMenuItem4.Size = new System.Drawing.Size(214, 6); + toolStripMenuItem4.Size = new System.Drawing.Size(198, 6); // // addWebsiteToolStripMenuItem // actionList1.SetAction(addWebsiteToolStripMenuItem, actCreateSite); addWebsiteToolStripMenuItem.AutoToolTip = true; addWebsiteToolStripMenuItem.Name = "addWebsiteToolStripMenuItem"; - addWebsiteToolStripMenuItem.Size = new System.Drawing.Size(217, 22); + addWebsiteToolStripMenuItem.Size = new System.Drawing.Size(201, 22); addWebsiteToolStripMenuItem.Text = "Add Website..."; // // toolStripMenuItem2 // toolStripMenuItem2.Name = "toolStripMenuItem2"; - toolStripMenuItem2.Size = new System.Drawing.Size(214, 6); + toolStripMenuItem2.Size = new System.Drawing.Size(198, 6); // // btnStartServer // btnStartServer.Enabled = false; btnStartServer.Image = Main.Properties.Resources.start_16; btnStartServer.Name = "btnStartServer"; - btnStartServer.Size = new System.Drawing.Size(217, 22); + btnStartServer.Size = new System.Drawing.Size(201, 22); btnStartServer.Text = "Start"; // // btnStopServer @@ -489,122 +478,122 @@ private void InitializeComponent() btnStopServer.Enabled = false; btnStopServer.Image = Main.Properties.Resources.stop_16; btnStopServer.Name = "btnStopServer"; - btnStopServer.Size = new System.Drawing.Size(217, 22); + btnStopServer.Size = new System.Drawing.Size(201, 22); btnStopServer.Text = "Stop"; // // toolStripMenuItem3 // toolStripMenuItem3.Name = "toolStripMenuItem3"; - toolStripMenuItem3.Size = new System.Drawing.Size(214, 6); + toolStripMenuItem3.Size = new System.Drawing.Size(198, 6); // // btnRenameServer // btnRenameServer.Enabled = false; btnRenameServer.Name = "btnRenameServer"; - btnRenameServer.Size = new System.Drawing.Size(217, 22); + btnRenameServer.Size = new System.Drawing.Size(201, 22); btnRenameServer.Text = "Rename"; // // toolStripMenuItem5 // toolStripMenuItem5.Name = "toolStripMenuItem5"; - toolStripMenuItem5.Size = new System.Drawing.Size(214, 6); + toolStripMenuItem5.Size = new System.Drawing.Size(198, 6); // // btnOpenConfig // btnOpenConfig.Name = "btnOpenConfig"; - btnOpenConfig.Size = new System.Drawing.Size(217, 22); + btnOpenConfig.Size = new System.Drawing.Size(201, 22); btnOpenConfig.Text = "Open Configuration File"; btnOpenConfig.Click += btnOpenConfig_Click; // // toolStripMenuItem40 // toolStripMenuItem40.Name = "toolStripMenuItem40"; - toolStripMenuItem40.Size = new System.Drawing.Size(214, 6); + toolStripMenuItem40.Size = new System.Drawing.Size(198, 6); // // switchToContentViewToolStripMenuItem // switchToContentViewToolStripMenuItem.Enabled = false; switchToContentViewToolStripMenuItem.Image = Main.Properties.Resources.switch_16; switchToContentViewToolStripMenuItem.Name = "switchToContentViewToolStripMenuItem"; - switchToContentViewToolStripMenuItem.Size = new System.Drawing.Size(217, 22); + switchToContentViewToolStripMenuItem.Size = new System.Drawing.Size(201, 22); switchToContentViewToolStripMenuItem.Text = "Switch to Content View"; // // cmsApplicationPools // cmsApplicationPools.Items.AddRange(new ToolStripItem[] { addApplicationPoolToolStripMenuItem, toolStripMenuItem6, refreshToolStripMenuItem1 }); cmsApplicationPools.Name = "cmsApplicationPools"; - cmsApplicationPools.Size = new System.Drawing.Size(213, 86); + cmsApplicationPools.Size = new System.Drawing.Size(197, 54); // // addApplicationPoolToolStripMenuItem // addApplicationPoolToolStripMenuItem.Enabled = false; addApplicationPoolToolStripMenuItem.Name = "addApplicationPoolToolStripMenuItem"; - addApplicationPoolToolStripMenuItem.Size = new System.Drawing.Size(212, 22); + addApplicationPoolToolStripMenuItem.Size = new System.Drawing.Size(196, 22); addApplicationPoolToolStripMenuItem.Text = "Add Application Pool..."; // // toolStripMenuItem6 // toolStripMenuItem6.Name = "toolStripMenuItem6"; - toolStripMenuItem6.Size = new System.Drawing.Size(209, 6); + toolStripMenuItem6.Size = new System.Drawing.Size(193, 6); // // refreshToolStripMenuItem1 // refreshToolStripMenuItem1.Enabled = false; refreshToolStripMenuItem1.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem1.Name = "refreshToolStripMenuItem1"; - refreshToolStripMenuItem1.Size = new System.Drawing.Size(212, 22); + refreshToolStripMenuItem1.Size = new System.Drawing.Size(196, 22); refreshToolStripMenuItem1.Text = "Refresh"; // // cmsSites // cmsSites.Items.AddRange(new ToolStripItem[] { addWebsiteToolStripMenuItem1, toolStripMenuItem7, refreshToolStripMenuItem2, toolStripMenuItem8, switchToContentViewToolStripMenuItem1 }); cmsSites.Name = "cmsSites"; - cmsSites.Size = new System.Drawing.Size(214, 130); + cmsSites.Size = new System.Drawing.Size(198, 82); // // addWebsiteToolStripMenuItem1 // actionList1.SetAction(addWebsiteToolStripMenuItem1, actCreateSite); addWebsiteToolStripMenuItem1.AutoToolTip = true; addWebsiteToolStripMenuItem1.Name = "addWebsiteToolStripMenuItem1"; - addWebsiteToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + addWebsiteToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); addWebsiteToolStripMenuItem1.Text = "Add Website..."; // // toolStripMenuItem7 // toolStripMenuItem7.Name = "toolStripMenuItem7"; - toolStripMenuItem7.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem7.Size = new System.Drawing.Size(194, 6); // // refreshToolStripMenuItem2 // refreshToolStripMenuItem2.Enabled = false; refreshToolStripMenuItem2.Name = "refreshToolStripMenuItem2"; - refreshToolStripMenuItem2.Size = new System.Drawing.Size(213, 22); + refreshToolStripMenuItem2.Size = new System.Drawing.Size(197, 22); refreshToolStripMenuItem2.Text = "Refresh"; // // toolStripMenuItem8 // toolStripMenuItem8.Name = "toolStripMenuItem8"; - toolStripMenuItem8.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem8.Size = new System.Drawing.Size(194, 6); // // switchToContentViewToolStripMenuItem1 // switchToContentViewToolStripMenuItem1.Enabled = false; switchToContentViewToolStripMenuItem1.Name = "switchToContentViewToolStripMenuItem1"; - switchToContentViewToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + switchToContentViewToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); switchToContentViewToolStripMenuItem1.Text = "Switch to Content View"; // // cmsSite // cmsSite.Items.AddRange(new ToolStripItem[] { exploreToolStripMenuItem, editPermissionsToolStripMenuItem, toolStripMenuItem10, btnApplication, addVirtualDirectoryToolStripMenuItem, toolStripMenuItem11, editBindingsToolStripMenuItem, toolStripMenuItem12, manageWebsiteToolStripMenuItem, toolStripMenuItem13, refreshToolStripMenuItem3, removeToolStripMenuItem, toolStripMenuItem14, renameToolStripMenuItem1, toolStripMenuItem17, switchToContentViewToolStripMenuItem2 }); cmsSite.Name = "cmsSite"; - cmsSite.Size = new System.Drawing.Size(214, 420); + cmsSite.Size = new System.Drawing.Size(198, 260); // // exploreToolStripMenuItem // actionList1.SetAction(exploreToolStripMenuItem, actExplore); exploreToolStripMenuItem.AutoToolTip = true; exploreToolStripMenuItem.Name = "exploreToolStripMenuItem"; - exploreToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + exploreToolStripMenuItem.Size = new System.Drawing.Size(197, 22); exploreToolStripMenuItem.Text = "Explore"; // // editPermissionsToolStripMenuItem @@ -612,20 +601,20 @@ private void InitializeComponent() actionList1.SetAction(editPermissionsToolStripMenuItem, actEditPermissions); editPermissionsToolStripMenuItem.AutoToolTip = true; editPermissionsToolStripMenuItem.Name = "editPermissionsToolStripMenuItem"; - editPermissionsToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + editPermissionsToolStripMenuItem.Size = new System.Drawing.Size(197, 22); editPermissionsToolStripMenuItem.Text = "Edit Permissions..."; // // toolStripMenuItem10 // toolStripMenuItem10.Name = "toolStripMenuItem10"; - toolStripMenuItem10.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem10.Size = new System.Drawing.Size(194, 6); // // btnApplication // actionList1.SetAction(btnApplication, actCreateApplication); btnApplication.AutoToolTip = true; btnApplication.Name = "btnApplication"; - btnApplication.Size = new System.Drawing.Size(213, 22); + btnApplication.Size = new System.Drawing.Size(197, 22); btnApplication.Text = "Add Application..."; // // addVirtualDirectoryToolStripMenuItem @@ -633,31 +622,31 @@ private void InitializeComponent() actionList1.SetAction(addVirtualDirectoryToolStripMenuItem, actCreateVirtualDirectory); addVirtualDirectoryToolStripMenuItem.AutoToolTip = true; addVirtualDirectoryToolStripMenuItem.Name = "addVirtualDirectoryToolStripMenuItem"; - addVirtualDirectoryToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + addVirtualDirectoryToolStripMenuItem.Size = new System.Drawing.Size(197, 22); addVirtualDirectoryToolStripMenuItem.Text = "Add Virtual Directory..."; // // toolStripMenuItem11 // toolStripMenuItem11.Name = "toolStripMenuItem11"; - toolStripMenuItem11.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem11.Size = new System.Drawing.Size(194, 6); // // editBindingsToolStripMenuItem // editBindingsToolStripMenuItem.Name = "editBindingsToolStripMenuItem"; - editBindingsToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + editBindingsToolStripMenuItem.Size = new System.Drawing.Size(197, 22); editBindingsToolStripMenuItem.Text = "Edit Bindings..."; editBindingsToolStripMenuItem.Click += editBindingsToolStripMenuItem_Click; // // toolStripMenuItem12 // toolStripMenuItem12.Name = "toolStripMenuItem12"; - toolStripMenuItem12.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem12.Size = new System.Drawing.Size(194, 6); // // manageWebsiteToolStripMenuItem // manageWebsiteToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { btnRestartSite, startToolStripMenuItem1, stopToolStripMenuItem2, toolStripMenuItem26, btnBrowseSite, toolStripMenuItem27, advancedSettingsToolStripMenuItem1 }); manageWebsiteToolStripMenuItem.Name = "manageWebsiteToolStripMenuItem"; - manageWebsiteToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + manageWebsiteToolStripMenuItem.Size = new System.Drawing.Size(197, 22); manageWebsiteToolStripMenuItem.Text = "Manage Website"; // // btnRestartSite @@ -712,46 +701,46 @@ private void InitializeComponent() // toolStripMenuItem13 // toolStripMenuItem13.Name = "toolStripMenuItem13"; - toolStripMenuItem13.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem13.Size = new System.Drawing.Size(194, 6); // // refreshToolStripMenuItem3 // refreshToolStripMenuItem3.Enabled = false; refreshToolStripMenuItem3.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem3.Name = "refreshToolStripMenuItem3"; - refreshToolStripMenuItem3.Size = new System.Drawing.Size(213, 22); + refreshToolStripMenuItem3.Size = new System.Drawing.Size(197, 22); refreshToolStripMenuItem3.Text = "Refresh"; // // removeToolStripMenuItem // removeToolStripMenuItem.Name = "removeToolStripMenuItem"; - removeToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + removeToolStripMenuItem.Size = new System.Drawing.Size(197, 22); removeToolStripMenuItem.Text = "Remove"; removeToolStripMenuItem.Click += btnRemoveSite_Click; // // toolStripMenuItem14 // toolStripMenuItem14.Name = "toolStripMenuItem14"; - toolStripMenuItem14.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem14.Size = new System.Drawing.Size(194, 6); // // renameToolStripMenuItem1 // renameToolStripMenuItem1.Name = "renameToolStripMenuItem1"; - renameToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + renameToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); renameToolStripMenuItem1.Text = "Rename"; renameToolStripMenuItem1.Click += renameToolStripMenuItem1_Click; // // toolStripMenuItem17 // toolStripMenuItem17.Name = "toolStripMenuItem17"; - toolStripMenuItem17.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem17.Size = new System.Drawing.Size(194, 6); // // switchToContentViewToolStripMenuItem2 // switchToContentViewToolStripMenuItem2.Enabled = false; switchToContentViewToolStripMenuItem2.Image = Main.Properties.Resources.switch_16; switchToContentViewToolStripMenuItem2.Name = "switchToContentViewToolStripMenuItem2"; - switchToContentViewToolStripMenuItem2.Size = new System.Drawing.Size(213, 22); + switchToContentViewToolStripMenuItem2.Size = new System.Drawing.Size(197, 22); switchToContentViewToolStripMenuItem2.Text = "Switch to Content View"; // // statusStrip1 @@ -768,14 +757,14 @@ private void InitializeComponent() // txtInfo.Image = Main.Properties.Resources.info_16; txtInfo.Name = "txtInfo"; - txtInfo.Size = new System.Drawing.Size(150, 32); + txtInfo.Size = new System.Drawing.Size(134, 17); txtInfo.Text = "toolStripStatusLabel1"; txtInfo.Visible = false; // // menuStrip1 // menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, viewToolStripMenuItem, helpToolStripMenuItem }); - menuStrip1.Location = new System.Drawing.Point(0, 0); + menuStrip1.Location = new System.Drawing.Point(0, 25); menuStrip1.Name = "menuStrip1"; menuStrip1.Padding = new Padding(7, 2, 0, 2); menuStrip1.Size = new System.Drawing.Size(915, 24); @@ -793,7 +782,7 @@ private void InitializeComponent() // actionList1.SetAction(connectToAServerToolStripMenuItem, actConnectServer); connectToAServerToolStripMenuItem.Name = "connectToAServerToolStripMenuItem"; - connectToAServerToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + connectToAServerToolStripMenuItem.Size = new System.Drawing.Size(222, 22); connectToAServerToolStripMenuItem.Text = "Connect to a Server..."; connectToAServerToolStripMenuItem.ToolTipText = "Connect to a Server..."; // @@ -802,7 +791,7 @@ private void InitializeComponent() actionList1.SetAction(connectToAWebsiteToolStripMenuItem, actConnectSite); connectToAWebsiteToolStripMenuItem.Enabled = false; connectToAWebsiteToolStripMenuItem.Name = "connectToAWebsiteToolStripMenuItem"; - connectToAWebsiteToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + connectToAWebsiteToolStripMenuItem.Size = new System.Drawing.Size(222, 22); connectToAWebsiteToolStripMenuItem.Text = "Connect to a Website..."; connectToAWebsiteToolStripMenuItem.ToolTipText = "Connect to a Website..."; // @@ -811,21 +800,21 @@ private void InitializeComponent() actionList1.SetAction(connectToAnApplicationToolStripMenuItem, actConnectionApplication); connectToAnApplicationToolStripMenuItem.Enabled = false; connectToAnApplicationToolStripMenuItem.Name = "connectToAnApplicationToolStripMenuItem"; - connectToAnApplicationToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + connectToAnApplicationToolStripMenuItem.Size = new System.Drawing.Size(222, 22); connectToAnApplicationToolStripMenuItem.Text = "Connect to an Application..."; connectToAnApplicationToolStripMenuItem.ToolTipText = "Connect to an Application..."; // // toolStripMenuItem22 // toolStripMenuItem22.Name = "toolStripMenuItem22"; - toolStripMenuItem22.Size = new System.Drawing.Size(235, 6); + toolStripMenuItem22.Size = new System.Drawing.Size(219, 6); // // saveConnectionsToolStripMenuItem // actionList1.SetAction(saveConnectionsToolStripMenuItem, actSave); saveConnectionsToolStripMenuItem.Enabled = false; saveConnectionsToolStripMenuItem.Name = "saveConnectionsToolStripMenuItem"; - saveConnectionsToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + saveConnectionsToolStripMenuItem.Size = new System.Drawing.Size(222, 22); saveConnectionsToolStripMenuItem.Text = "Save Connections"; saveConnectionsToolStripMenuItem.ToolTipText = "Save Connections"; // @@ -834,27 +823,27 @@ private void InitializeComponent() actionList1.SetAction(disconnectToolStripMenuItem, actDisconnect); disconnectToolStripMenuItem.Enabled = false; disconnectToolStripMenuItem.Name = "disconnectToolStripMenuItem"; - disconnectToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + disconnectToolStripMenuItem.Size = new System.Drawing.Size(222, 22); disconnectToolStripMenuItem.Text = "Disconnect"; disconnectToolStripMenuItem.ToolTipText = "Disconnect"; // // toolStripMenuItem21 // toolStripMenuItem21.Name = "toolStripMenuItem21"; - toolStripMenuItem21.Size = new System.Drawing.Size(235, 6); + toolStripMenuItem21.Size = new System.Drawing.Size(219, 6); // // runAsAdministratorToolStripMenuItem // actionList1.SetAction(runAsAdministratorToolStripMenuItem, actRunAsAdmin); runAsAdministratorToolStripMenuItem.AutoToolTip = true; runAsAdministratorToolStripMenuItem.Name = "runAsAdministratorToolStripMenuItem"; - runAsAdministratorToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + runAsAdministratorToolStripMenuItem.Size = new System.Drawing.Size(222, 22); runAsAdministratorToolStripMenuItem.Text = "Run as Administrator"; // // exitToolStripMenuItem // exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - exitToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + exitToolStripMenuItem.Size = new System.Drawing.Size(222, 22); exitToolStripMenuItem.Text = "Exit"; exitToolStripMenuItem.Click += exitToolStripMenuItem_Click; // @@ -868,15 +857,17 @@ private void InitializeComponent() // backToolStripMenuItem // actionList1.SetAction(backToolStripMenuItem, actBack); + backToolStripMenuItem.Enabled = false; backToolStripMenuItem.Name = "backToolStripMenuItem"; - backToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + backToolStripMenuItem.Size = new System.Drawing.Size(170, 22); backToolStripMenuItem.Text = "Back"; // // forwardToolStripMenuItem // actionList1.SetAction(forwardToolStripMenuItem, actForward); + forwardToolStripMenuItem.Enabled = false; forwardToolStripMenuItem.Name = "forwardToolStripMenuItem"; - forwardToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + forwardToolStripMenuItem.Size = new System.Drawing.Size(170, 22); forwardToolStripMenuItem.Text = "Forward"; // // upOneLevelToolStripMenuItem @@ -884,7 +875,7 @@ private void InitializeComponent() actionList1.SetAction(upOneLevelToolStripMenuItem, actUp); upOneLevelToolStripMenuItem.Enabled = false; upOneLevelToolStripMenuItem.Name = "upOneLevelToolStripMenuItem"; - upOneLevelToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + upOneLevelToolStripMenuItem.Size = new System.Drawing.Size(170, 22); upOneLevelToolStripMenuItem.Text = "Up One Level"; upOneLevelToolStripMenuItem.ToolTipText = "Up One Level"; // @@ -893,19 +884,19 @@ private void InitializeComponent() homeToolStripMenuItem.Enabled = false; homeToolStripMenuItem.Name = "homeToolStripMenuItem"; homeToolStripMenuItem.ShortcutKeys = Keys.Alt | Keys.Home; - homeToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + homeToolStripMenuItem.Size = new System.Drawing.Size(170, 22); homeToolStripMenuItem.Text = "Home"; // // toolStripMenuItem19 // toolStripMenuItem19.Name = "toolStripMenuItem19"; - toolStripMenuItem19.Size = new System.Drawing.Size(141, 6); + toolStripMenuItem19.Size = new System.Drawing.Size(167, 6); // // stopToolStripMenuItem1 // stopToolStripMenuItem1.Enabled = false; stopToolStripMenuItem1.Name = "stopToolStripMenuItem1"; - stopToolStripMenuItem1.Size = new System.Drawing.Size(144, 22); + stopToolStripMenuItem1.Size = new System.Drawing.Size(170, 22); stopToolStripMenuItem1.Text = "Stop"; // // refreshToolStripMenuItem4 @@ -913,33 +904,33 @@ private void InitializeComponent() refreshToolStripMenuItem4.Enabled = false; refreshToolStripMenuItem4.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem4.Name = "refreshToolStripMenuItem4"; - refreshToolStripMenuItem4.Size = new System.Drawing.Size(144, 22); + refreshToolStripMenuItem4.Size = new System.Drawing.Size(170, 22); refreshToolStripMenuItem4.Text = "Refresh"; // // toolStripMenuItem20 // toolStripMenuItem20.Name = "toolStripMenuItem20"; - toolStripMenuItem20.Size = new System.Drawing.Size(141, 6); + toolStripMenuItem20.Size = new System.Drawing.Size(167, 6); // // groupByToolStripMenuItem // groupByToolStripMenuItem.Enabled = false; groupByToolStripMenuItem.Name = "groupByToolStripMenuItem"; - groupByToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + groupByToolStripMenuItem.Size = new System.Drawing.Size(170, 22); groupByToolStripMenuItem.Text = "Group By"; // // sortByToolStripMenuItem // sortByToolStripMenuItem.Enabled = false; sortByToolStripMenuItem.Name = "sortByToolStripMenuItem"; - sortByToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + sortByToolStripMenuItem.Size = new System.Drawing.Size(170, 22); sortByToolStripMenuItem.Text = "Sort By"; // // viewToolStripMenuItem1 // viewToolStripMenuItem1.Enabled = false; viewToolStripMenuItem1.Name = "viewToolStripMenuItem1"; - viewToolStripMenuItem1.Size = new System.Drawing.Size(144, 22); + viewToolStripMenuItem1.Size = new System.Drawing.Size(170, 22); viewToolStripMenuItem1.Text = "View"; // // helpToolStripMenuItem @@ -954,52 +945,52 @@ private void InitializeComponent() iISHelpToolStripMenuItem.Image = Main.Properties.Resources.help_16; iISHelpToolStripMenuItem.Name = "iISHelpToolStripMenuItem"; iISHelpToolStripMenuItem.ShortcutKeys = Keys.F1; - iISHelpToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + iISHelpToolStripMenuItem.Size = new System.Drawing.Size(187, 22); iISHelpToolStripMenuItem.Text = "IIS Help"; // // iISOnMSDNOnlineToolStripMenuItem // iISOnMSDNOnlineToolStripMenuItem.Name = "iISOnMSDNOnlineToolStripMenuItem"; - iISOnMSDNOnlineToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + iISOnMSDNOnlineToolStripMenuItem.Size = new System.Drawing.Size(187, 22); iISOnMSDNOnlineToolStripMenuItem.Text = "IIS on MSDN Online"; iISOnMSDNOnlineToolStripMenuItem.Click += iISOnMSDNOnlineToolStripMenuItem_Click; // // iISNETOnlineToolStripMenuItem // iISNETOnlineToolStripMenuItem.Name = "iISNETOnlineToolStripMenuItem"; - iISNETOnlineToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + iISNETOnlineToolStripMenuItem.Size = new System.Drawing.Size(187, 22); iISNETOnlineToolStripMenuItem.Text = "IIS.NET Online"; iISNETOnlineToolStripMenuItem.Click += iISNETOnlineToolStripMenuItem_Click; // // iISKBsOnlineToolStripMenuItem // iISKBsOnlineToolStripMenuItem.Name = "iISKBsOnlineToolStripMenuItem"; - iISKBsOnlineToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + iISKBsOnlineToolStripMenuItem.Size = new System.Drawing.Size(187, 22); iISKBsOnlineToolStripMenuItem.Text = "IIS KBs Online"; iISKBsOnlineToolStripMenuItem.Click += iISKBsOnlineToolStripMenuItem_Click; // // toolStripMenuItem28 // toolStripMenuItem28.Name = "toolStripMenuItem28"; - toolStripMenuItem28.Size = new System.Drawing.Size(185, 6); + toolStripMenuItem28.Size = new System.Drawing.Size(184, 6); // // btnUpdate // btnUpdate.Image = Main.Properties.Resources.update_16; btnUpdate.Name = "btnUpdate"; - btnUpdate.Size = new System.Drawing.Size(188, 22); + btnUpdate.Size = new System.Drawing.Size(187, 22); btnUpdate.Text = "Check Update"; btnUpdate.Click += btnUpdate_Click; // // toolStripMenuItem18 // toolStripMenuItem18.Name = "toolStripMenuItem18"; - toolStripMenuItem18.Size = new System.Drawing.Size(185, 6); + toolStripMenuItem18.Size = new System.Drawing.Size(184, 6); // // btnAbout // btnAbout.Name = "btnAbout"; - btnAbout.Size = new System.Drawing.Size(188, 22); + btnAbout.Size = new System.Drawing.Size(187, 22); btnAbout.Text = "About Jexus Manager"; btnAbout.Click += btnAbout_Click; // @@ -1128,8 +1119,9 @@ private void InitializeComponent() // connectToAServerToolStripMenuItem1 // actionList1.SetAction(connectToAServerToolStripMenuItem1, actConnectServer); + connectToAServerToolStripMenuItem1.Image = Main.Properties.Resources.server_16; connectToAServerToolStripMenuItem1.Name = "connectToAServerToolStripMenuItem1"; - connectToAServerToolStripMenuItem1.Size = new System.Drawing.Size(238, 22); + connectToAServerToolStripMenuItem1.Size = new System.Drawing.Size(222, 22); connectToAServerToolStripMenuItem1.Text = "Connect to a Server..."; connectToAServerToolStripMenuItem1.ToolTipText = "Connect to a Server..."; // @@ -1137,8 +1129,9 @@ private void InitializeComponent() // actionList1.SetAction(connectToAWebsiteToolStripMenuItem1, actConnectSite); connectToAWebsiteToolStripMenuItem1.Enabled = false; + connectToAWebsiteToolStripMenuItem1.Image = Main.Properties.Resources.site_16; connectToAWebsiteToolStripMenuItem1.Name = "connectToAWebsiteToolStripMenuItem1"; - connectToAWebsiteToolStripMenuItem1.Size = new System.Drawing.Size(238, 22); + connectToAWebsiteToolStripMenuItem1.Size = new System.Drawing.Size(222, 22); connectToAWebsiteToolStripMenuItem1.Text = "Connect to a Website..."; connectToAWebsiteToolStripMenuItem1.ToolTipText = "Connect to a Website..."; // @@ -1146,56 +1139,63 @@ private void InitializeComponent() // actionList1.SetAction(connectToAnApplicationToolStripMenuItem1, actConnectionApplication); connectToAnApplicationToolStripMenuItem1.Enabled = false; + connectToAnApplicationToolStripMenuItem1.Image = Main.Properties.Resources.application_16; connectToAnApplicationToolStripMenuItem1.Name = "connectToAnApplicationToolStripMenuItem1"; - connectToAnApplicationToolStripMenuItem1.Size = new System.Drawing.Size(238, 22); + connectToAnApplicationToolStripMenuItem1.Size = new System.Drawing.Size(222, 22); connectToAnApplicationToolStripMenuItem1.Text = "Connect to an Application..."; connectToAnApplicationToolStripMenuItem1.ToolTipText = "Connect to an Application..."; // // addApplicationToolStripMenuItem // actionList1.SetAction(addApplicationToolStripMenuItem, actCreateApplication); + addApplicationToolStripMenuItem.Image = Main.Properties.Resources.application_new_16; addApplicationToolStripMenuItem.Name = "addApplicationToolStripMenuItem"; - addApplicationToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + addApplicationToolStripMenuItem.Size = new System.Drawing.Size(197, 22); addApplicationToolStripMenuItem.Text = "Add Application..."; // // toolStripMenuItem38 // actionList1.SetAction(toolStripMenuItem38, actCreateApplication); + toolStripMenuItem38.Image = Main.Properties.Resources.application_new_16; toolStripMenuItem38.Name = "toolStripMenuItem38"; - toolStripMenuItem38.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem38.Size = new System.Drawing.Size(205, 22); toolStripMenuItem38.Text = "Add Application..."; // // toolStripMenuItem49 // actionList1.SetAction(toolStripMenuItem49, actCreateApplication); + toolStripMenuItem49.Image = Main.Properties.Resources.application_new_16; toolStripMenuItem49.Name = "toolStripMenuItem49"; - toolStripMenuItem49.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem49.Size = new System.Drawing.Size(197, 22); toolStripMenuItem49.Text = "Add Application..."; // // exploreToolStripMenuItem1 // actionList1.SetAction(exploreToolStripMenuItem1, actExplore); + exploreToolStripMenuItem1.Image = Main.Properties.Resources.explore_16; exploreToolStripMenuItem1.Name = "exploreToolStripMenuItem1"; - exploreToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + exploreToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); exploreToolStripMenuItem1.Text = "Explore"; // // editPermissionsToolStripMenuItem1 // actionList1.SetAction(editPermissionsToolStripMenuItem1, actEditPermissions); editPermissionsToolStripMenuItem1.Name = "editPermissionsToolStripMenuItem1"; - editPermissionsToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + editPermissionsToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); editPermissionsToolStripMenuItem1.Text = "Edit Permissions..."; // // addVirtualDirectoryToolStripMenuItem1 // actionList1.SetAction(addVirtualDirectoryToolStripMenuItem1, actCreateVirtualDirectory); + addVirtualDirectoryToolStripMenuItem1.Image = Main.Properties.Resources.virtual_directory_new_16; addVirtualDirectoryToolStripMenuItem1.Name = "addVirtualDirectoryToolStripMenuItem1"; - addVirtualDirectoryToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + addVirtualDirectoryToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); addVirtualDirectoryToolStripMenuItem1.Text = "Add Virtual Directory..."; // // btnBrowseApplication // actionList1.SetAction(btnBrowseApplication, actBrowse); + btnBrowseApplication.Image = Main.Properties.Resources.browse_16; btnBrowseApplication.Name = "btnBrowseApplication"; btnBrowseApplication.Size = new System.Drawing.Size(181, 22); btnBrowseApplication.Text = "Browse"; @@ -1203,27 +1203,30 @@ private void InitializeComponent() // toolStripMenuItem36 // actionList1.SetAction(toolStripMenuItem36, actExplore); + toolStripMenuItem36.Image = Main.Properties.Resources.explore_16; toolStripMenuItem36.Name = "toolStripMenuItem36"; - toolStripMenuItem36.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem36.Size = new System.Drawing.Size(205, 22); toolStripMenuItem36.Text = "Explore"; // // toolStripMenuItem37 // actionList1.SetAction(toolStripMenuItem37, actEditPermissions); toolStripMenuItem37.Name = "toolStripMenuItem37"; - toolStripMenuItem37.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem37.Size = new System.Drawing.Size(205, 22); toolStripMenuItem37.Text = "Edit Permissions..."; // // toolStripMenuItem39 // actionList1.SetAction(toolStripMenuItem39, actCreateVirtualDirectory); + toolStripMenuItem39.Image = Main.Properties.Resources.virtual_directory_new_16; toolStripMenuItem39.Name = "toolStripMenuItem39"; - toolStripMenuItem39.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem39.Size = new System.Drawing.Size(205, 22); toolStripMenuItem39.Text = "Add Virtual Directory..."; // // toolStripMenuItem41 // actionList1.SetAction(toolStripMenuItem41, actBrowse); + toolStripMenuItem41.Image = Main.Properties.Resources.browse_16; toolStripMenuItem41.Name = "toolStripMenuItem41"; toolStripMenuItem41.Size = new System.Drawing.Size(181, 22); toolStripMenuItem41.Text = "Browse"; @@ -1231,71 +1234,109 @@ private void InitializeComponent() // toolStripMenuItem46 // actionList1.SetAction(toolStripMenuItem46, actExplore); + toolStripMenuItem46.Image = Main.Properties.Resources.explore_16; toolStripMenuItem46.Name = "toolStripMenuItem46"; - toolStripMenuItem46.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem46.Size = new System.Drawing.Size(197, 22); toolStripMenuItem46.Text = "Explore"; // // toolStripMenuItem47 // actionList1.SetAction(toolStripMenuItem47, actEditPermissions); toolStripMenuItem47.Name = "toolStripMenuItem47"; - toolStripMenuItem47.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem47.Size = new System.Drawing.Size(197, 22); toolStripMenuItem47.Text = "Edit Permissions..."; // // toolStripMenuItem50 // actionList1.SetAction(toolStripMenuItem50, actCreateVirtualDirectory); + toolStripMenuItem50.Image = Main.Properties.Resources.virtual_directory_new_16; toolStripMenuItem50.Name = "toolStripMenuItem50"; - toolStripMenuItem50.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem50.Size = new System.Drawing.Size(197, 22); toolStripMenuItem50.Text = "Add Virtual Directory..."; // // toolStripMenuItem52 // actionList1.SetAction(toolStripMenuItem52, actBrowse); + toolStripMenuItem52.Image = Main.Properties.Resources.browse_16; toolStripMenuItem52.Name = "toolStripMenuItem52"; toolStripMenuItem52.Size = new System.Drawing.Size(112, 22); toolStripMenuItem52.Text = "Browse"; // + // toolStripButton1 + // + actionList1.SetAction(toolStripButton1, actBack); + toolStripButton1.AutoToolTip = false; + toolStripButton1.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButton1.Enabled = false; + toolStripButton1.Image = Main.Properties.Resources.back_16; + toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButton1.Name = "toolStripButton1"; + toolStripButton1.Size = new System.Drawing.Size(23, 22); + toolStripButton1.Text = "Back"; + // + // toolStripButton2 + // + actionList1.SetAction(toolStripButton2, actForward); + toolStripButton2.AutoToolTip = false; + toolStripButton2.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButton2.Enabled = false; + toolStripButton2.Image = Main.Properties.Resources.forward_16; + toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButton2.Name = "toolStripButton2"; + toolStripButton2.Size = new System.Drawing.Size(23, 22); + toolStripButton2.Text = "Forward"; + // + // tsbPath + // + tsbPath.AutoSize = false; + tsbPath.BackColor = System.Drawing.SystemColors.Window; + tsbPath.ForeColor = System.Drawing.SystemColors.WindowText; + tsbPath.HighlightColor = System.Drawing.SystemColors.Highlight; + tsbPath.Name = "tsbPath"; + tsbPath.Padding = new Padding(2); + tsbPath.Size = new System.Drawing.Size(800, 22); + tsbPath.ItemClicked += TsbPath_ItemClicked; + // // cmsIis // cmsIis.Items.AddRange(new ToolStripItem[] { refreshToolStripMenuItem5, toolStripMenuItem23, connectToAServerToolStripMenuItem1, connectToAWebsiteToolStripMenuItem1, connectToAnApplicationToolStripMenuItem1 }); cmsIis.Name = "cmsIis"; - cmsIis.Size = new System.Drawing.Size(239, 162); + cmsIis.Size = new System.Drawing.Size(223, 98); // // refreshToolStripMenuItem5 // refreshToolStripMenuItem5.Enabled = false; refreshToolStripMenuItem5.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem5.Name = "refreshToolStripMenuItem5"; - refreshToolStripMenuItem5.Size = new System.Drawing.Size(238, 22); + refreshToolStripMenuItem5.Size = new System.Drawing.Size(222, 22); refreshToolStripMenuItem5.Text = "Refresh"; // // toolStripMenuItem23 // toolStripMenuItem23.Name = "toolStripMenuItem23"; - toolStripMenuItem23.Size = new System.Drawing.Size(235, 6); + toolStripMenuItem23.Size = new System.Drawing.Size(219, 6); // // cmsApplication // cmsApplication.Items.AddRange(new ToolStripItem[] { exploreToolStripMenuItem1, editPermissionsToolStripMenuItem1, toolStripMenuItem9, addApplicationToolStripMenuItem, addVirtualDirectoryToolStripMenuItem1, toolStripMenuItem15, manageApplicationToolStripMenuItem, toolStripMenuItem16, refreshToolStripMenuItem6, removeToolStripMenuItem1, toolStripMenuItem24, switchToContentViewToolStripMenuItem3 }); cmsApplication.Name = "cmsApplication"; - cmsApplication.Size = new System.Drawing.Size(214, 332); + cmsApplication.Size = new System.Drawing.Size(198, 204); // // toolStripMenuItem9 // toolStripMenuItem9.Name = "toolStripMenuItem9"; - toolStripMenuItem9.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem9.Size = new System.Drawing.Size(194, 6); // // toolStripMenuItem15 // toolStripMenuItem15.Name = "toolStripMenuItem15"; - toolStripMenuItem15.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem15.Size = new System.Drawing.Size(194, 6); // // manageApplicationToolStripMenuItem // manageApplicationToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { btnBrowseApplication, toolStripMenuItem25, advancedSettingsToolStripMenuItem }); manageApplicationToolStripMenuItem.Name = "manageApplicationToolStripMenuItem"; - manageApplicationToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + manageApplicationToolStripMenuItem.Size = new System.Drawing.Size(197, 22); manageApplicationToolStripMenuItem.Text = "Manage Application"; // // toolStripMenuItem25 @@ -1313,197 +1354,100 @@ private void InitializeComponent() // toolStripMenuItem16 // toolStripMenuItem16.Name = "toolStripMenuItem16"; - toolStripMenuItem16.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem16.Size = new System.Drawing.Size(194, 6); // // refreshToolStripMenuItem6 // refreshToolStripMenuItem6.Enabled = false; refreshToolStripMenuItem6.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem6.Name = "refreshToolStripMenuItem6"; - refreshToolStripMenuItem6.Size = new System.Drawing.Size(213, 22); + refreshToolStripMenuItem6.Size = new System.Drawing.Size(197, 22); refreshToolStripMenuItem6.Text = "Refresh"; // // removeToolStripMenuItem1 // removeToolStripMenuItem1.Name = "removeToolStripMenuItem1"; - removeToolStripMenuItem1.Size = new System.Drawing.Size(213, 22); + removeToolStripMenuItem1.Size = new System.Drawing.Size(197, 22); removeToolStripMenuItem1.Text = "Remove"; removeToolStripMenuItem1.Click += btnRemoveApplication_Click; // // toolStripMenuItem24 // toolStripMenuItem24.Name = "toolStripMenuItem24"; - toolStripMenuItem24.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem24.Size = new System.Drawing.Size(194, 6); // // switchToContentViewToolStripMenuItem3 // switchToContentViewToolStripMenuItem3.Enabled = false; switchToContentViewToolStripMenuItem3.Image = Main.Properties.Resources.switch_16; switchToContentViewToolStripMenuItem3.Name = "switchToContentViewToolStripMenuItem3"; - switchToContentViewToolStripMenuItem3.Size = new System.Drawing.Size(213, 22); + switchToContentViewToolStripMenuItem3.Size = new System.Drawing.Size(197, 22); switchToContentViewToolStripMenuItem3.Text = "Switch to Content View"; // - // cmsFarm - // - cmsFarm.Items.AddRange(new ToolStripItem[] { refreshToolStripMenuItem7, toolStripMenuItem29, btnCreateFarm, toolStripMenuItem30, switchToContentViewToolStripMenuItem4 }); - cmsFarm.Name = "cmsFarm"; - cmsFarm.Size = new System.Drawing.Size(214, 130); - // - // refreshToolStripMenuItem7 - // - refreshToolStripMenuItem7.Enabled = false; - refreshToolStripMenuItem7.Image = Main.Properties.Resources.refresh_16; - refreshToolStripMenuItem7.Name = "refreshToolStripMenuItem7"; - refreshToolStripMenuItem7.Size = new System.Drawing.Size(213, 22); - refreshToolStripMenuItem7.Text = "Refresh"; - // - // toolStripMenuItem29 - // - toolStripMenuItem29.Name = "toolStripMenuItem29"; - toolStripMenuItem29.Size = new System.Drawing.Size(210, 6); - // - // btnCreateFarm - // - btnCreateFarm.Name = "btnCreateFarm"; - btnCreateFarm.Size = new System.Drawing.Size(213, 22); - btnCreateFarm.Text = "Create Server Farm..."; - btnCreateFarm.Click += btnCreateFarm_Click; - // - // toolStripMenuItem30 - // - toolStripMenuItem30.Name = "toolStripMenuItem30"; - toolStripMenuItem30.Size = new System.Drawing.Size(210, 6); - // - // switchToContentViewToolStripMenuItem4 - // - switchToContentViewToolStripMenuItem4.Enabled = false; - switchToContentViewToolStripMenuItem4.Image = Main.Properties.Resources.switch_16; - switchToContentViewToolStripMenuItem4.Name = "switchToContentViewToolStripMenuItem4"; - switchToContentViewToolStripMenuItem4.Size = new System.Drawing.Size(213, 22); - switchToContentViewToolStripMenuItem4.Text = "Switch to Content View"; - // - // cmsFarmServer - // - cmsFarmServer.Items.AddRange(new ToolStripItem[] { refreshToolStripMenuItem8, btnRemoveFarmServer, toolStripMenuItem31, btnAddFarmServer, toolStripMenuItem32, btnRenameFarmServer, toolStripMenuItem33, switchToContentViewToolStripMenuItem5 }); - cmsFarmServer.Name = "cmsFarmServer"; - cmsFarmServer.Size = new System.Drawing.Size(214, 212); - // - // refreshToolStripMenuItem8 - // - refreshToolStripMenuItem8.Enabled = false; - refreshToolStripMenuItem8.Image = Main.Properties.Resources.refresh_16; - refreshToolStripMenuItem8.Name = "refreshToolStripMenuItem8"; - refreshToolStripMenuItem8.Size = new System.Drawing.Size(213, 22); - refreshToolStripMenuItem8.Text = "Refresh"; - // - // btnRemoveFarmServer - // - btnRemoveFarmServer.Name = "btnRemoveFarmServer"; - btnRemoveFarmServer.Size = new System.Drawing.Size(213, 22); - btnRemoveFarmServer.Text = "Remove"; - btnRemoveFarmServer.Click += btnRemoveFarmServer_Click; - // - // toolStripMenuItem31 - // - toolStripMenuItem31.Name = "toolStripMenuItem31"; - toolStripMenuItem31.Size = new System.Drawing.Size(210, 6); - // - // btnAddFarmServer - // - btnAddFarmServer.Name = "btnAddFarmServer"; - btnAddFarmServer.Size = new System.Drawing.Size(213, 22); - btnAddFarmServer.Text = "Add Server..."; - btnAddFarmServer.Click += btnAddFarmServer_Click; - // - // toolStripMenuItem32 - // - toolStripMenuItem32.Name = "toolStripMenuItem32"; - toolStripMenuItem32.Size = new System.Drawing.Size(210, 6); - // - // btnRenameFarmServer - // - btnRenameFarmServer.Enabled = false; - btnRenameFarmServer.Name = "btnRenameFarmServer"; - btnRenameFarmServer.Size = new System.Drawing.Size(213, 22); - btnRenameFarmServer.Text = "Rename"; - // - // toolStripMenuItem33 - // - toolStripMenuItem33.Name = "toolStripMenuItem33"; - toolStripMenuItem33.Size = new System.Drawing.Size(210, 6); - // - // switchToContentViewToolStripMenuItem5 - // - switchToContentViewToolStripMenuItem5.Enabled = false; - switchToContentViewToolStripMenuItem5.Image = Main.Properties.Resources.switch_16; - switchToContentViewToolStripMenuItem5.Name = "switchToContentViewToolStripMenuItem5"; - switchToContentViewToolStripMenuItem5.Size = new System.Drawing.Size(213, 22); - switchToContentViewToolStripMenuItem5.Text = "Switch to Content View"; - // // cmsServers // cmsServers.Items.AddRange(new ToolStripItem[] { refreshToolStripMenuItem9, toolStripMenuItem34, addServerToolStripMenuItem, toolStripMenuItem35, switchToContentViewToolStripMenuItem6 }); cmsServers.Name = "cmsServers"; - cmsServers.Size = new System.Drawing.Size(214, 130); + cmsServers.Size = new System.Drawing.Size(198, 82); // // refreshToolStripMenuItem9 // refreshToolStripMenuItem9.Image = Main.Properties.Resources.refresh_16; refreshToolStripMenuItem9.Name = "refreshToolStripMenuItem9"; - refreshToolStripMenuItem9.Size = new System.Drawing.Size(213, 22); + refreshToolStripMenuItem9.Size = new System.Drawing.Size(197, 22); refreshToolStripMenuItem9.Text = "Refresh"; // // toolStripMenuItem34 // toolStripMenuItem34.Name = "toolStripMenuItem34"; - toolStripMenuItem34.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem34.Size = new System.Drawing.Size(194, 6); // // addServerToolStripMenuItem // addServerToolStripMenuItem.Name = "addServerToolStripMenuItem"; - addServerToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + addServerToolStripMenuItem.Size = new System.Drawing.Size(197, 22); addServerToolStripMenuItem.Text = "Add Server..."; // // toolStripMenuItem35 // toolStripMenuItem35.Name = "toolStripMenuItem35"; - toolStripMenuItem35.Size = new System.Drawing.Size(210, 6); + toolStripMenuItem35.Size = new System.Drawing.Size(194, 6); // // switchToContentViewToolStripMenuItem6 // switchToContentViewToolStripMenuItem6.Image = Main.Properties.Resources.switch_16; switchToContentViewToolStripMenuItem6.Name = "switchToContentViewToolStripMenuItem6"; - switchToContentViewToolStripMenuItem6.Size = new System.Drawing.Size(213, 22); + switchToContentViewToolStripMenuItem6.Size = new System.Drawing.Size(197, 22); switchToContentViewToolStripMenuItem6.Text = "Switch to Content View"; // // cmsVirtualDirectory // cmsVirtualDirectory.Items.AddRange(new ToolStripItem[] { toolStripMenuItem36, toolStripMenuItem37, toolStripSeparator3, convertToApplicationToolStripMenuItem, toolStripMenuItem38, toolStripMenuItem39, toolStripSeparator4, manageVirtualDirectoryToolStripMenuItem, toolStripSeparator6, toolStripMenuItem43, toolStripMenuItem44, toolStripSeparator7, toolStripMenuItem45 }); cmsVirtualDirectory.Name = "cmsApplication"; - cmsVirtualDirectory.Size = new System.Drawing.Size(222, 370); + cmsVirtualDirectory.Size = new System.Drawing.Size(206, 226); // // toolStripSeparator3 // toolStripSeparator3.Name = "toolStripSeparator3"; - toolStripSeparator3.Size = new System.Drawing.Size(218, 6); + toolStripSeparator3.Size = new System.Drawing.Size(202, 6); // // convertToApplicationToolStripMenuItem // convertToApplicationToolStripMenuItem.Image = Main.Properties.Resources.application_new_16; convertToApplicationToolStripMenuItem.Name = "convertToApplicationToolStripMenuItem"; - convertToApplicationToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + convertToApplicationToolStripMenuItem.Size = new System.Drawing.Size(205, 22); convertToApplicationToolStripMenuItem.Text = "Convert to Application"; // // toolStripSeparator4 // toolStripSeparator4.Name = "toolStripSeparator4"; - toolStripSeparator4.Size = new System.Drawing.Size(218, 6); + toolStripSeparator4.Size = new System.Drawing.Size(202, 6); // // manageVirtualDirectoryToolStripMenuItem // manageVirtualDirectoryToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem41, toolStripSeparator5, toolStripMenuItem42 }); manageVirtualDirectoryToolStripMenuItem.Name = "manageVirtualDirectoryToolStripMenuItem"; - manageVirtualDirectoryToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + manageVirtualDirectoryToolStripMenuItem.Size = new System.Drawing.Size(205, 22); manageVirtualDirectoryToolStripMenuItem.Text = "Manage Virtual Directory"; // // toolStripSeparator5 @@ -1521,96 +1465,96 @@ private void InitializeComponent() // toolStripSeparator6 // toolStripSeparator6.Name = "toolStripSeparator6"; - toolStripSeparator6.Size = new System.Drawing.Size(218, 6); + toolStripSeparator6.Size = new System.Drawing.Size(202, 6); // // toolStripMenuItem43 // toolStripMenuItem43.Enabled = false; toolStripMenuItem43.Image = Main.Properties.Resources.refresh_16; toolStripMenuItem43.Name = "toolStripMenuItem43"; - toolStripMenuItem43.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem43.Size = new System.Drawing.Size(205, 22); toolStripMenuItem43.Text = "Refresh"; // // toolStripMenuItem44 // toolStripMenuItem44.Name = "toolStripMenuItem44"; - toolStripMenuItem44.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem44.Size = new System.Drawing.Size(205, 22); toolStripMenuItem44.Text = "Remove"; toolStripMenuItem44.Click += btnRemoveVirtualDirectory_Click; // // toolStripSeparator7 // toolStripSeparator7.Name = "toolStripSeparator7"; - toolStripSeparator7.Size = new System.Drawing.Size(218, 6); + toolStripSeparator7.Size = new System.Drawing.Size(202, 6); // // toolStripMenuItem45 // toolStripMenuItem45.Enabled = false; toolStripMenuItem45.Image = Main.Properties.Resources.switch_16; toolStripMenuItem45.Name = "toolStripMenuItem45"; - toolStripMenuItem45.Size = new System.Drawing.Size(221, 22); + toolStripMenuItem45.Size = new System.Drawing.Size(205, 22); toolStripMenuItem45.Text = "Switch to Content View"; // // cmsPhysicalDirectory // cmsPhysicalDirectory.Items.AddRange(new ToolStripItem[] { toolStripMenuItem46, toolStripMenuItem47, toolStripSeparator8, toolStripMenuItem48, toolStripMenuItem49, toolStripMenuItem50, toolStripSeparator9, manageFolderToolStripMenuItem, toolStripSeparator11, toolStripMenuItem54, toolStripSeparator12, toolStripMenuItem56 }); cmsPhysicalDirectory.Name = "cmsPhysicalDirectory"; - cmsPhysicalDirectory.Size = new System.Drawing.Size(214, 332); + cmsPhysicalDirectory.Size = new System.Drawing.Size(198, 204); // // toolStripSeparator8 // toolStripSeparator8.Name = "toolStripSeparator8"; - toolStripSeparator8.Size = new System.Drawing.Size(210, 6); + toolStripSeparator8.Size = new System.Drawing.Size(194, 6); // // toolStripMenuItem48 // toolStripMenuItem48.Image = Main.Properties.Resources.application_new_16; toolStripMenuItem48.Name = "toolStripMenuItem48"; - toolStripMenuItem48.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem48.Size = new System.Drawing.Size(197, 22); toolStripMenuItem48.Text = "Convert to Application"; // // toolStripSeparator9 // toolStripSeparator9.Name = "toolStripSeparator9"; - toolStripSeparator9.Size = new System.Drawing.Size(210, 6); + toolStripSeparator9.Size = new System.Drawing.Size(194, 6); // // manageFolderToolStripMenuItem // manageFolderToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem52 }); manageFolderToolStripMenuItem.Name = "manageFolderToolStripMenuItem"; - manageFolderToolStripMenuItem.Size = new System.Drawing.Size(213, 22); + manageFolderToolStripMenuItem.Size = new System.Drawing.Size(197, 22); manageFolderToolStripMenuItem.Text = "Manage Folder"; // // toolStripSeparator11 // toolStripSeparator11.Name = "toolStripSeparator11"; - toolStripSeparator11.Size = new System.Drawing.Size(210, 6); + toolStripSeparator11.Size = new System.Drawing.Size(194, 6); // // toolStripMenuItem54 // toolStripMenuItem54.Enabled = false; toolStripMenuItem54.Image = Main.Properties.Resources.refresh_16; toolStripMenuItem54.Name = "toolStripMenuItem54"; - toolStripMenuItem54.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem54.Size = new System.Drawing.Size(197, 22); toolStripMenuItem54.Text = "Refresh"; // // toolStripSeparator12 // toolStripSeparator12.Name = "toolStripSeparator12"; - toolStripSeparator12.Size = new System.Drawing.Size(210, 6); + toolStripSeparator12.Size = new System.Drawing.Size(194, 6); // // toolStripMenuItem56 // toolStripMenuItem56.Enabled = false; toolStripMenuItem56.Image = Main.Properties.Resources.switch_16; toolStripMenuItem56.Name = "toolStripMenuItem56"; - toolStripMenuItem56.Size = new System.Drawing.Size(213, 22); + toolStripMenuItem56.Size = new System.Drawing.Size(197, 22); toolStripMenuItem56.Text = "Switch to Content View"; // // _logSplitter // _logSplitter.Dock = DockStyle.Fill; - _logSplitter.Location = new System.Drawing.Point(0, 24); + _logSplitter.Location = new System.Drawing.Point(0, 49); _logSplitter.Name = "_logSplitter"; _logSplitter.Orientation = Orientation.Horizontal; // @@ -1624,7 +1568,7 @@ private void InitializeComponent() _logSplitter.Panel2.Controls.Add(_logPanel); _logSplitter.Panel2Collapsed = true; _logSplitter.Panel2MinSize = 50; - _logSplitter.Size = new System.Drawing.Size(915, 451); + _logSplitter.Size = new System.Drawing.Size(915, 426); _logSplitter.SplitterDistance = 100; _logSplitter.SplitterWidth = 5; _logSplitter.TabIndex = 6; @@ -1634,16 +1578,29 @@ private void InitializeComponent() _logPanel.Dock = DockStyle.Fill; _logPanel.Location = new System.Drawing.Point(0, 0); _logPanel.Name = "_logPanel"; - _logPanel.Size = new System.Drawing.Size(915, 100); + _logPanel.Size = new System.Drawing.Size(150, 46); _logPanel.TabIndex = 0; // + // tsTop + // + tsTop.AllowMerge = false; + tsTop.GripStyle = ToolStripGripStyle.Hidden; + tsTop.Items.AddRange(new ToolStripItem[] { toolStripButton1, toolStripButton2, tsbPath }); + tsTop.Location = new System.Drawing.Point(0, 0); + tsTop.Name = "tsTop"; + tsTop.Size = new System.Drawing.Size(915, 25); + tsTop.TabIndex = 9; + tsTop.Text = "toolStrip1"; + // // MainForm // + AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); AutoScaleMode = AutoScaleMode.Dpi; ClientSize = new System.Drawing.Size(915, 497); Controls.Add(_logSplitter); Controls.Add(statusStrip1); Controls.Add(menuStrip1); + Controls.Add(tsTop); KeyPreview = true; MainMenuStrip = menuStrip1; MinimumSize = new System.Drawing.Size(738, 504); @@ -1672,8 +1629,6 @@ private void InitializeComponent() ((ISupportInitialize)actionList1).EndInit(); cmsIis.ResumeLayout(false); cmsApplication.ResumeLayout(false); - cmsFarm.ResumeLayout(false); - cmsFarmServer.ResumeLayout(false); cmsServers.ResumeLayout(false); cmsVirtualDirectory.ResumeLayout(false); cmsPhysicalDirectory.ResumeLayout(false); @@ -1681,6 +1636,8 @@ private void InitializeComponent() _logSplitter.Panel2.ResumeLayout(false); ((ISupportInitialize)_logSplitter).EndInit(); _logSplitter.ResumeLayout(false); + tsTop.ResumeLayout(false); + tsTop.PerformLayout(); ResumeLayout(false); PerformLayout(); } @@ -1815,21 +1772,6 @@ private void InitializeComponent() private ToolStripStatusLabel txtInfo; private ToolStripSeparator toolStripMenuItem28; private ToolStripMenuItem btnUpdate; - private ContextMenuStrip cmsFarm; - private ToolStripMenuItem refreshToolStripMenuItem7; - private ToolStripSeparator toolStripMenuItem29; - private ToolStripMenuItem btnCreateFarm; - private ToolStripSeparator toolStripMenuItem30; - private ToolStripMenuItem switchToContentViewToolStripMenuItem4; - private ContextMenuStrip cmsFarmServer; - private ToolStripMenuItem refreshToolStripMenuItem8; - private ToolStripMenuItem btnRemoveFarmServer; - private ToolStripSeparator toolStripMenuItem31; - private ToolStripMenuItem btnAddFarmServer; - private ToolStripSeparator toolStripMenuItem32; - private ToolStripMenuItem switchToContentViewToolStripMenuItem5; - private ToolStripMenuItem btnRenameFarmServer; - private ToolStripSeparator toolStripMenuItem33; private ContextMenuStrip cmsServers; private ToolStripMenuItem refreshToolStripMenuItem9; private ToolStripSeparator toolStripMenuItem34; @@ -1880,5 +1822,9 @@ private void InitializeComponent() private SplitContainer _logSplitter; private Panel _logPanel; private ToolStripStatusLabel txtPathToSite; + private ToolStrip tsTop; + private ToolStripButton toolStripButton1; + private ToolStripButton toolStripButton2; + private ToolStripBreadcrumbItem tsbPath; } } diff --git a/JexusManager/MainForm.cs b/JexusManager/MainForm.cs index 1df21297..53126a46 100644 --- a/JexusManager/MainForm.cs +++ b/JexusManager/MainForm.cs @@ -60,6 +60,7 @@ namespace JexusManager using System.Diagnostics; using Microsoft.Extensions.Logging; using System.Drawing; + using JexusManager.Breadcrumb; public sealed partial class MainForm : Form { @@ -68,6 +69,7 @@ public sealed partial class MainForm : Form private readonly List _providers; private readonly ServiceContainer _serviceContainer; private readonly NavigationService _navigationService; + private bool _fromBreadcrumb; private TreeNode IisExpressRoot { get; } private TreeNode IisRoot { get; } private TreeNode JexusRoot { get; } @@ -95,7 +97,6 @@ public MainForm(List files, RichTextBox textBox) removeToolStripMenuItem.Image = DefaultTaskList.RemoveImage; removeToolStripMenuItem1.Image = DefaultTaskList.RemoveImage; - btnRemoveFarmServer.Image = DefaultTaskList.RemoveImage; toolStripMenuItem44.Image = DefaultTaskList.RemoveImage; Icon = Resources.iis; @@ -662,18 +663,6 @@ internal void RemoveSiteNode(Site site) } } - internal void RemoveFarmNode(string name) - { - //var data = GetCurrentData(); - //foreach (TreeNode node in data.FarmNode.Nodes) - //{ - // if (node.Text == name) - // { - // node.Remove(); - // } - //} - } - private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (IsDisposed) @@ -699,9 +688,14 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) LogHelper.GetLogger().LogWarning("Wrong node type: {Type} Name: {Text}", e.Node.GetType().FullName, e.Node.Text); } + // Clear breadcrumb if node is not a ManagerTreeNode + tsbPath.Clear(); return; } + // Update the breadcrumb navigation + UpdateBreadcrumbPath(node); + var serverNode = node as ServerTreeNode; actUp.Enabled = !(serverNode != null || node is PlaceholderTreeNode); if (serverNode != null) @@ -714,7 +708,7 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) actDisconnect.Enabled = !serverNode.IsBusy && !serverNode.IgnoreInCache; EnableServerMenuItems(serverNode.ServerManager != null); serverNode.LoadPanels(this, _serviceContainer, _providers); - ShowInfo($"Ready. {node.FullPath}"); + ShowInfo($"Ready."); return; } @@ -724,7 +718,7 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) toolStripMenuItem12.Visible = canBrowse; manageWebsiteToolStripMenuItem.Visible = canBrowse; siteNode.LoadPanels(this, _serviceContainer, _providers); - ShowInfo($"Ready. {node.FullPath}"); + ShowInfo($"Ready."); return; } @@ -734,7 +728,7 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) toolStripMenuItem15.Visible = canBrowse; manageApplicationToolStripMenuItem.Visible = canBrowse; appNode.LoadPanels(this, _serviceContainer, _providers); - ShowInfo($"Ready. {node.FullPath}"); + ShowInfo($"Ready."); return; } @@ -744,7 +738,7 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) toolStripSeparator4.Visible = canBrowse; manageVirtualDirectoryToolStripMenuItem.Visible = canBrowse; vdirNode.LoadPanels(this, _serviceContainer, _providers); - ShowInfo($"Ready. {node.FullPath}"); + ShowInfo($"Ready."); return; } @@ -754,12 +748,55 @@ private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) toolStripSeparator9.Visible = canBrowse; manageFolderToolStripMenuItem.Visible = canBrowse; physNode.LoadPanels(this, _serviceContainer, _providers); - ShowInfo($"Ready. {node.FullPath}"); + ShowInfo($"Ready."); return; } node.LoadPanels(this, _serviceContainer, _providers); - ShowInfo($"Ready. {node.FullPath}"); + ShowInfo($"Ready."); + } + + /// + /// Updates the breadcrumb path based on the selected node. + /// + /// The selected node + private void UpdateBreadcrumbPath(ManagerTreeNode node) + { + if (_fromBreadcrumb) + { + _fromBreadcrumb = false; + return; + } + + // Clear existing breadcrumb items + tsbPath.Clear(); + + // If no node selected, return + if (node == null) + return; + + // Build a list of nodes from root to the current node + var nodePath = new List(); + ManagerTreeNode current = node; + + // Traverse up the tree to the root + while (current != null) + { + nodePath.Insert(0, current); + current = current.Parent as ManagerTreeNode; + } + + // Add each node to the breadcrumb + foreach (var pathNode in nodePath) + { + tsbPath.AddItem(pathNode.Text, pathNode); + } + + // Set the selected index to the last item + if (tsbPath.Items.Count > 0) + { + tsbPath.SelectedIndex = tsbPath.Items.Count - 1; + } } internal void EnableServerMenuItems(bool enabled) @@ -1136,64 +1173,6 @@ private async void btnUpdate_Click(object sender, EventArgs e) treeView1.SelectedNode = StartPage; } - private void btnRemoveFarmServer_Click(object sender, EventArgs e) - { - treeView1.SelectedNode.Remove(); - } - - private void btnAddFarmServer_Click(object sender, EventArgs e) - { - //var dialog = new NewFarmServerDialog(); - //if (dialog.ShowDialog() == DialogResult.Cancel) - //{ - // return; - //} - - //var node = treeView1.SelectedNode; - //if (node.ImageIndex == 8) - //{ - // node = node.Nodes[0]; - //} - - //if (node.ImageIndex == 9) - //{ - // var servers = (List)node.Tag; - // servers.AddRange(dialog.Servers); - //} - } - - private void btnCreateFarm_Click(object sender, EventArgs e) - { - //var dialog = new FarmWizard(); - //if (dialog.ShowDialog() == DialogResult.Cancel) - //{ - // return; - //} - - //var config = _current.Server.GetApplicationHostConfiguration(); - //ConfigurationSection webFarmsSection = config.GetSection("webFarms"); - //ConfigurationElementCollection webFarmsCollection = webFarmsSection.GetCollection(); - //ConfigurationElement webFarmElement = webFarmsCollection.CreateElement("webFarm"); - //webFarmElement["name"] = dialog.FarmName; - //ConfigurationElementCollection webFarmCollection = webFarmElement.GetCollection(); - - //foreach (var server in dialog.Servers) - //{ - // ConfigurationElement serverElement = webFarmCollection.CreateElement("server"); - // serverElement["address"] = server.Name; - // serverElement["enabled"] = true; - - // ConfigurationElement applicationRequestRoutingElement = serverElement.GetChildElement("applicationRequestRouting"); - // applicationRequestRoutingElement["weight"] = server.Weight; - // applicationRequestRoutingElement["httpPort"] = server.HttpPort; - // applicationRequestRoutingElement["httpsPort"] = server.HttpsPort; - // webFarmCollection.Add(serverElement); - //} - - //webFarmsCollection.Add(webFarmElement); - //AddFarmNode(dialog.FarmName, dialog.Servers); - } - private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e) { ((ManagerTreeNode)e.Node).Expand(this); @@ -1530,5 +1509,18 @@ public void LoadPageAndSelectNode(IModulePage page, object navigationData) // Then select the corresponding node in the tree view SelectNodeForPage(page, navigationData); } + + private void TsbPath_ItemClicked(object sender, BreadcrumbItemClickedEventArgs e) + { + var item = e.Item; + var node = item.Tag as ManagerTreeNode; + if (node == null) + { + return; + } + + _fromBreadcrumb = true; + treeView1.SelectedNode = node; + } } } diff --git a/JexusManager/MainForm.resx b/JexusManager/MainForm.resx index f6c15f92..62d6d7ab 100644 --- a/JexusManager/MainForm.resx +++ b/JexusManager/MainForm.resx @@ -1,7 +1,7 @@