Skip to content

Commit af4374a

Browse files
authored
Remove CAS attributes (#8014)
1 parent 9e9e2e0 commit af4374a

File tree

20 files changed

+97
-124
lines changed

20 files changed

+97
-124
lines changed

snippets/csharp/System.Drawing.Design/CategoryNameCollection/Overview/toolboxcategorynamescontrol.cs

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

1111
namespace ToolboxCategoryNamesControl
1212
{
13-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
14-
public class ToolboxCategoryNamesControl : System.Windows.Forms.UserControl
13+
public class ToolboxCategoryNamesControl : System.Windows.Forms.UserControl
1514
{
1615
private System.Drawing.Design.IToolboxService toolboxService;
1716
private System.Drawing.Design.CategoryNameCollection categoryNames;
@@ -68,4 +67,4 @@ protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
6867
}
6968
}
7069
}
71-
//</Snippet2>
70+
//</Snippet2>

snippets/csharp/System.Drawing.Design/IToolboxService/Overview/itoolboxservicecontrol.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace IToolboxServiceExample
1616
// categories and items, and to add components or controls
1717
// to the parent form using code.
1818
[DesignerAttribute(typeof(WindowMessageDesigner), typeof(IDesigner))]
19-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
2019
public class IToolboxServiceControl : System.Windows.Forms.UserControl
2120
{
2221
private System.Windows.Forms.ListBox listBox1;
@@ -208,7 +207,6 @@ public WindowMessageDesigner()
208207
}
209208

210209
// Window procedure override passes events to control.
211-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
212210
protected override void WndProc(ref System.Windows.Forms.Message m)
213211
{
214212
if( m.HWnd == this.Control.Handle )

snippets/csharp/System.Drawing.Design/IToolboxService/Overview/textdatatextboxcomponent.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace TextDataTextBoxComponent
1212
// Component that adds a "Text" data format ToolboxItemCreatorCallback
1313
// to the Toolbox. This component uses a custom ToolboxItem that
1414
// creates a TextBox containing the text data.
15-
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
1615
public class TextDataTextBoxComponent : Component
1716
{
1817
private bool creatorAdded = false;
@@ -124,7 +123,6 @@ protected override void Dispose(bool disposing)
124123

125124
// Custom toolbox item creates a TextBox and sets its Text property
126125
// to the constructor-specified text.
127-
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
128126
public class TextToolboxItem : ToolboxItem
129127
{
130128
private string text;
@@ -137,7 +135,6 @@ public TextToolboxItem(string text) : base()
137135

138136
// ToolboxItem.CreateComponentsCore override to create the TextBox
139137
// and link a method to set its Text property.
140-
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
141138
protected override IComponent[] CreateComponentsCore(IDesignerHost host)
142139
{
143140
System.Windows.Forms.TextBox textbox =

snippets/csharp/System.Drawing.Design/UITypeEditor/Overview/angleeditor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ namespace AngleEditor
1010
{
1111
// This UITypeEditor can be associated with Int32, Double and Single
1212
// properties to provide a design-mode angle selection interface.
13-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
1413
public class AngleEditor : System.Drawing.Design.UITypeEditor
1514
{
1615
public AngleEditor()

snippets/csharp/System.Drawing.Design/UITypeEditorEditStyle/Overview/marqueeborderdesigner.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// <snippet430>
1313
namespace MarqueeControlLibrary.Design
1414
{
15-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
1615
public class MarqueeBorderDesigner : ParentControlDesigner
1716
{
1817
// </snippet430>
@@ -87,4 +86,4 @@ private void OnVerbStopTest(object sender, EventArgs e)
8786
// </snippet460>
8887
}
8988
}
90-
// </snippet410>
89+
// </snippet410>

snippets/csharp/System.Drawing.Design/UITypeEditorEditStyle/Overview/marqueecontrolrootdesigner.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace MarqueeControlLibrary.Design
1515
{
1616
[ToolboxItemFilter("MarqueeControlLibrary.MarqueeBorder", ToolboxItemFilterType.Require)]
1717
[ToolboxItemFilter("MarqueeControlLibrary.MarqueeText", ToolboxItemFilterType.Require)]
18-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
1918
public class MarqueeControlRootDesigner : DocumentDesigner
2019
{
2120
// </snippet530>
@@ -87,4 +86,4 @@ private void OnVerbStopTest(object sender, EventArgs e)
8786
// </snippet570>
8887
}
8988
}
90-
// </snippet510>
89+
// </snippet510>

snippets/csharp/System.Drawing/Brushes/Overview/form1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
using System;
44
using System.Windows.Forms;
55

6-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
76
public class Form1:
87
System.Windows.Forms.Form
9-
108
{
119
#region " Windows Form Designer generated code "
1210

snippets/csharp/System.Drawing/BufferedGraphics/Render/bufferingexamples.cs

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

66
namespace BufferingExample
77
{
8-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
9-
108
public class BufferingExamples : Form
119
{
1210
private BufferedGraphicsContext appDomainBufferedGraphicsContext;
@@ -68,4 +66,4 @@ public static void Main(string[] args)
6866
Application.Run(new BufferingExamples());
6967
}
7068
}
71-
}
69+
}

snippets/csharp/System.Drawing/Graphics/FillRectangle/form1.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,8 @@ private void FillRegionRectangle(PaintEventArgs e)
182182

183183
// Snippet for: M:System.Drawing.Graphics.FromHdc(System.IntPtr)
184184
// <snippet118>
185-
[System.Security.Permissions.SecurityPermission(
186-
System.Security.Permissions.SecurityAction.LinkDemand, Flags =
187-
System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
188185
private void FromHdcHdc(PaintEventArgs e)
189186
{
190-
191187
// Get handle to device context.
192188
IntPtr hdc = e.Graphics.GetHdc();
193189

@@ -254,12 +250,8 @@ private static extern IntPtr SelectPalette(
254250
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
255251
private static extern int RealizePalette(IntPtr hdc);
256252

257-
[System.Security.Permissions.SecurityPermission(
258-
System.Security.Permissions.SecurityAction.LinkDemand, Flags =
259-
System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
260253
private void GetHalftonePaletteVoid(PaintEventArgs e)
261254
{
262-
263255
// Create and draw image.
264256
Image imageFile = Image.FromFile("SampImag.jpg");
265257
e.Graphics.DrawImage(imageFile, new Point(0, 0));
@@ -296,12 +288,8 @@ internal static extern bool Rectangle(
296288
int lrCornerX, int lrCornerY);
297289
}
298290

299-
[System.Security.Permissions.SecurityPermission(
300-
System.Security.Permissions.SecurityAction.LinkDemand, Flags =
301-
System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
302291
private void GetHdcForGDI1(PaintEventArgs e)
303292
{
304-
305293
// Create pen.
306294
Pen redPen = new Pen(Color.Red, 1);
307295

@@ -936,12 +924,8 @@ private static extern bool Rectangle2(
936924
int ulCornerX, int ulCornerY,
937925
int lrCornerX, int lrCornerY);
938926

939-
[System.Security.Permissions.SecurityPermission(
940-
System.Security.Permissions.SecurityAction.LinkDemand, Flags =
941-
System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
942927
private void GetHdcForGDI2(PaintEventArgs e)
943928
{
944-
945929
// Create pen.
946930
Pen redPen = new Pen(Color.Red, 1);
947931

snippets/csharp/System.Drawing/Graphics/Overview/form1.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace System.Drawing.ClassicGraphicsExamplesCS
1313
/// <summary>
1414
/// Summary description for Form1.
1515
/// </summary>
16-
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
1716
public class Form1 : System.Windows.Forms.Form
1817
{
1918
/// <summary>

0 commit comments

Comments
 (0)