Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Security / AccessControl / PrivilegeNotHeldException.cs / 1 / PrivilegeNotHeldException.cs
using Microsoft.Win32;
using System;
using System.Runtime.Serialization;
using System.Text;
using System.Globalization;
using System.Security.Permissions;
namespace System.Security.AccessControl
{
[Serializable]
public sealed class PrivilegeNotHeldException : UnauthorizedAccessException, ISerializable
{
private readonly string _privilegeName = null;
public PrivilegeNotHeldException()
: base( Environment.GetResourceString( "PrivilegeNotHeld_Default" ))
{
}
public PrivilegeNotHeldException( string privilege )
: base( string.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "PrivilegeNotHeld_Named" ), privilege ))
{
_privilegeName = privilege;
}
public PrivilegeNotHeldException( string privilege, Exception inner )
: base( string.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "PrivilegeNotHeld_Named" ), privilege ), inner )
{
_privilegeName = privilege;
}
internal PrivilegeNotHeldException( SerializationInfo info, StreamingContext context )
: base( info, context )
{
_privilegeName = info.GetString("PrivilegeName");
}
public string PrivilegeName
{
get { return _privilegeName; }
}
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData( SerializationInfo info, StreamingContext context )
{
if ( info == null )
{
throw new ArgumentNullException( "info" );
}
base.GetObjectData(info, context);
info.AddValue("PrivilegeName", _privilegeName, typeof( string ));
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using Microsoft.Win32;
using System;
using System.Runtime.Serialization;
using System.Text;
using System.Globalization;
using System.Security.Permissions;
namespace System.Security.AccessControl
{
[Serializable]
public sealed class PrivilegeNotHeldException : UnauthorizedAccessException, ISerializable
{
private readonly string _privilegeName = null;
public PrivilegeNotHeldException()
: base( Environment.GetResourceString( "PrivilegeNotHeld_Default" ))
{
}
public PrivilegeNotHeldException( string privilege )
: base( string.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "PrivilegeNotHeld_Named" ), privilege ))
{
_privilegeName = privilege;
}
public PrivilegeNotHeldException( string privilege, Exception inner )
: base( string.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "PrivilegeNotHeld_Named" ), privilege ), inner )
{
_privilegeName = privilege;
}
internal PrivilegeNotHeldException( SerializationInfo info, StreamingContext context )
: base( info, context )
{
_privilegeName = info.GetString("PrivilegeName");
}
public string PrivilegeName
{
get { return _privilegeName; }
}
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData( SerializationInfo info, StreamingContext context )
{
if ( info == null )
{
throw new ArgumentNullException( "info" );
}
base.GetObjectData(info, context);
info.AddValue("PrivilegeName", _privilegeName, typeof( string ));
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IndexOutOfRangeException.cs
- HMACSHA256.cs
- TeredoHelper.cs
- TableSectionStyle.cs
- DataIdProcessor.cs
- UserControlBuildProvider.cs
- HMACRIPEMD160.cs
- TouchFrameEventArgs.cs
- MetabaseSettings.cs
- ExpressionVisitor.cs
- XmlBuffer.cs
- AttributeUsageAttribute.cs
- Win32KeyboardDevice.cs
- DataService.cs
- DefaultParameterValueAttribute.cs
- MsmqIntegrationSecurityMode.cs
- X500Name.cs
- ActivityTypeResolver.xaml.cs
- RSAPKCS1KeyExchangeFormatter.cs
- InfoCardTrace.cs
- FocusTracker.cs
- WebPartCatalogAddVerb.cs
- SoapDocumentServiceAttribute.cs
- LoginDesigner.cs
- ColorAnimationUsingKeyFrames.cs
- XmlElementList.cs
- EntityDesignPluralizationHandler.cs
- BitmapPalette.cs
- EventBookmark.cs
- DTCTransactionManager.cs
- SynchronizationContext.cs
- CodeMethodInvokeExpression.cs
- DesignerHost.cs
- CellNormalizer.cs
- RuntimeConfig.cs
- __Filters.cs
- VisualCollection.cs
- InheritanceAttribute.cs
- RequestQueue.cs
- CustomErrorsSection.cs
- DefaultExpressionVisitor.cs
- RSAProtectedConfigurationProvider.cs
- EventDescriptor.cs
- ListChunk.cs
- ProfilePropertySettings.cs
- DataGridViewCellEventArgs.cs
- DbProviderFactory.cs
- Byte.cs
- WizardStepCollectionEditor.cs
- ComponentEvent.cs
- DataGridViewRowsAddedEventArgs.cs
- WebAdminConfigurationHelper.cs
- SqlDataSourceRefreshSchemaForm.cs
- ListenerServiceInstallComponent.cs
- WhitespaceRuleReader.cs
- DesignDataSource.cs
- PackageRelationshipCollection.cs
- entityreference_tresulttype.cs
- OpenTypeCommon.cs
- GenericTypeParameterBuilder.cs
- Int32RectValueSerializer.cs
- PropertyEmitterBase.cs
- BooleanFacetDescriptionElement.cs
- TextTreeInsertUndoUnit.cs
- CacheChildrenQuery.cs
- XmlDataImplementation.cs
- ToolStripRendererSwitcher.cs
- MethodBuilder.cs
- FreezableCollection.cs
- XmlDataCollection.cs
- SpecularMaterial.cs
- PointIndependentAnimationStorage.cs
- OperationParameterInfo.cs
- ContentDesigner.cs
- FactoryId.cs
- XmlAutoDetectWriter.cs
- DbInsertCommandTree.cs
- DesignerWithHeader.cs
- ProxyWebPart.cs
- TextServicesCompartmentContext.cs
- TypeLoader.cs
- ComplusTypeValidator.cs
- translator.cs
- ProcessManager.cs
- RMPermissions.cs
- TreeNodeStyle.cs
- CommandBindingCollection.cs
- VisualTransition.cs
- HuffModule.cs
- WindowHideOrCloseTracker.cs
- FontFamilyValueSerializer.cs
- DataControlLinkButton.cs
- ArcSegment.cs
- RectConverter.cs
- StylusEditingBehavior.cs
- WebBaseEventKeyComparer.cs
- Window.cs
- OSEnvironmentHelper.cs
- EntityContainerAssociationSet.cs
- ProtectedUri.cs