Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ContainerSelectorGlyph.cs
- TraceSource.cs
- IndexOutOfRangeException.cs
- BorderGapMaskConverter.cs
- CodeAccessSecurityEngine.cs
- DocumentGrid.cs
- QueryOutputWriter.cs
- AnonymousIdentificationSection.cs
- ObjectDataSourceStatusEventArgs.cs
- BitStack.cs
- CodeArgumentReferenceExpression.cs
- ScrollItemPattern.cs
- HashSetDebugView.cs
- GCHandleCookieTable.cs
- SingleSelectRootGridEntry.cs
- DefaultShape.cs
- NamedPermissionSet.cs
- MarkedHighlightComponent.cs
- NavigateEvent.cs
- ADMembershipProvider.cs
- EnumBuilder.cs
- TaskFactory.cs
- brushes.cs
- SystemIcons.cs
- XmlRawWriter.cs
- SamlSubjectStatement.cs
- PersistenceException.cs
- RowType.cs
- SchemaMapping.cs
- OleAutBinder.cs
- GPPOINT.cs
- mansign.cs
- Component.cs
- SecurityRuntime.cs
- SqlExpressionNullability.cs
- Color.cs
- EventLogSession.cs
- FieldToken.cs
- ContextMenu.cs
- SecurityDescriptor.cs
- DataRow.cs
- SiteMapNode.cs
- NamedPipeProcessProtocolHandler.cs
- SizeValueSerializer.cs
- StronglyTypedResourceBuilder.cs
- AdapterUtil.cs
- QueryableDataSourceEditData.cs
- SqlExpander.cs
- CustomErrorsSectionWrapper.cs
- MDIWindowDialog.cs
- View.cs
- XPathEmptyIterator.cs
- AttributeCollection.cs
- AuthenticationManager.cs
- ACE.cs
- SaveFileDialog.cs
- SqlDataSourceSummaryPanel.cs
- MemberInfoSerializationHolder.cs
- AppDomain.cs
- AssemblyAttributes.cs
- XmlSubtreeReader.cs
- LocalValueEnumerator.cs
- StandardToolWindows.cs
- DBCSCodePageEncoding.cs
- VectorAnimationUsingKeyFrames.cs
- WebResourceAttribute.cs
- XmlUnspecifiedAttribute.cs
- BrushProxy.cs
- WindowsAuthenticationEventArgs.cs
- Update.cs
- PathGradientBrush.cs
- WindowsListBox.cs
- IndentedTextWriter.cs
- PropertyCondition.cs
- TaskExceptionHolder.cs
- SoapIgnoreAttribute.cs
- UpnEndpointIdentityExtension.cs
- XmlC14NWriter.cs
- AnnotationStore.cs
- PointHitTestParameters.cs
- XamlStream.cs
- CodeNamespace.cs
- DataGridViewColumnHeaderCell.cs
- VisualStyleElement.cs
- DocumentPaginator.cs
- SqlNodeTypeOperators.cs
- Int32.cs
- WebPartsSection.cs
- WebPartHelpVerb.cs
- VisualStyleTypesAndProperties.cs
- Environment.cs
- ServiceContractGenerationContext.cs
- MenuItemCollection.cs
- SendActivityValidator.cs
- RegexTree.cs
- RuntimeConfigLKG.cs
- StrokeDescriptor.cs
- InputBinder.cs
- HtmlControlPersistable.cs
- TransformedBitmap.cs