Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / System.Runtime.DurableInstancing / System / Runtime / DurableInstancing / InstanceKeyNotReadyException.cs / 1305376 / InstanceKeyNotReadyException.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 InstanceKeyNotReadyException : InstancePersistenceCommandException { const string InstanceKeyName = "instancePersistenceInstanceKey"; public InstanceKeyNotReadyException() : this(SRCore.KeyNotReadyDefault, null) { } public InstanceKeyNotReadyException(string message) : this(message, null) { } public InstanceKeyNotReadyException(string message, Exception innerException) : base(message, innerException) { } public InstanceKeyNotReadyException(XName commandName, InstanceKey instanceKey) : this(commandName, instanceKey, null) { } public InstanceKeyNotReadyException(XName commandName, InstanceKey instanceKey, Exception innerException) : this(commandName, Guid.Empty, instanceKey, ToMessage(instanceKey), innerException) { } public InstanceKeyNotReadyException(XName commandName, Guid instanceId, InstanceKey instanceKey, string message, Exception innerException) : base(commandName, instanceId, message, innerException) { InstanceKey = instanceKey; } [SecurityCritical] protected InstanceKeyNotReadyException(SerializationInfo info, StreamingContext context) : base(info, context) { Guid guid = (Guid) info.GetValue(InstanceKeyName, typeof(Guid)); InstanceKey = guid == Guid.Empty ? null : new InstanceKey(guid); } public InstanceKey InstanceKey { 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(InstanceKeyName, (InstanceKey != null && InstanceKey.IsValid) ? InstanceKey.Value : Guid.Empty, typeof(Guid)); } static string ToMessage(InstanceKey instanceKey) { if (instanceKey != null && instanceKey.IsValid) { return SRCore.KeyNotReadySpecific(instanceKey.Value); } return SRCore.KeyNotReadyDefault; } } } // 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 InstanceKeyNotReadyException : InstancePersistenceCommandException { const string InstanceKeyName = "instancePersistenceInstanceKey"; public InstanceKeyNotReadyException() : this(SRCore.KeyNotReadyDefault, null) { } public InstanceKeyNotReadyException(string message) : this(message, null) { } public InstanceKeyNotReadyException(string message, Exception innerException) : base(message, innerException) { } public InstanceKeyNotReadyException(XName commandName, InstanceKey instanceKey) : this(commandName, instanceKey, null) { } public InstanceKeyNotReadyException(XName commandName, InstanceKey instanceKey, Exception innerException) : this(commandName, Guid.Empty, instanceKey, ToMessage(instanceKey), innerException) { } public InstanceKeyNotReadyException(XName commandName, Guid instanceId, InstanceKey instanceKey, string message, Exception innerException) : base(commandName, instanceId, message, innerException) { InstanceKey = instanceKey; } [SecurityCritical] protected InstanceKeyNotReadyException(SerializationInfo info, StreamingContext context) : base(info, context) { Guid guid = (Guid) info.GetValue(InstanceKeyName, typeof(Guid)); InstanceKey = guid == Guid.Empty ? null : new InstanceKey(guid); } public InstanceKey InstanceKey { 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(InstanceKeyName, (InstanceKey != null && InstanceKey.IsValid) ? InstanceKey.Value : Guid.Empty, typeof(Guid)); } static string ToMessage(InstanceKey instanceKey) { if (instanceKey != null && instanceKey.IsValid) { return SRCore.KeyNotReadySpecific(instanceKey.Value); } return SRCore.KeyNotReadyDefault; } } } // 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
- Descriptor.cs
- MultilineStringEditor.cs
- NumericExpr.cs
- CompositionTarget.cs
- PrimaryKeyTypeConverter.cs
- XmlSchemaSimpleTypeUnion.cs
- HwndAppCommandInputProvider.cs
- MultipleViewPattern.cs
- HierarchicalDataSourceControl.cs
- ImportContext.cs
- TextTreeText.cs
- SignatureHelper.cs
- assemblycache.cs
- NodeInfo.cs
- WebPartPersonalization.cs
- ChannelTraceRecord.cs
- TransformerConfigurationWizardBase.cs
- GetIndexBinder.cs
- DataAdapter.cs
- CacheMemory.cs
- NamespaceInfo.cs
- PackageRelationshipCollection.cs
- HttpModuleCollection.cs
- QueryCursorEventArgs.cs
- Renderer.cs
- QueryResponse.cs
- DataSvcMapFileSerializer.cs
- BamlRecordReader.cs
- X509Utils.cs
- HtmlWindow.cs
- EventProperty.cs
- AnimationClock.cs
- ServerProtocol.cs
- AmbientLight.cs
- FlowDocumentReaderAutomationPeer.cs
- PrintingPermissionAttribute.cs
- WebPartZone.cs
- BindingsSection.cs
- EventPropertyMap.cs
- ApplicationHost.cs
- BitmapDownload.cs
- LZCodec.cs
- PrintingPermissionAttribute.cs
- WsatConfiguration.cs
- BCLDebug.cs
- AsyncInvokeContext.cs
- TextBounds.cs
- ArgumentException.cs
- WebPartCollection.cs
- WebPartVerbCollection.cs
- ResourceContainer.cs
- VirtualPath.cs
- ListComponentEditorPage.cs
- SimpleType.cs
- CompiledRegexRunner.cs
- SafeCryptContextHandle.cs
- HtmlTable.cs
- UiaCoreTypesApi.cs
- wgx_commands.cs
- JumpPath.cs
- Permission.cs
- Typography.cs
- HTMLTextWriter.cs
- WindowsSlider.cs
- VisualProxy.cs
- SQLStringStorage.cs
- SqlCacheDependencySection.cs
- LinearQuaternionKeyFrame.cs
- Single.cs
- BitStack.cs
- HeaderFilter.cs
- SchemaElementDecl.cs
- StorageEntityTypeMapping.cs
- DeclarationUpdate.cs
- PassportAuthentication.cs
- Attachment.cs
- TypeDefinition.cs
- EntityDataSourceChangingEventArgs.cs
- DataGridTextBox.cs
- StringOutput.cs
- AccessDataSourceView.cs
- IntellisenseTextBox.designer.cs
- VisualBasicSettingsHandler.cs
- XPathChildIterator.cs
- Viewport3DAutomationPeer.cs
- HttpCapabilitiesEvaluator.cs
- X500Name.cs
- FontEmbeddingManager.cs
- DataGridLinkButton.cs
- SolidColorBrush.cs
- XpsManager.cs
- DataIdProcessor.cs
- ResourceBinder.cs
- SystemSounds.cs
- InputLangChangeEvent.cs
- Validator.cs
- ComplusEndpointConfigContainer.cs
- FormatterConverter.cs
- AppDomainAttributes.cs
- Function.cs