Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / PerformanceCounterPermissionAttribute.cs / 1305376 / PerformanceCounterPermissionAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Diagnostics { using System.ComponentModel; using System.Security; using System.Security.Permissions; [ AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly | AttributeTargets.Event, AllowMultiple = true, Inherited = false ), Serializable() ] public class PerformanceCounterPermissionAttribute : CodeAccessSecurityAttribute { private string categoryName; private string machineName; private PerformanceCounterPermissionAccess permissionAccess; public PerformanceCounterPermissionAttribute(SecurityAction action) : base(action) { this.categoryName = "*"; this.machineName = "."; this.permissionAccess = PerformanceCounterPermissionAccess.Write; } public string CategoryName { get { return this.categoryName; } set { if (value == null) throw new ArgumentNullException("value"); this.categoryName = value; } } public string MachineName { get { return this.machineName; } set { if (!SyntaxCheck.CheckMachineName(value)) throw new ArgumentException(SR.GetString(SR.InvalidProperty, "MachineName", value)); this.machineName = value; } } public PerformanceCounterPermissionAccess PermissionAccess { get { return this.permissionAccess; } set { this.permissionAccess = value; } } public override IPermission CreatePermission() { if (Unrestricted) return new PerformanceCounterPermission(PermissionState.Unrestricted); return new PerformanceCounterPermission(this.PermissionAccess, this.MachineName, this.CategoryName); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Diagnostics { using System.ComponentModel; using System.Security; using System.Security.Permissions; [ AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly | AttributeTargets.Event, AllowMultiple = true, Inherited = false ), Serializable() ] public class PerformanceCounterPermissionAttribute : CodeAccessSecurityAttribute { private string categoryName; private string machineName; private PerformanceCounterPermissionAccess permissionAccess; public PerformanceCounterPermissionAttribute(SecurityAction action) : base(action) { this.categoryName = "*"; this.machineName = "."; this.permissionAccess = PerformanceCounterPermissionAccess.Write; } public string CategoryName { get { return this.categoryName; } set { if (value == null) throw new ArgumentNullException("value"); this.categoryName = value; } } public string MachineName { get { return this.machineName; } set { if (!SyntaxCheck.CheckMachineName(value)) throw new ArgumentException(SR.GetString(SR.InvalidProperty, "MachineName", value)); this.machineName = value; } } public PerformanceCounterPermissionAccess PermissionAccess { get { return this.permissionAccess; } set { this.permissionAccess = value; } } public override IPermission CreatePermission() { if (Unrestricted) return new PerformanceCounterPermission(PermissionState.Unrestricted); return new PerformanceCounterPermission(this.PermissionAccess, this.MachineName, this.CategoryName); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlInputRadioButton.cs
- ActivationArguments.cs
- DataGridViewCellEventArgs.cs
- WebBrowserSiteBase.cs
- DataColumnCollection.cs
- MultilineStringConverter.cs
- AppDomainAttributes.cs
- XslCompiledTransform.cs
- StringCollection.cs
- InvalidOleVariantTypeException.cs
- HtmlElementCollection.cs
- BigInt.cs
- PropertyValue.cs
- QueryStringParameter.cs
- StylusShape.cs
- ReflectionUtil.cs
- QueryContinueDragEvent.cs
- UrlPropertyAttribute.cs
- HttpPostedFile.cs
- PageThemeParser.cs
- MILUtilities.cs
- DeploymentExceptionMapper.cs
- SR.cs
- DataRowView.cs
- ImplicitInputBrush.cs
- _CookieModule.cs
- ButtonBase.cs
- ToggleButtonAutomationPeer.cs
- PersianCalendar.cs
- Typography.cs
- XmlSchemaFacet.cs
- CacheVirtualItemsEvent.cs
- SqlMethodAttribute.cs
- DockAndAnchorLayout.cs
- RowTypePropertyElement.cs
- MetadataArtifactLoaderFile.cs
- ColorMatrix.cs
- EntityDataSourceContextCreatingEventArgs.cs
- DataListDesigner.cs
- PhoneCall.cs
- LinearGradientBrush.cs
- WindowsToolbarItemAsMenuItem.cs
- WebBrowserNavigatedEventHandler.cs
- InputDevice.cs
- HashJoinQueryOperatorEnumerator.cs
- TemplateGroupCollection.cs
- ParamArrayAttribute.cs
- GZipStream.cs
- DataSvcMapFile.cs
- AddInContractAttribute.cs
- HttpListenerException.cs
- DiffuseMaterial.cs
- CharacterString.cs
- Typography.cs
- TimeSpan.cs
- IntegerValidator.cs
- WindowsTokenRoleProvider.cs
- SimpleModelProvider.cs
- ValueQuery.cs
- ComboBox.cs
- FixUp.cs
- EtwTrackingParticipant.cs
- TextRange.cs
- PixelFormatConverter.cs
- IArgumentProvider.cs
- CodeBlockBuilder.cs
- DataGridRelationshipRow.cs
- MultipartIdentifier.cs
- AssemblyAssociatedContentFileAttribute.cs
- DigitShape.cs
- FormView.cs
- sqlnorm.cs
- ModelToObjectValueConverter.cs
- MonthChangedEventArgs.cs
- NavigationCommands.cs
- ItemsControlAutomationPeer.cs
- wmiutil.cs
- IndentedTextWriter.cs
- SimpleTableProvider.cs
- HashMembershipCondition.cs
- FileDialog.cs
- URL.cs
- SecurityContextSecurityTokenAuthenticator.cs
- Activator.cs
- HeaderCollection.cs
- TypeUtil.cs
- DataGridViewRowCollection.cs
- _Connection.cs
- RecordBuilder.cs
- DynamicHyperLink.cs
- ValidationEventArgs.cs
- CustomGrammar.cs
- EncoderBestFitFallback.cs
- FormView.cs
- Bold.cs
- SpellCheck.cs
- XmlSchemaValidator.cs
- DataObject.cs
- DbParameterCollectionHelper.cs
- BaseCAMarshaler.cs