Skip to content

Commit 2403570

Browse files
authored
Remove CAS attributes from snippets (#8007)
1 parent 9ceb610 commit 2403570

File tree

26 files changed

+63
-77
lines changed

26 files changed

+63
-77
lines changed

snippets/csharp/System.ComponentModel.Design/DesignerActionHeaderItem/Overview/designeractions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public override Color ForeColor
116116
// designer action panel.
117117
// Must add reference to System.Design.dll
118118
/////////////////////////////////////////////////////////////////
119-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
120119
public class ColorLabelDesigner :
121120
System.Windows.Forms.Design.ControlDesigner
122121
{

snippets/csharp/System.ComponentModel.Design/DesignerCollection/Overview/examplecomponent.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace DesignerCollectionExample
77
{
8-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
98
public class ExampleComponent : Component
109
{
1110
public ExampleComponent()
@@ -36,4 +35,4 @@ public void OutputDesignerCollectionInfo(DesignerCollection collection)
3635
//</Snippet3>
3736
}
3837
}
39-
}
38+
}

snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
namespace DesignerVerbCollectionExample
55
{
6-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
7-
public class Class1
6+
public class Class1
87
{
98
public Class1()
109
{
@@ -79,4 +78,4 @@ private void ExampleEvent(object sender, EventArgs e)
7978
{
8079
}
8180
}
82-
}
81+
}

snippets/csharp/System.ComponentModel.Design/IDesigner/Overview/testcontrol.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public TestControl()
1818
}
1919
}
2020

21-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
2221
public class ExampleIDesigner : System.ComponentModel.Design.IDesigner
2322
{
2423
// Local reference to the designer's component.
@@ -79,4 +78,4 @@ public void Dispose()
7978
}
8079
}
8180
}
82-
//</Snippet1>
81+
//</Snippet1>

snippets/csharp/System.ComponentModel.Design/IDesignerFilter/Overview/controldesignerexample.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
namespace ControlDesignerExample
1111
{
1212
// ExampleControlDesigner is an example control designer that
13-
// demonstrates basic functions of a ControlDesigner.
14-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
13+
// demonstrates basic functions of a ControlDesigner.
1514
public class ExampleControlDesigner : System.Windows.Forms.Design.ControlDesigner
1615
{
17-
// This boolean state reflects whether the mouse is over the control.
16+
// This Boolean state reflects whether the mouse is over the control.
1817
private bool mouseover = false;
1918
// This color is a private field for the OutlineColor property.
2019
private Color lineColor = Color.White;
@@ -108,4 +107,4 @@ protected override void Dispose( bool disposing )
108107
}
109108
}
110109
}
111-
//</snippet1>
110+
//</snippet1>

snippets/csharp/System.ComponentModel.Design/IDesignerHost/Overview/idesignerhostexample.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ protected override void Dispose( bool disposing )
2626
// You can double-click the component of an IDesignerHostExampleDesigner
2727
// to show a form containing a listbox that lists the name and type
2828
// of each component or control in the current design-time project.
29-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
3029
public class IDesignerHostExampleDesigner : IDesigner
3130
{
3231
private System.ComponentModel.IComponent component;
@@ -129,4 +128,4 @@ protected override void Dispose( bool disposing )
129128
}
130129
}
131130
}
132-
// </Snippet1>
131+
// </Snippet1>

snippets/csharp/System.ComponentModel.Design/IEventBindingService/Overview/source.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace EventDesignerTest
1616
// associated control.
1717
// If a "testEvent" event of the associated control does not exist,
1818
// the IEventBindingService declares it.
19-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
2019
public class EventDesigner : System.Windows.Forms.Design.ControlDesigner
2120
{
2221
public EventDesigner()

snippets/csharp/System.ComponentModel.Design/IMenuCommandService/Overview/component1.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ private void InitializeComponent()
2727
}
2828
}
2929

30-
//<Snippet1>
31-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
30+
//<Snippet1>
3231
public class CDesigner : System.ComponentModel.Design.ComponentDesigner
3332
{
3433
public override void Initialize(IComponent comp)
@@ -52,4 +51,4 @@ private void OnF1Help(object sender, EventArgs e)
5251
}
5352
//</Snippet1>
5453
}
55-
// </snippet10>
54+
// </snippet10>

snippets/csharp/System.ComponentModel.Design/ITypeResolutionService/Overview/ityperesolutionservicecontrol.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ public WindowMessageDesigner()
321321
}
322322

323323
// Window procedure override passes events to the control.
324-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
325324
protected override void WndProc(ref System.Windows.Forms.Message m)
326325
{
327326
if( m.HWnd == this.Control.Handle )

snippets/csharp/System.ComponentModel/IExtenderProvider/Overview/HelpLabel.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ public bool ShouldSerializeForeColor()
291291
// </desc>
292292
// </doc>
293293
//
294-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
295294
public class HelpLabelDesigner : System.Windows.Forms.Design.ControlDesigner
296295
{
297296

@@ -300,8 +299,8 @@ public class HelpLabelDesigner : System.Windows.Forms.Design.ControlDesigner
300299
/// <summary>
301300
/// This property is added to the control's set of properties in the method
302301
/// PreFilterProperties below. Note that on designers, properties that are
303-
/// explictly declared by TypeDescriptor.CreateProperty can be declared as
304-
/// private on the designer. This helps to keep the designer's publi
302+
/// explicitly declared by TypeDescriptor.CreateProperty can be declared as
303+
/// private on the designer. This helps to keep the designer's public
305304
/// object model clean.
306305
/// </summary>
307306
[DesignerSerializationVisibility( DesignerSerializationVisibility.Hidden )]

0 commit comments

Comments
 (0)