Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LocatorManager.cs
- DesignSurfaceEvent.cs
- LinkUtilities.cs
- Speller.cs
- WorkflowClientDeliverMessageWrapper.cs
- BordersPage.cs
- ToolboxItemFilterAttribute.cs
- ToolStripManager.cs
- CachedRequestParams.cs
- PropertyTab.cs
- CodeEventReferenceExpression.cs
- WindowPatternIdentifiers.cs
- ProtocolsConfiguration.cs
- CryptoApi.cs
- SQLDateTime.cs
- XmlJsonReader.cs
- FigureHelper.cs
- PriorityBindingExpression.cs
- RuleSettingsCollection.cs
- HijriCalendar.cs
- XmlBoundElement.cs
- DesignUtil.cs
- DummyDataSource.cs
- BindingBase.cs
- ChtmlTextWriter.cs
- XmlSchemaImporter.cs
- Simplifier.cs
- MulticastIPAddressInformationCollection.cs
- FileClassifier.cs
- UnsafeNetInfoNativeMethods.cs
- cryptoapiTransform.cs
- ServiceContractGenerator.cs
- ResourceReader.cs
- ContextMenu.cs
- ColorMatrix.cs
- TextTreeRootTextBlock.cs
- ExtensionFile.cs
- XamlToRtfWriter.cs
- VarRefManager.cs
- CustomWebEventKey.cs
- StatusBarItemAutomationPeer.cs
- LocatorManager.cs
- CombinedTcpChannel.cs
- HitTestWithGeometryDrawingContextWalker.cs
- RulePatternOps.cs
- HttpApplication.cs
- _LocalDataStoreMgr.cs
- SortedDictionary.cs
- DelegatedStream.cs
- HandlerWithFactory.cs
- ReceiveContent.cs
- BaseInfoTable.cs
- ConfigXmlAttribute.cs
- MultiBindingExpression.cs
- DataBindingList.cs
- CodeAssignStatement.cs
- OutputCacheSettingsSection.cs
- XsltOutput.cs
- Array.cs
- SymmetricAlgorithm.cs
- safex509handles.cs
- IMembershipProvider.cs
- XmlSerializerSection.cs
- ButtonBaseAdapter.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- StartUpEventArgs.cs
- MailMessageEventArgs.cs
- ReversePositionQuery.cs
- EnumMember.cs
- AttributeData.cs
- SQLDecimalStorage.cs
- FunctionQuery.cs
- XDRSchema.cs
- ObjectMemberMapping.cs
- ImageDrawing.cs
- SR.cs
- ConstrainedDataObject.cs
- IPHostEntry.cs
- TriggerActionCollection.cs
- SelectionRangeConverter.cs
- TableColumn.cs
- ObjectDataSourceEventArgs.cs
- Util.cs
- SiteMapDesignerDataSourceView.cs
- CharStorage.cs
- GetLedgerEntryForRecipientRequest.cs
- SerialPort.cs
- TransformGroup.cs
- LongSumAggregationOperator.cs
- HitTestParameters.cs
- ImageClickEventArgs.cs
- Imaging.cs
- TextBoxLine.cs
- LoginUtil.cs
- Substitution.cs
- NotifyInputEventArgs.cs
- PropertyTabAttribute.cs
- PackWebRequestFactory.cs
- LinqDataSource.cs
- ConfigXmlWhitespace.cs