-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port MonthCalendarDesigner to runtime (#9536)
* Port MonthCalendarDesigner to runtime * Delete unnecessary namespace * Delete redundant assertions and redundant judgment conditions * Update MonthCalendarDesigner.cs to use file-scoped namespaces
- Loading branch information
Showing
4 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/MonthCalendarDesigner.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace System.Windows.Forms.Design; | ||
|
||
internal class MonthCalendarDesigner : ControlDesigner | ||
{ | ||
public MonthCalendarDesigner() | ||
{ | ||
AutoResizeHandles = true; | ||
} | ||
|
||
/// <summary> | ||
/// Retrieves a set of rules concerning the movement capabilities of a component. | ||
/// This should be one or more flags from the SelectionRules class. If no designer | ||
/// provides rules for a component, the component will not get any UI services. | ||
/// </summary> | ||
public override SelectionRules SelectionRules | ||
{ | ||
get | ||
{ | ||
SelectionRules rules = base.SelectionRules; | ||
|
||
if (Control.Parent is null || !Control.Parent.IsMirrored) | ||
{ | ||
rules &= ~(SelectionRules.TopSizeable | SelectionRules.LeftSizeable); | ||
} | ||
else | ||
{ | ||
rules &= ~(SelectionRules.TopSizeable | SelectionRules.RightSizeable); | ||
} | ||
|
||
return rules; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters