Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / System.Runtime.DurableInstancing / System / Runtime / DurableInstancing / InstanceOwnerException.cs / 1305376 / InstanceOwnerException.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.Runtime.DurableInstancing
{
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Security;
using System.Xml.Linq;
[Serializable]
public class InstanceOwnerException : InstancePersistenceException
{
const string InstanceOwnerIdName = "instancePersistenceInstanceOwnerId";
public InstanceOwnerException()
: base(SRCore.InstanceOwnerDefault)
{
}
public InstanceOwnerException(string message)
: base(message)
{
}
public InstanceOwnerException(string message, Exception innerException)
: base(message, innerException)
{
}
public InstanceOwnerException(XName commandName, Guid instanceOwnerId)
: this(commandName, instanceOwnerId, null)
{
}
public InstanceOwnerException(XName commandName, Guid instanceOwnerId, Exception innerException)
: this(commandName, instanceOwnerId, ToMessage(instanceOwnerId), innerException)
{
}
public InstanceOwnerException(XName commandName, Guid instanceOwnerId, string message, Exception innerException)
: base(commandName, message, innerException)
{
InstanceOwnerId = instanceOwnerId;
}
[SecurityCritical]
protected InstanceOwnerException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
InstanceOwnerId = (Guid) info.GetValue(InstanceOwnerIdName, typeof(Guid));
}
public Guid InstanceOwnerId { get; private set; }
[Fx.Tag.SecurityNote(Critical = "Overrides critical inherited method")]
[SecurityCritical]
[SuppressMessage(FxCop.Category.Security, FxCop.Rule.SecureGetObjectDataOverrides,
Justification = "Method is SecurityCritical")]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue(InstanceOwnerIdName, InstanceOwnerId, typeof(Guid));
}
static string ToMessage(Guid instanceOwnerId)
{
if (instanceOwnerId == Guid.Empty)
{
return SRCore.InstanceOwnerDefault;
}
return SRCore.InstanceOwnerSpecific(instanceOwnerId);
}
}
}
// 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
- ObjectQuery_EntitySqlExtensions.cs
- StrongNameKeyPair.cs
- ApplicationHost.cs
- BoundPropertyEntry.cs
- RelationshipEnd.cs
- CompilerInfo.cs
- BuilderInfo.cs
- DeferredTextReference.cs
- EntityContainerAssociationSetEnd.cs
- HostedHttpRequestAsyncResult.cs
- ListenerElementsCollection.cs
- SortedList.cs
- NativeMethods.cs
- UserControlParser.cs
- EdmType.cs
- DocumentPageHost.cs
- UnorderedHashRepartitionStream.cs
- ProfilePropertyNameValidator.cs
- UserControlParser.cs
- ProtocolsSection.cs
- PageTheme.cs
- AuditLevel.cs
- SchemaAttDef.cs
- HatchBrush.cs
- DateTimeParse.cs
- AppDomainInfo.cs
- AbandonedMutexException.cs
- StatusBarPanel.cs
- CloseSequenceResponse.cs
- InputQueue.cs
- GeometryHitTestResult.cs
- Matrix.cs
- LowerCaseStringConverter.cs
- DataGridViewImageCell.cs
- ControlValuePropertyAttribute.cs
- NullRuntimeConfig.cs
- TileModeValidation.cs
- ArglessEventHandlerProxy.cs
- URLIdentityPermission.cs
- RegexInterpreter.cs
- XmlUtil.cs
- HttpFileCollection.cs
- DataListItemCollection.cs
- RelationshipEnd.cs
- XmlSchemaSimpleTypeList.cs
- Tag.cs
- Exceptions.cs
- MultipartIdentifier.cs
- AnnotationService.cs
- ResourceReferenceExpression.cs
- FamilyTypefaceCollection.cs
- RedBlackList.cs
- DbProviderConfigurationHandler.cs
- DesignSurface.cs
- Light.cs
- Native.cs
- Wrapper.cs
- EventMappingSettingsCollection.cs
- AlignmentYValidation.cs
- DataControlFieldHeaderCell.cs
- AssertHelper.cs
- ObjectToIdCache.cs
- Int32CollectionConverter.cs
- TreeNodeEventArgs.cs
- PersonalizationStateQuery.cs
- CannotUnloadAppDomainException.cs
- BinaryObjectInfo.cs
- CommandField.cs
- TTSEngineTypes.cs
- OdbcParameterCollection.cs
- ToolStripSplitStackLayout.cs
- Module.cs
- ArrangedElement.cs
- GiveFeedbackEventArgs.cs
- Region.cs
- DataExpression.cs
- AddressHeaderCollectionElement.cs
- KeyGestureConverter.cs
- Rules.cs
- Processor.cs
- Message.cs
- CodeCastExpression.cs
- MemoryFailPoint.cs
- StaticSiteMapProvider.cs
- BaseDataList.cs
- DSACryptoServiceProvider.cs
- RIPEMD160Managed.cs
- QuaternionRotation3D.cs
- UnsafeNativeMethods.cs
- StringPropertyBuilder.cs
- DoubleAnimation.cs
- ScrollBar.cs
- PartManifestEntry.cs
- DesignerInterfaces.cs
- DataControlFieldCell.cs
- ColorBlend.cs
- New.cs
- DataGridCell.cs
- AppDomain.cs
- MemberAssignmentAnalysis.cs