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
- CodeTypeReferenceExpression.cs
- ControlSerializer.cs
- GeneralTransform3DGroup.cs
- ReferenceService.cs
- ToolBarDesigner.cs
- DayRenderEvent.cs
- OdbcConnection.cs
- DiscreteKeyFrames.cs
- SlotInfo.cs
- DocumentPageViewAutomationPeer.cs
- EntityContainerEmitter.cs
- ApplicationServiceManager.cs
- LinkTarget.cs
- DataGridViewComboBoxEditingControl.cs
- CipherData.cs
- SecuritySessionSecurityTokenProvider.cs
- RawMouseInputReport.cs
- TextEditorLists.cs
- DataConnectionHelper.cs
- ByteArrayHelperWithString.cs
- XmlValidatingReaderImpl.cs
- HtmlContainerControl.cs
- TextInfo.cs
- WebServiceParameterData.cs
- GroupItemAutomationPeer.cs
- HtmlElementEventArgs.cs
- XmlKeywords.cs
- PropertyDescriptorGridEntry.cs
- RoleManagerSection.cs
- TreeView.cs
- LocalsItemDescription.cs
- embossbitmapeffect.cs
- TextAnchor.cs
- TextureBrush.cs
- ConsumerConnectionPoint.cs
- HttpResponseInternalWrapper.cs
- StateManager.cs
- OptimalTextSource.cs
- CalendarDataBindingHandler.cs
- ContainerControl.cs
- smtpconnection.cs
- QilBinary.cs
- XmlObjectSerializer.cs
- TextDecoration.cs
- SerializationException.cs
- dataprotectionpermission.cs
- Panel.cs
- WizardStepBase.cs
- TypeResolvingOptions.cs
- ComplexPropertyEntry.cs
- ISAPIApplicationHost.cs
- BaseAppDomainProtocolHandler.cs
- CleanUpVirtualizedItemEventArgs.cs
- VectorCollectionValueSerializer.cs
- ControlParameter.cs
- ConfigurationLockCollection.cs
- BitmapSourceSafeMILHandle.cs
- MLangCodePageEncoding.cs
- ButtonChrome.cs
- C14NUtil.cs
- AddValidationError.cs
- SQLDateTimeStorage.cs
- DecoderFallbackWithFailureFlag.cs
- DBProviderConfigurationHandler.cs
- CompilationUnit.cs
- XmlProcessingInstruction.cs
- SystemException.cs
- FileDataSourceCache.cs
- FontDriver.cs
- PropertyMapper.cs
- MenuEventArgs.cs
- MSHTMLHostUtil.cs
- OleDbDataAdapter.cs
- UnicodeEncoding.cs
- XmlKeywords.cs
- WebPartExportVerb.cs
- DBDataPermissionAttribute.cs
- OleDbCommand.cs
- EmptyControlCollection.cs
- SettingsAttributeDictionary.cs
- RegistryKey.cs
- ConstraintCollection.cs
- QueryCacheKey.cs
- TableCell.cs
- SafeEventHandle.cs
- SymbolEqualComparer.cs
- DoubleUtil.cs
- ManagementBaseObject.cs
- BinaryEditor.cs
- IProvider.cs
- CapabilitiesUse.cs
- XmlEncoding.cs
- NoClickablePointException.cs
- XMLDiffLoader.cs
- RequestCachingSection.cs
- StoreConnection.cs
- XmlHierarchicalDataSourceView.cs
- NativeBuffer.cs
- GridView.cs
- BinarySerializer.cs