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
- XmlBindingWorker.cs
- ProtectedConfigurationSection.cs
- PropertyConverter.cs
- Util.cs
- Win32SafeHandles.cs
- TemplateXamlParser.cs
- LocalValueEnumerator.cs
- DoubleConverter.cs
- DispatchProxy.cs
- TabletDevice.cs
- HostUtils.cs
- RuntimeConfigLKG.cs
- PrivateFontCollection.cs
- OptimisticConcurrencyException.cs
- WinFormsComponentEditor.cs
- GridViewCellAutomationPeer.cs
- DataTemplate.cs
- DataGridTextBox.cs
- WindowsUpDown.cs
- MobileSysDescriptionAttribute.cs
- SubMenuStyle.cs
- TextTrailingCharacterEllipsis.cs
- OracleCommandBuilder.cs
- BinaryExpression.cs
- PrintController.cs
- InputDevice.cs
- SqlDataSourceCache.cs
- WebBrowserNavigatingEventHandler.cs
- WebPermission.cs
- TargetInvocationException.cs
- OracleConnectionString.cs
- SQLInt64Storage.cs
- EventManager.cs
- SamlAuthenticationStatement.cs
- BitmapCodecInfoInternal.cs
- ComplexPropertyEntry.cs
- ObjectConverter.cs
- TransactionException.cs
- SelectorItemAutomationPeer.cs
- SelectionBorderGlyph.cs
- XmlNodeComparer.cs
- DataKey.cs
- PasswordTextNavigator.cs
- TraceContextRecord.cs
- PrintPageEvent.cs
- BooleanKeyFrameCollection.cs
- UnhandledExceptionEventArgs.cs
- InertiaTranslationBehavior.cs
- ConsoleCancelEventArgs.cs
- ToolStrip.cs
- TableProvider.cs
- TableLayoutPanelCellPosition.cs
- GenerateScriptTypeAttribute.cs
- diagnosticsswitches.cs
- ListItemConverter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ThemeableAttribute.cs
- QilInvokeLateBound.cs
- TcpPortSharing.cs
- BitmapEffectGeneralTransform.cs
- BinaryConverter.cs
- ItemsPanelTemplate.cs
- OracleDataReader.cs
- StylusPlugInCollection.cs
- DiscardableAttribute.cs
- URL.cs
- SocketCache.cs
- TaskCanceledException.cs
- BulletDecorator.cs
- IfAction.cs
- ToolboxCategory.cs
- Binding.cs
- LocalBuilder.cs
- _Win32.cs
- XamlVector3DCollectionSerializer.cs
- EventManager.cs
- Int32.cs
- DefaultMemberAttribute.cs
- CLSCompliantAttribute.cs
- CheckBoxFlatAdapter.cs
- OleDbRowUpdatingEvent.cs
- HtmlLink.cs
- FatalException.cs
- ToolStripDropDownClosedEventArgs.cs
- SqlTriggerContext.cs
- ExtendedProperty.cs
- LinqDataSourceDisposeEventArgs.cs
- CurrentChangingEventArgs.cs
- SMSvcHost.cs
- RectangleHotSpot.cs
- RegexWriter.cs
- ArgIterator.cs
- NavigationExpr.cs
- HttpChannelFactory.cs
- CroppedBitmap.cs
- MetabaseServerConfig.cs
- TextTreePropertyUndoUnit.cs
- SigningDialog.cs
- GeometryDrawing.cs
- DataGridTextBox.cs