-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Collections; | ||
using System.ComponentModel.Design; | ||
|
||
namespace System.Windows.Forms.Design | ||
{ | ||
internal class NotifyIconDesigner : ComponentDesigner | ||
{ | ||
private DesignerActionListCollection? _actionLists; | ||
|
||
public override void InitializeNewComponent(IDictionary defaultValues) | ||
{ | ||
base.InitializeNewComponent(defaultValues); | ||
NotifyIcon icon = (NotifyIcon)Component; | ||
icon.Visible = true; | ||
} | ||
|
||
public override DesignerActionListCollection ActionLists | ||
{ | ||
get | ||
{ | ||
if (_actionLists is null) | ||
{ | ||
_actionLists = new DesignerActionListCollection(); | ||
_actionLists.Add(new NotifyIconActionList(this)); | ||
} | ||
|
||
return _actionLists; | ||
} | ||
} | ||
} | ||
|
||
internal class NotifyIconActionList : DesignerActionList | ||
{ | ||
private NotifyIconDesigner _designer; | ||
public NotifyIconActionList(NotifyIconDesigner designer) : base(designer.Component) | ||
{ | ||
_designer = designer; | ||
} | ||
|
||
public void ChooseIcon() | ||
{ | ||
EditorServiceContext.EditValue(_designer, Component, "Icon"); | ||
} | ||
|
||
public override DesignerActionItemCollection GetSortedActionItems() | ||
{ | ||
DesignerActionItemCollection items = new DesignerActionItemCollection(); | ||
items.Add(new DesignerActionMethodItem(this, "ChooseIcon", SR.ChooseIconDisplayName, true)); | ||
return items; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Collections; | ||
|
||
namespace System.Windows.Forms.Design; | ||
|
||
internal class PropertyGridDesigner : ControlDesigner | ||
{ | ||
protected override void PreFilterProperties(IDictionary properties) | ||
{ | ||
// Remove the ScrollableControl properties... | ||
properties.Remove(nameof(PropertyGrid.AutoScroll)); | ||
properties.Remove(nameof(PropertyGrid.AutoScrollMargin)); | ||
properties.Remove(nameof(PropertyGrid.AutoScrollMinSize)); | ||
properties.Remove(nameof(PropertyGrid.DockPadding)); | ||
|
||
base.PreFilterProperties(properties); | ||
} | ||
} |