Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / EventLogPermissionAttribute.cs / 1305376 / 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
- SqlDependency.cs
- Span.cs
- ExpressionConverter.cs
- SecurityManager.cs
- DetailsView.cs
- CardSpaceException.cs
- SendSecurityHeaderElement.cs
- AssemblyFilter.cs
- OpCellTreeNode.cs
- SqlCommandSet.cs
- PagePropertiesChangingEventArgs.cs
- WaitHandle.cs
- Control.cs
- ComplexPropertyEntry.cs
- XmlQueryCardinality.cs
- HwndSourceParameters.cs
- _ProxyRegBlob.cs
- HostUtils.cs
- CodeArrayCreateExpression.cs
- CompensationHandlingFilter.cs
- HttpRawResponse.cs
- AuthorizationRule.cs
- _ListenerAsyncResult.cs
- ProcessHostFactoryHelper.cs
- CalendarDateRange.cs
- MappingSource.cs
- Popup.cs
- ServicePointManagerElement.cs
- TextRunProperties.cs
- RoleServiceManager.cs
- XPathItem.cs
- CodeGeneratorOptions.cs
- ChannelParameterCollection.cs
- Font.cs
- TemplateBindingExpression.cs
- SpecularMaterial.cs
- ScriptingAuthenticationServiceSection.cs
- RandomDelaySendsAsyncResult.cs
- KeyedCollection.cs
- CodeTypeMemberCollection.cs
- LayoutEvent.cs
- TableRow.cs
- ObjectReferenceStack.cs
- precedingquery.cs
- StrongNameKeyPair.cs
- xml.cs
- ProcessProtocolHandler.cs
- SamlDoNotCacheCondition.cs
- FormatConvertedBitmap.cs
- NullRuntimeConfig.cs
- NotSupportedException.cs
- WorkflowInspectionServices.cs
- SafePointer.cs
- securitymgrsite.cs
- DragDeltaEventArgs.cs
- PerformanceCounterPermissionAttribute.cs
- XpsLiterals.cs
- TypeLibConverter.cs
- RouteValueExpressionBuilder.cs
- DataGridViewRow.cs
- TraceHandlerErrorFormatter.cs
- ProcessingInstructionAction.cs
- ToolStripScrollButton.cs
- EntityKey.cs
- SqlStatistics.cs
- SoapConverter.cs
- WindowsContainer.cs
- DataServiceQueryOfT.cs
- AmbiguousMatchException.cs
- CodeEntryPointMethod.cs
- FolderLevelBuildProviderCollection.cs
- SubclassTypeValidator.cs
- EventManager.cs
- COM2PropertyBuilderUITypeEditor.cs
- FrameworkElement.cs
- Events.cs
- CodeArrayCreateExpression.cs
- ProfileManager.cs
- ThreadPool.cs
- Win32MouseDevice.cs
- LexicalChunk.cs
- DataGridDetailsPresenterAutomationPeer.cs
- CurrentTimeZone.cs
- RtfToken.cs
- ParenthesizePropertyNameAttribute.cs
- ActivityExecutorSurrogate.cs
- BufferBuilder.cs
- ADConnectionHelper.cs
- InProcStateClientManager.cs
- ConnectionManagementElement.cs
- DesignerRegionMouseEventArgs.cs
- ToolboxDataAttribute.cs
- MappedMetaModel.cs
- UnsafeNativeMethodsMilCoreApi.cs
- XmlSerializerSection.cs
- CryptoApi.cs
- ConnectionStringsExpressionBuilder.cs
- DSGeneratorProblem.cs
- MimeObjectFactory.cs
- DataControlButton.cs