Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SerializationObjectManager.cs
- SerializationEventsCache.cs
- HierarchicalDataSourceControl.cs
- WriteableOnDemandPackagePart.cs
- DrawingAttributesDefaultValueFactory.cs
- ParallelEnumerableWrapper.cs
- BoundField.cs
- ScrollableControlDesigner.cs
- GlyphRun.cs
- AnimationStorage.cs
- ToolStripItemImageRenderEventArgs.cs
- AssemblyUtil.cs
- WsdlBuildProvider.cs
- HashSetEqualityComparer.cs
- IDQuery.cs
- PointKeyFrameCollection.cs
- EnumerableRowCollectionExtensions.cs
- TripleDES.cs
- DataGridViewHitTestInfo.cs
- AutomationProperty.cs
- basenumberconverter.cs
- XmlRootAttribute.cs
- CalendarTable.cs
- SelectionEditor.cs
- WebPartActionVerb.cs
- Mapping.cs
- ISCIIEncoding.cs
- Int32Storage.cs
- AliasedSlot.cs
- WindowsFormsHostPropertyMap.cs
- SkinBuilder.cs
- TitleStyle.cs
- TabItemAutomationPeer.cs
- XmlMapping.cs
- UIElement3DAutomationPeer.cs
- UniqueConstraint.cs
- Item.cs
- HttpProcessUtility.cs
- BigInt.cs
- RichTextBox.cs
- MimeObjectFactory.cs
- TraceSection.cs
- DataFormats.cs
- SQLBytes.cs
- Win32.cs
- EncryptedXml.cs
- CollectionChangedEventManager.cs
- StorageInfo.cs
- Interfaces.cs
- ValidationSummary.cs
- MsmqIntegrationMessagePool.cs
- GraphicsPathIterator.cs
- ExternalDataExchangeService.cs
- PnrpPermission.cs
- SoapEnumAttribute.cs
- DownloadProgressEventArgs.cs
- WindowsUpDown.cs
- PropertyEntry.cs
- QueryCacheEntry.cs
- DialogWindow.cs
- TableItemPattern.cs
- TypeRestriction.cs
- TextBox.cs
- ImmComposition.cs
- StylusPoint.cs
- ColorAnimationUsingKeyFrames.cs
- Menu.cs
- RelatedImageListAttribute.cs
- XPathSingletonIterator.cs
- ConfigsHelper.cs
- DataRowIndexBuffer.cs
- SapiRecoInterop.cs
- PageRanges.cs
- PassportAuthenticationModule.cs
- TextBoxAutomationPeer.cs
- ConstraintCollection.cs
- IndexerNameAttribute.cs
- WebService.cs
- ParenExpr.cs
- EventLogEntry.cs
- CapabilitiesSection.cs
- ValidatorCompatibilityHelper.cs
- ToolStripRenderer.cs
- OuterGlowBitmapEffect.cs
- PathFigure.cs
- TransformPatternIdentifiers.cs
- RelatedView.cs
- SharedStatics.cs
- Condition.cs
- HiddenFieldPageStatePersister.cs
- CodeEntryPointMethod.cs
- NativeCppClassAttribute.cs
- ClickablePoint.cs
- InplaceBitmapMetadataWriter.cs
- LiteralLink.cs
- DataControlCommands.cs
- HttpCachePolicy.cs
- TextEditorSpelling.cs
- DocumentAutomationPeer.cs
- InputScopeAttribute.cs