Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Services / Monitoring / system / Diagnosticts / PerformanceCounterPermissionAttribute.cs / 1 / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlUTF8TextReader.cs
- WebBrowserDocumentCompletedEventHandler.cs
- BidOverLoads.cs
- UIPermission.cs
- AudioFileOut.cs
- ListItemParagraph.cs
- PeerCollaboration.cs
- TextEditorTyping.cs
- Events.cs
- ProcessInputEventArgs.cs
- ComboBoxDesigner.cs
- GeometryDrawing.cs
- ConstructorNeedsTagAttribute.cs
- Switch.cs
- IndexedString.cs
- ImpersonateTokenRef.cs
- CodeDelegateInvokeExpression.cs
- SparseMemoryStream.cs
- DataServiceEntityAttribute.cs
- InfoCardCryptoHelper.cs
- NumberSubstitution.cs
- PublisherIdentityPermission.cs
- PeerNameRecord.cs
- RightsManagementEncryptedStream.cs
- UpdatePanelTrigger.cs
- BulletedList.cs
- MethodRental.cs
- FormatConvertedBitmap.cs
- GlobalProxySelection.cs
- SyndicationLink.cs
- PrinterSettings.cs
- HtmlInputFile.cs
- RadialGradientBrush.cs
- HtmlEncodedRawTextWriter.cs
- SchemaManager.cs
- NameValueConfigurationCollection.cs
- Attributes.cs
- AddInPipelineAttributes.cs
- ObjectDataSourceDisposingEventArgs.cs
- HeaderUtility.cs
- ControlCollection.cs
- HttpCapabilitiesSectionHandler.cs
- BinaryNode.cs
- nulltextnavigator.cs
- SizeLimitedCache.cs
- XMLUtil.cs
- CodeDOMProvider.cs
- SimpleMailWebEventProvider.cs
- DataSourceDescriptorCollection.cs
- OutputCacheSection.cs
- Boolean.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Single.cs
- DockingAttribute.cs
- _BaseOverlappedAsyncResult.cs
- httpapplicationstate.cs
- ObjectTag.cs
- WithParamAction.cs
- DoubleAnimation.cs
- SymLanguageVendor.cs
- CertificateManager.cs
- DoubleAnimationBase.cs
- MetadataUtilsSmi.cs
- Positioning.cs
- DataTable.cs
- StyleBamlRecordReader.cs
- TiffBitmapDecoder.cs
- SessionChannels.cs
- DataGridViewColumnStateChangedEventArgs.cs
- SortKey.cs
- X509Utils.cs
- LabelLiteral.cs
- AssemblyAssociatedContentFileAttribute.cs
- TreeNodeCollection.cs
- GroupStyle.cs
- ImmutableDispatchRuntime.cs
- DataControlFieldCell.cs
- ProcessStartInfo.cs
- RIPEMD160.cs
- ReaderContextStackData.cs
- MonthChangedEventArgs.cs
- UrlPath.cs
- FlatButtonAppearance.cs
- Separator.cs
- PathData.cs
- ApplicationFileCodeDomTreeGenerator.cs
- WaitForChangedResult.cs
- WinEventWrap.cs
- mediaeventshelper.cs
- ExpressionBuilder.cs
- CollectionBuilder.cs
- dbdatarecord.cs
- DeleteMemberBinder.cs
- GregorianCalendarHelper.cs
- ToolboxItemSnapLineBehavior.cs
- XmlAttributeOverrides.cs
- ModelUIElement3D.cs
- IntegerFacetDescriptionElement.cs
- FastEncoderWindow.cs
- XmlStringTable.cs