Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------
// 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
- NumberAction.cs
- HtmlTableRow.cs
- SoapAttributes.cs
- SmiSettersStream.cs
- SpeechSeg.cs
- DataRowView.cs
- Ref.cs
- CodeLabeledStatement.cs
- XpsS0ValidatingLoader.cs
- CatalogZoneBase.cs
- GridItemCollection.cs
- UserControlFileEditor.cs
- RawAppCommandInputReport.cs
- SqlCaseSimplifier.cs
- CubicEase.cs
- BitmapFrameDecode.cs
- HostSecurityManager.cs
- UnsafeNativeMethods.cs
- UrlMappingCollection.cs
- CellQuery.cs
- StringResourceManager.cs
- SaveFileDialog.cs
- CollectionViewSource.cs
- MasterPage.cs
- ParserHooks.cs
- UpdatePanelControlTrigger.cs
- COM2Enum.cs
- WebPartMenuStyle.cs
- HorizontalAlignConverter.cs
- RectAnimationBase.cs
- WebPartMovingEventArgs.cs
- ListBoxItem.cs
- UpdatePanelTrigger.cs
- InputScope.cs
- StylusTouchDevice.cs
- DocumentApplicationJournalEntry.cs
- ServiceChannelProxy.cs
- TransactionManager.cs
- HandleCollector.cs
- ResourceReferenceKeyNotFoundException.cs
- DataGridViewElement.cs
- XmlIlVisitor.cs
- ButtonBase.cs
- ConfigurationPermission.cs
- _ListenerResponseStream.cs
- EmptyEnumerator.cs
- AssertSection.cs
- ThrowHelper.cs
- CollectionExtensions.cs
- ChannelSinkStacks.cs
- StrokeSerializer.cs
- GeneralTransformGroup.cs
- GridItemProviderWrapper.cs
- sqlmetadatafactory.cs
- Context.cs
- QuaternionConverter.cs
- TimeSpanValidatorAttribute.cs
- ControlBuilder.cs
- SqlBulkCopyColumnMappingCollection.cs
- COM2PropertyBuilderUITypeEditor.cs
- XslVisitor.cs
- SingleResultAttribute.cs
- Tokenizer.cs
- Pkcs9Attribute.cs
- WebPartDisplayModeCollection.cs
- ImagingCache.cs
- FacetEnabledSchemaElement.cs
- ExpressionConverter.cs
- _Semaphore.cs
- XmlNotation.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- BitmapCodecInfo.cs
- TemplateParser.cs
- OutputCacheSection.cs
- XmlAtomErrorReader.cs
- TranslateTransform3D.cs
- Parser.cs
- RichTextBoxContextMenu.cs
- Axis.cs
- RotateTransform3D.cs
- ContractComponent.cs
- SecurityElement.cs
- EnumerableWrapperWeakToStrong.cs
- PingOptions.cs
- FormsAuthenticationUserCollection.cs
- PersonalizableAttribute.cs
- BasePattern.cs
- UIElementIsland.cs
- Panel.cs
- ExtentCqlBlock.cs
- ListControl.cs
- ADMembershipProvider.cs
- Pens.cs
- Deserializer.cs
- DecimalFormatter.cs
- PairComparer.cs
- ResourceDescriptionAttribute.cs
- DateTimePicker.cs
- SystemParameters.cs
- SignedXmlDebugLog.cs