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
- validationstate.cs
- GlyphRun.cs
- MonitorWrapper.cs
- LocalizableResourceBuilder.cs
- TreeNodeBindingCollection.cs
- StringComparer.cs
- ConfigurationConverterBase.cs
- MultiPageTextView.cs
- ObjectStateManagerMetadata.cs
- HttpCapabilitiesSectionHandler.cs
- cache.cs
- ManagedFilter.cs
- DefaultPropertiesToSend.cs
- MaskDescriptor.cs
- IOException.cs
- WithParamAction.cs
- InheritanceRules.cs
- TcpServerChannel.cs
- ClipboardData.cs
- Activator.cs
- FontStyle.cs
- EffectiveValueEntry.cs
- MarshalByValueComponent.cs
- ApplicationFileCodeDomTreeGenerator.cs
- BufferedGraphicsContext.cs
- XmlDownloadManager.cs
- GiveFeedbackEvent.cs
- PrintingPermission.cs
- ToolStripContainer.cs
- DataViewSettingCollection.cs
- EllipseGeometry.cs
- Int16Storage.cs
- SplitterEvent.cs
- SchemaEntity.cs
- SoapAttributeOverrides.cs
- IndentedWriter.cs
- TextParaLineResult.cs
- SerializableAttribute.cs
- MetabaseServerConfig.cs
- EventLogQuery.cs
- Clock.cs
- Boolean.cs
- TableParagraph.cs
- Compress.cs
- NamespaceQuery.cs
- FileChangesMonitor.cs
- XPathEmptyIterator.cs
- ServiceOperationParameter.cs
- FloaterParaClient.cs
- ReferenceEqualityComparer.cs
- MessageBuilder.cs
- StructuredTypeEmitter.cs
- CorrelationQuery.cs
- DbDataRecord.cs
- ErrorHandler.cs
- CurrentChangedEventManager.cs
- ListItemDetailViewAttribute.cs
- DataBinder.cs
- DataGridViewColumnStateChangedEventArgs.cs
- AttributeQuery.cs
- recordstate.cs
- XmlComplianceUtil.cs
- XmlSchemaObject.cs
- CompositeDuplexBindingElement.cs
- ToolStripCodeDomSerializer.cs
- Frame.cs
- TreeChangeInfo.cs
- StackSpiller.Generated.cs
- PackageStore.cs
- HtmlButton.cs
- HtmlHistory.cs
- MetafileHeader.cs
- IsolatedStorageSecurityState.cs
- InfoCardBaseException.cs
- OletxTransactionFormatter.cs
- PropertyMap.cs
- InkPresenter.cs
- UmAlQuraCalendar.cs
- CompositeDispatchFormatter.cs
- RtfFormatStack.cs
- StylusPointPropertyInfo.cs
- InnerItemCollectionView.cs
- SchemaEntity.cs
- HashJoinQueryOperatorEnumerator.cs
- LogSwitch.cs
- OperationAbortedException.cs
- BaseTemplateParser.cs
- ResourceWriter.cs
- BinaryConverter.cs
- DataRecordObjectView.cs
- SQLCharsStorage.cs
- WebEvents.cs
- MenuStrip.cs
- EntityReference.cs
- HwndSource.cs
- ConsoleEntryPoint.cs
- InputBindingCollection.cs
- ResolvedKeyFrameEntry.cs
- ServiceHostFactory.cs
- SqlRecordBuffer.cs