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
- DependencyPropertyKey.cs
- SelectionPatternIdentifiers.cs
- CompilationUtil.cs
- Queue.cs
- AspNetSynchronizationContext.cs
- ReadOnlyAttribute.cs
- MenuAdapter.cs
- DataSourceSelectArguments.cs
- DelimitedListTraceListener.cs
- ActivationServices.cs
- ConfigXmlWhitespace.cs
- PolyBezierSegmentFigureLogic.cs
- PolicyVersionConverter.cs
- SqlTriggerContext.cs
- FixedSOMPageElement.cs
- QueueProcessor.cs
- IisNotInstalledException.cs
- SelectorItemAutomationPeer.cs
- WindowsAltTab.cs
- PropertyEmitter.cs
- BamlTreeUpdater.cs
- PeerObject.cs
- ClockController.cs
- Encoder.cs
- OverlappedAsyncResult.cs
- RemotingClientProxy.cs
- webeventbuffer.cs
- HotSpotCollection.cs
- ProxyWebPartManager.cs
- DebuggerAttributes.cs
- CompositeDataBoundControl.cs
- EncryptedPackage.cs
- LassoHelper.cs
- CompositeControl.cs
- NameSpaceExtractor.cs
- BamlResourceDeserializer.cs
- SmtpException.cs
- VisualBasic.cs
- Axis.cs
- SqlReferenceCollection.cs
- SupportsEventValidationAttribute.cs
- FloatUtil.cs
- ConfigurationConverterBase.cs
- Operand.cs
- UrlPropertyAttribute.cs
- Substitution.cs
- ToolStripLabel.cs
- VerificationException.cs
- XpsSerializationException.cs
- PresentationSource.cs
- CodeArgumentReferenceExpression.cs
- OneToOneMappingSerializer.cs
- PropertyGeneratedEventArgs.cs
- AgileSafeNativeMemoryHandle.cs
- ModelServiceImpl.cs
- CodeVariableReferenceExpression.cs
- MachineKey.cs
- GridViewColumnHeader.cs
- TextServicesManager.cs
- ipaddressinformationcollection.cs
- Bold.cs
- ReadWriteControlDesigner.cs
- ImageMetadata.cs
- DependentList.cs
- XmlAttributeCollection.cs
- SQLDateTimeStorage.cs
- ColorConvertedBitmap.cs
- DataBinding.cs
- SystemPens.cs
- UiaCoreProviderApi.cs
- AssemblyHelper.cs
- TemplateControlBuildProvider.cs
- SymLanguageType.cs
- ElementHostAutomationPeer.cs
- WindowsAuthenticationEventArgs.cs
- OutputCacheProfileCollection.cs
- NativeObjectSecurity.cs
- Calendar.cs
- CodeGeneratorOptions.cs
- CubicEase.cs
- TypefaceCollection.cs
- remotingproxy.cs
- OdbcException.cs
- FlowDocumentPage.cs
- WebControlsSection.cs
- DataBindEngine.cs
- BufferModeSettings.cs
- StyleCollection.cs
- ErasingStroke.cs
- DocumentXPathNavigator.cs
- IdentifierElement.cs
- JsonFormatReaderGenerator.cs
- HtmlUtf8RawTextWriter.cs
- DataGridCellInfo.cs
- MergeLocalizationDirectives.cs
- LabelDesigner.cs
- EventMappingSettings.cs
- PerformanceCounterLib.cs
- GrammarBuilderWildcard.cs
- XmlDataDocument.cs