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
- ListCollectionView.cs
- ResourceKey.cs
- HttpListenerContext.cs
- Size.cs
- TextRangeEdit.cs
- WebPartsPersonalizationAuthorization.cs
- ServiceModelDictionary.cs
- DataGrid.cs
- MetadataArtifactLoaderResource.cs
- SoapMessage.cs
- DataGridTextBoxColumn.cs
- DEREncoding.cs
- TextEvent.cs
- EventItfInfo.cs
- InvalidPropValue.cs
- Config.cs
- OracleDateTime.cs
- StringFreezingAttribute.cs
- ToolStripPanelRow.cs
- OracleParameterBinding.cs
- SafeSystemMetrics.cs
- ReferencedType.cs
- XmlnsCache.cs
- FileSecurity.cs
- ProcessModelInfo.cs
- EntityDataSourceWizardForm.cs
- CaseExpr.cs
- CompatibleComparer.cs
- Freezable.cs
- IncrementalCompileAnalyzer.cs
- OleDbErrorCollection.cs
- WeakEventManager.cs
- XmlSignatureProperties.cs
- PowerEase.cs
- TraceEventCache.cs
- HtmlForm.cs
- ExtendedPropertyCollection.cs
- NetPeerTcpBindingCollectionElement.cs
- ImageField.cs
- MobileControlsSectionHelper.cs
- ComplexPropertyEntry.cs
- ThemeableAttribute.cs
- MimeMapping.cs
- TaskFormBase.cs
- ForEachAction.cs
- Attributes.cs
- DataGridPageChangedEventArgs.cs
- AssemblyBuilder.cs
- CapabilitiesState.cs
- TreeNodeBindingCollection.cs
- BlurBitmapEffect.cs
- KeyboardEventArgs.cs
- OleDbCommand.cs
- DirectoryNotFoundException.cs
- TableLayoutPanelDesigner.cs
- WebHostUnsafeNativeMethods.cs
- CreateRefExpr.cs
- AssociativeAggregationOperator.cs
- DataControlButton.cs
- ScrollContentPresenter.cs
- IdnMapping.cs
- InputMethodStateChangeEventArgs.cs
- HttpCachePolicy.cs
- CryptoProvider.cs
- CacheOutputQuery.cs
- RawUIStateInputReport.cs
- RemoteWebConfigurationHostServer.cs
- GenericTypeParameterBuilder.cs
- Serializer.cs
- IndexerNameAttribute.cs
- PreloadedPackages.cs
- keycontainerpermission.cs
- TerminateDesigner.cs
- BuildProviderCollection.cs
- DataGridViewRowHeaderCell.cs
- CellTreeNode.cs
- XmlWrappingReader.cs
- SqlExpressionNullability.cs
- StylusPointProperties.cs
- StreamWithDictionary.cs
- MarkupExtensionSerializer.cs
- ImageCodecInfoPrivate.cs
- AsyncOperationManager.cs
- DataTableCollection.cs
- DoubleAnimationBase.cs
- ClientSideQueueItem.cs
- RemotingConfiguration.cs
- ActivityExecutor.cs
- MetadataSource.cs
- MediaElement.cs
- CreateParams.cs
- Span.cs
- StateRuntime.cs
- BinaryMethodMessage.cs
- PersonalizationProvider.cs
- PriorityQueue.cs
- NamespaceDisplay.xaml.cs
- DynamicDocumentPaginator.cs
- SqlServices.cs
- Transform3DCollection.cs