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
- WinEventTracker.cs
- ActivityCodeGenerator.cs
- CopyCodeAction.cs
- CodeComment.cs
- SimpleType.cs
- BuildProvidersCompiler.cs
- ConfigurationManagerInternalFactory.cs
- MultiplexingFormatMapping.cs
- ListView.cs
- CookielessData.cs
- TransformedBitmap.cs
- FillErrorEventArgs.cs
- ServiceModelEnumValidatorAttribute.cs
- ObjectDataSourceChooseMethodsPanel.cs
- MaskInputRejectedEventArgs.cs
- ReliabilityContractAttribute.cs
- TextBlock.cs
- TransformProviderWrapper.cs
- ConfigurationCollectionAttribute.cs
- SqlResolver.cs
- XpsFontSubsetter.cs
- Brush.cs
- OwnerDrawPropertyBag.cs
- CodeIdentifiers.cs
- ResolvedKeyFrameEntry.cs
- HttpModule.cs
- ServerIdentity.cs
- SchemaImporterExtensionsSection.cs
- StyleSelector.cs
- XamlTypeMapper.cs
- DragCompletedEventArgs.cs
- CalloutQueueItem.cs
- SymDocumentType.cs
- HelpProvider.cs
- TryExpression.cs
- lengthconverter.cs
- TextRenderer.cs
- WebPageTraceListener.cs
- WebSysDescriptionAttribute.cs
- VBIdentifierNameEditor.cs
- ByteAnimationUsingKeyFrames.cs
- XmlnsCompatibleWithAttribute.cs
- CodeExpressionStatement.cs
- DataSourceCacheDurationConverter.cs
- ExitEventArgs.cs
- XmlLinkedNode.cs
- DataServiceBuildProvider.cs
- ToolboxControl.cs
- Style.cs
- ProfileBuildProvider.cs
- ListViewInsertEventArgs.cs
- UpdatePanel.cs
- PrintPageEvent.cs
- DataContractSerializer.cs
- MetadataArtifactLoaderComposite.cs
- MachineKeyConverter.cs
- UpdatePanelTrigger.cs
- AuthenticationModulesSection.cs
- FontDifferentiator.cs
- TextRangeEdit.cs
- PackWebResponse.cs
- ControlBuilderAttribute.cs
- ModuleElement.cs
- DataGridLinkButton.cs
- HtmlTableCellCollection.cs
- FixedTextContainer.cs
- MessageBuilder.cs
- PackUriHelper.cs
- SqlDataSourceCommandEventArgs.cs
- RemoteArgument.cs
- XmlTypeMapping.cs
- ToolTipService.cs
- CompressStream.cs
- InstancePersistenceContext.cs
- HandlerFactoryWrapper.cs
- LogEntrySerializationException.cs
- WebPart.cs
- CodeConditionStatement.cs
- BitmapEffect.cs
- KeyMatchBuilder.cs
- Pkcs7Recipient.cs
- FamilyMapCollection.cs
- SslStream.cs
- SafeRegistryKey.cs
- WizardForm.cs
- DuplicateWaitObjectException.cs
- BamlResourceDeserializer.cs
- CompilerHelpers.cs
- BaseParser.cs
- ReferentialConstraintRoleElement.cs
- IntellisenseTextBox.designer.cs
- XmlBufferedByteStreamReader.cs
- RequestQueryProcessor.cs
- ViewKeyConstraint.cs
- ImageMap.cs
- OleDbConnectionFactory.cs
- ConnectionProviderAttribute.cs
- PropertyCondition.cs
- FormattedText.cs
- CodeNamespace.cs