Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Visitor.cs
- CompoundFileStreamReference.cs
- Debug.cs
- FlagsAttribute.cs
- _LocalDataStore.cs
- ScriptReferenceBase.cs
- TypedRowHandler.cs
- _Events.cs
- SqlRowUpdatedEvent.cs
- DataViewSettingCollection.cs
- Win32PrintDialog.cs
- Win32KeyboardDevice.cs
- ConsoleCancelEventArgs.cs
- ReflectionServiceProvider.cs
- StdValidatorsAndConverters.cs
- DynamicValidatorEventArgs.cs
- HTMLTextWriter.cs
- RSAOAEPKeyExchangeFormatter.cs
- Decoder.cs
- DesignOnlyAttribute.cs
- WorkItem.cs
- PersonalizationState.cs
- CircleHotSpot.cs
- TraversalRequest.cs
- ObjectManager.cs
- Int64AnimationBase.cs
- PeerInvitationResponse.cs
- SubMenuStyleCollectionEditor.cs
- Attributes.cs
- OleDbPermission.cs
- ping.cs
- SelectionRangeConverter.cs
- WebErrorHandler.cs
- TableRowGroup.cs
- DesignDataSource.cs
- WorkflowOperationBehavior.cs
- XPathMultyIterator.cs
- LocatorManager.cs
- RegexCompiler.cs
- Evidence.cs
- StylusSystemGestureEventArgs.cs
- FunctionImportElement.cs
- DomainConstraint.cs
- HuffCodec.cs
- CodeMethodInvokeExpression.cs
- EditorZoneBase.cs
- StringComparer.cs
- Scene3D.cs
- ActiveXSite.cs
- OutputCacheProfileCollection.cs
- InvalidContentTypeException.cs
- ScriptReference.cs
- HwndSubclass.cs
- ZipIOModeEnforcingStream.cs
- ListControlDataBindingHandler.cs
- WebPartMovingEventArgs.cs
- SecondaryIndex.cs
- UIElement.cs
- SpeechEvent.cs
- ClientEventManager.cs
- CryptoApi.cs
- TextContainerHelper.cs
- XmlDictionaryWriter.cs
- AlphabetConverter.cs
- CultureTableRecord.cs
- WorkflowTraceTransfer.cs
- COAUTHINFO.cs
- CoTaskMemSafeHandle.cs
- Options.cs
- InputProcessorProfilesLoader.cs
- ReadOnlyDataSource.cs
- SetIterators.cs
- RawStylusInputReport.cs
- GridEntryCollection.cs
- XmlUrlEditor.cs
- ToolStripDropTargetManager.cs
- DrawingGroup.cs
- WebConfigurationHostFileChange.cs
- COM2ColorConverter.cs
- control.ime.cs
- PenContext.cs
- ReservationCollection.cs
- IOException.cs
- ListGeneralPage.cs
- COM2ComponentEditor.cs
- Timer.cs
- ExtractedStateEntry.cs
- ButtonChrome.cs
- SafeLibraryHandle.cs
- ComponentConverter.cs
- DurableMessageDispatchInspector.cs
- BamlReader.cs
- XmlNodeReader.cs
- RecoverInstanceLocksCommand.cs
- BinaryFormatter.cs
- RangeValidator.cs
- ConcatQueryOperator.cs
- _emptywebproxy.cs
- DbXmlEnabledProviderManifest.cs
- TextOptionsInternal.cs