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
- StoreItemCollection.cs
- ThemeDictionaryExtension.cs
- CultureTable.cs
- RadioButtonList.cs
- DataGridViewRowCancelEventArgs.cs
- SqlSelectStatement.cs
- DataGridRowEventArgs.cs
- InternalConfigEventArgs.cs
- Point3DCollection.cs
- ClientUriBehavior.cs
- XmlSchemaExporter.cs
- UnaryNode.cs
- ProxyGenerationError.cs
- MasterPage.cs
- SafeWaitHandle.cs
- XmlSchemaAppInfo.cs
- Mouse.cs
- InheritanceAttribute.cs
- ProxyGenerationError.cs
- MethodImplAttribute.cs
- TabletCollection.cs
- RawStylusInput.cs
- XmlLanguageConverter.cs
- MultiSelectRootGridEntry.cs
- SmtpFailedRecipientsException.cs
- UIElementIsland.cs
- MessageBox.cs
- WhitespaceRuleReader.cs
- BooleanConverter.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- QueryStringHandler.cs
- SecurityTokenResolver.cs
- BooleanFunctions.cs
- ThreadSafeList.cs
- CfgArc.cs
- CheckBoxField.cs
- EmptyArray.cs
- SetStateDesigner.cs
- ImageAutomationPeer.cs
- Image.cs
- Vector3DAnimationUsingKeyFrames.cs
- ConfigurationProperty.cs
- XmlHierarchicalEnumerable.cs
- SqlConnectionFactory.cs
- complextypematerializer.cs
- _UncName.cs
- MulticastDelegate.cs
- ReferenceSchema.cs
- PropertyDescriptorGridEntry.cs
- XmlImplementation.cs
- WinEventWrap.cs
- TextRangeEdit.cs
- securitycriticaldata.cs
- DecoratedNameAttribute.cs
- TemplateXamlParser.cs
- TreeBuilderBamlTranslator.cs
- Variable.cs
- AccessDataSourceWizardForm.cs
- TextBoxAutomationPeer.cs
- XsdBuilder.cs
- WebPartsPersonalizationAuthorization.cs
- AmbientEnvironment.cs
- DetailsView.cs
- ApplicationFileParser.cs
- RelationshipManager.cs
- DomNameTable.cs
- EntityContainerRelationshipSet.cs
- SmiEventStream.cs
- FieldBuilder.cs
- DesignerWithHeader.cs
- HierarchicalDataSourceDesigner.cs
- NumberFormatter.cs
- DataReaderContainer.cs
- RotateTransform3D.cs
- DataGridRowHeader.cs
- ResourceDefaultValueAttribute.cs
- TimelineCollection.cs
- HMACSHA512.cs
- Int32Rect.cs
- PersonalizationProvider.cs
- SoapAttributeAttribute.cs
- ReadOnlyDictionary.cs
- EditorBrowsableAttribute.cs
- ProfileEventArgs.cs
- GridViewSortEventArgs.cs
- ActivityDesignerHelper.cs
- ToolStripItemClickedEventArgs.cs
- StreamResourceInfo.cs
- MergablePropertyAttribute.cs
- ThemeDirectoryCompiler.cs
- SimpleBitVector32.cs
- PrePrepareMethodAttribute.cs
- AudioLevelUpdatedEventArgs.cs
- JumpTask.cs
- AppSettingsExpressionBuilder.cs
- XmlSerializerVersionAttribute.cs
- SapiInterop.cs
- SchemaNamespaceManager.cs
- AutomationPatternInfo.cs
- AsyncOperationManager.cs