Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Services / Monitoring / system / Diagnosticts / EventLogPermissionAttribute.cs / 1 / EventLogPermissionAttribute.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 EventLogPermissionAttribute : CodeAccessSecurityAttribute { private string machineName; private EventLogPermissionAccess permissionAccess; public EventLogPermissionAttribute(SecurityAction action) : base(action) { this.machineName = "."; this.permissionAccess = EventLogPermissionAccess.Write; } 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 EventLogPermissionAccess PermissionAccess { get { return this.permissionAccess; } set { this.permissionAccess = value; } } public override IPermission CreatePermission() { if (Unrestricted) return new EventLogPermission(PermissionState.Unrestricted); return new EventLogPermission(this.PermissionAccess, this.MachineName); } } } // 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 EventLogPermissionAttribute : CodeAccessSecurityAttribute { private string machineName; private EventLogPermissionAccess permissionAccess; public EventLogPermissionAttribute(SecurityAction action) : base(action) { this.machineName = "."; this.permissionAccess = EventLogPermissionAccess.Write; } 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 EventLogPermissionAccess PermissionAccess { get { return this.permissionAccess; } set { this.permissionAccess = value; } } public override IPermission CreatePermission() { if (Unrestricted) return new EventLogPermission(PermissionState.Unrestricted); return new EventLogPermission(this.PermissionAccess, this.MachineName); } } } // 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
- Compiler.cs
- Attachment.cs
- FunctionDescription.cs
- HtmlTableCellCollection.cs
- XmlImplementation.cs
- EventNotify.cs
- RemotingAttributes.cs
- SemanticResolver.cs
- ClientClassGenerator.cs
- UserControl.cs
- ErrorFormatter.cs
- Facet.cs
- Crc32Helper.cs
- CachedResourceDictionaryExtension.cs
- URI.cs
- HtmlTernaryTree.cs
- CompilerResults.cs
- SkewTransform.cs
- TreeView.cs
- QilFactory.cs
- DragEventArgs.cs
- GeometryModel3D.cs
- WebConfigurationFileMap.cs
- Pointer.cs
- ToolStripItemRenderEventArgs.cs
- XmlQualifiedName.cs
- XmlSchemaInferenceException.cs
- ScriptReferenceEventArgs.cs
- MetroSerializationManager.cs
- HotCommands.cs
- DynamicDocumentPaginator.cs
- ClassData.cs
- DateTimeValueSerializer.cs
- base64Transforms.cs
- While.cs
- GradientStop.cs
- AnnotationResourceChangedEventArgs.cs
- SqlAliaser.cs
- DataGridViewRowPrePaintEventArgs.cs
- InputScopeAttribute.cs
- BamlLocalizer.cs
- HttpWebRequestElement.cs
- PartManifestEntry.cs
- MessageDesigner.cs
- InternalDispatchObject.cs
- DbUpdateCommandTree.cs
- UrlPath.cs
- DataGridViewHeaderCell.cs
- DatePickerTextBox.cs
- LineSegment.cs
- storepermissionattribute.cs
- ColorBlend.cs
- AttributeAction.cs
- ImagingCache.cs
- Funcletizer.cs
- FontConverter.cs
- PeerName.cs
- TimersDescriptionAttribute.cs
- DataControlHelper.cs
- unitconverter.cs
- DispatchRuntime.cs
- MenuItemStyleCollection.cs
- MaxSessionCountExceededException.cs
- Oci.cs
- UnsafeNativeMethods.cs
- PropertyCollection.cs
- RenderData.cs
- PriorityRange.cs
- Transactions.cs
- SoapInteropTypes.cs
- ListViewUpdateEventArgs.cs
- BindStream.cs
- WebPartCancelEventArgs.cs
- AnnotationResourceCollection.cs
- DesignerWebPartChrome.cs
- UpDownBaseDesigner.cs
- HttpDigestClientElement.cs
- Ray3DHitTestResult.cs
- ContentWrapperAttribute.cs
- CFGGrammar.cs
- SortQuery.cs
- ServiceDescriptionReflector.cs
- AttributeCollection.cs
- VariableAction.cs
- Int32EqualityComparer.cs
- sortedlist.cs
- Hashtable.cs
- ProcessHostServerConfig.cs
- GifBitmapDecoder.cs
- ConstraintManager.cs
- WebPart.cs
- AdjustableArrowCap.cs
- _SSPIWrapper.cs
- PropertyDescriptorGridEntry.cs
- RawStylusSystemGestureInputReport.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TaskFormBase.cs
- FileDialogCustomPlace.cs
- NullableIntMinMaxAggregationOperator.cs
- TextAction.cs