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
- ReadOnlyCollection.cs
- ContentPathSegment.cs
- CLSCompliantAttribute.cs
- SelectionListDesigner.cs
- EntityDataSourceContextCreatingEventArgs.cs
- CombinedHttpChannel.cs
- ConfigurationFileMap.cs
- WindowsSlider.cs
- ResXDataNode.cs
- CallSiteOps.cs
- ProfileSettingsCollection.cs
- Mutex.cs
- SqlCacheDependency.cs
- NavigationCommands.cs
- PackageRelationshipSelector.cs
- TCEAdapterGenerator.cs
- UnsignedPublishLicense.cs
- IntegerValidator.cs
- HtmlPageAdapter.cs
- ResolvedKeyFrameEntry.cs
- OdbcConnectionStringbuilder.cs
- XPathNodePointer.cs
- SoapProtocolImporter.cs
- wgx_commands.cs
- MessageLogger.cs
- HttpProcessUtility.cs
- EventToken.cs
- TypeValidationEventArgs.cs
- ColorConvertedBitmap.cs
- MonikerSyntaxException.cs
- XmlHelper.cs
- StringUtil.cs
- XPathDocumentBuilder.cs
- XmlName.cs
- ObjectKeyFrameCollection.cs
- PointAnimationBase.cs
- IPEndPoint.cs
- CodeArrayCreateExpression.cs
- MachineKeySection.cs
- Atom10FormatterFactory.cs
- SafeNativeMethodsCLR.cs
- PerformanceCounter.cs
- SqlProviderUtilities.cs
- AxHost.cs
- CalendarDateChangedEventArgs.cs
- FunctionNode.cs
- PeerNameResolver.cs
- UdpSocket.cs
- XmlSchemaElement.cs
- PasswordBox.cs
- MaskedTextBox.cs
- AttachedProperty.cs
- ValidatedControlConverter.cs
- UnitControl.cs
- BaseParagraph.cs
- WebReferenceOptions.cs
- ResolveCriteria.cs
- AndCondition.cs
- oledbmetadatacolumnnames.cs
- TreeViewTemplateSelector.cs
- BitVector32.cs
- WrappedIUnknown.cs
- MsmqIntegrationBinding.cs
- SqlAliasesReferenced.cs
- HttpChannelBindingToken.cs
- GradientStop.cs
- HttpCapabilitiesSectionHandler.cs
- ExpressionNode.cs
- AccessorTable.cs
- ObjectListItemCollection.cs
- WeakEventManager.cs
- GeneratedView.cs
- ProxyManager.cs
- SamlAuthenticationClaimResource.cs
- GridSplitter.cs
- DesignerToolboxInfo.cs
- ISessionStateStore.cs
- Normalization.cs
- SqlCacheDependencyDatabaseCollection.cs
- XmlSchemaFacet.cs
- RNGCryptoServiceProvider.cs
- ClrPerspective.cs
- DbProviderManifest.cs
- ConfigurationValues.cs
- OdbcConnectionHandle.cs
- SQLByte.cs
- OdbcConnectionStringbuilder.cs
- MultiByteCodec.cs
- TextLineResult.cs
- WebPartPersonalization.cs
- ApplicationServicesHostFactory.cs
- JournalEntry.cs
- FamilyCollection.cs
- PerfService.cs
- RuleProcessor.cs
- DataSourceBooleanViewSchemaConverter.cs
- EntityException.cs
- DataGridItemEventArgs.cs
- GraphicsState.cs
- SafeRightsManagementEnvironmentHandle.cs