Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- OAVariantLib.cs
- ElementFactory.cs
- IPAddressCollection.cs
- FlowchartStart.xaml.cs
- ColorTransformHelper.cs
- Int32AnimationUsingKeyFrames.cs
- MethodCallTranslator.cs
- DataGridViewCellConverter.cs
- ColumnResizeAdorner.cs
- DirectoryLocalQuery.cs
- Accessible.cs
- PeerHopCountAttribute.cs
- transactioncontext.cs
- ContainerControlDesigner.cs
- SecurityTokenSerializer.cs
- HMAC.cs
- PatternMatcher.cs
- StrongNameUtility.cs
- VectorAnimationUsingKeyFrames.cs
- TemplateBindingExtensionConverter.cs
- RowType.cs
- TracedNativeMethods.cs
- KeyedCollection.cs
- odbcmetadatacolumnnames.cs
- ValueTable.cs
- ControlCachePolicy.cs
- CodeIdentifiers.cs
- WebRequestModuleElement.cs
- CursorInteropHelper.cs
- CompilerScopeManager.cs
- ValueUnavailableException.cs
- InternalsVisibleToAttribute.cs
- InternalException.cs
- StatusBar.cs
- HttpProtocolReflector.cs
- BufferedWebEventProvider.cs
- ForEachAction.cs
- DynamicResourceExtension.cs
- Menu.cs
- InputMethodStateChangeEventArgs.cs
- XmlSchemaAttributeGroup.cs
- SetStoryboardSpeedRatio.cs
- XmlStringTable.cs
- Misc.cs
- AutomationElement.cs
- RealProxy.cs
- UserInitiatedNavigationPermission.cs
- TypeKeyValue.cs
- DataGridViewCellParsingEventArgs.cs
- ListDesigner.cs
- AnnouncementSendsAsyncResult.cs
- RoutedPropertyChangedEventArgs.cs
- CheckBoxField.cs
- XPathNodePointer.cs
- X509ThumbprintKeyIdentifierClause.cs
- LayoutSettings.cs
- WeakReferenceList.cs
- IntermediatePolicyValidator.cs
- IisHelper.cs
- SchemaNamespaceManager.cs
- ServiceDescriptionImporter.cs
- ScrollViewer.cs
- PriorityQueue.cs
- XmlNodeList.cs
- NavigationWindow.cs
- StorageRoot.cs
- GAC.cs
- WebPartAuthorizationEventArgs.cs
- Restrictions.cs
- DbTransaction.cs
- ExceptionHelpers.cs
- ZipIOBlockManager.cs
- SHA512Managed.cs
- PropertyChangingEventArgs.cs
- DoubleConverter.cs
- BuildProviderCollection.cs
- RemotingHelper.cs
- WindowsUpDown.cs
- WindowsListViewItem.cs
- AdPostCacheSubstitution.cs
- DefaultExpression.cs
- Win32Native.cs
- ContainerParaClient.cs
- AnnotationResourceCollection.cs
- HtmlLiteralTextAdapter.cs
- AttributeUsageAttribute.cs
- ProgressBarAutomationPeer.cs
- DefaultClaimSet.cs
- ButtonAutomationPeer.cs
- XsdBuildProvider.cs
- ISCIIEncoding.cs
- NameTable.cs
- RevocationPoint.cs
- StringFreezingAttribute.cs
- AnimationClockResource.cs
- DataGridViewCellMouseEventArgs.cs
- SymLanguageVendor.cs
- SimpleParser.cs
- DisplayNameAttribute.cs
- BufferModesCollection.cs