Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / ResourceReferenceKeyNotFoundException.cs / 1305600 / ResourceReferenceKeyNotFoundException.cs
//---------------------------------------------------------------------------- // // File: ResourceReferenceExpression.cs // // Description: // A resource could not be found // // Copyright (C) 2005 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; namespace System.Windows { ///Exception class for resource reference [Serializable] public class ResourceReferenceKeyNotFoundException: InvalidOperationException { ////// Constructor /// public ResourceReferenceKeyNotFoundException() { _resourceKey = null; } ////// Constructor /// public ResourceReferenceKeyNotFoundException(string message, object resourceKey) : base(message) { _resourceKey = resourceKey; } ////// Constructor (required for Xml web service) /// protected ResourceReferenceKeyNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { _resourceKey = info.GetValue("Key", typeof(object)); } ////// LineNumber that the exception occured on. /// public object Key { get { return _resourceKey; } } ////// Populates a SerializationInfo with the data needed to serialize the target object. /// /// /// The SerializationInfo to populate with data. /// /// /// The destination for this serialization. /// ////// Critical: calls Exception.GetObjectData which LinkDemands /// PublicOK: a demand exists here /// [SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("Key", _resourceKey); } private object _resourceKey; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: ResourceReferenceExpression.cs // // Description: // A resource could not be found // // Copyright (C) 2005 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; namespace System.Windows { ///Exception class for resource reference [Serializable] public class ResourceReferenceKeyNotFoundException: InvalidOperationException { ////// Constructor /// public ResourceReferenceKeyNotFoundException() { _resourceKey = null; } ////// Constructor /// public ResourceReferenceKeyNotFoundException(string message, object resourceKey) : base(message) { _resourceKey = resourceKey; } ////// Constructor (required for Xml web service) /// protected ResourceReferenceKeyNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { _resourceKey = info.GetValue("Key", typeof(object)); } ////// LineNumber that the exception occured on. /// public object Key { get { return _resourceKey; } } ////// Populates a SerializationInfo with the data needed to serialize the target object. /// /// /// The SerializationInfo to populate with data. /// /// /// The destination for this serialization. /// ////// Critical: calls Exception.GetObjectData which LinkDemands /// PublicOK: a demand exists here /// [SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("Key", _resourceKey); } private object _resourceKey; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RichTextBox.cs
- ChangePasswordDesigner.cs
- JoinCqlBlock.cs
- SettingsProviderCollection.cs
- ManagedWndProcTracker.cs
- ContextMarshalException.cs
- EventLogPermission.cs
- WorkflowMessageEventHandler.cs
- MetabaseSettings.cs
- TextFindEngine.cs
- BrowserDefinitionCollection.cs
- HideDisabledControlAdapter.cs
- ObjectDataSourceSelectingEventArgs.cs
- DiscoveryReference.cs
- Bold.cs
- BCLDebug.cs
- GenericEnumConverter.cs
- KeyboardNavigation.cs
- ComponentCache.cs
- XmlDocumentSerializer.cs
- WinFormsComponentEditor.cs
- ProgressBar.cs
- UrlAuthorizationModule.cs
- EdmMember.cs
- HyperLinkDataBindingHandler.cs
- WebControlAdapter.cs
- Triplet.cs
- SchemaExporter.cs
- TransactionContext.cs
- GroupBox.cs
- Attachment.cs
- DataGridViewHeaderCell.cs
- SqlRowUpdatedEvent.cs
- SecurityPolicySection.cs
- KeyPressEvent.cs
- Annotation.cs
- EmptyStringExpandableObjectConverter.cs
- DataServiceQueryContinuation.cs
- MimeReflector.cs
- EventLogTraceListener.cs
- BindingList.cs
- IconBitmapDecoder.cs
- AssemblyAttributesGoHere.cs
- UnrecognizedAssertionsBindingElement.cs
- odbcmetadatafactory.cs
- DocumentOrderQuery.cs
- TrustLevelCollection.cs
- _LazyAsyncResult.cs
- SelectionService.cs
- EntityModelSchemaGenerator.cs
- Win32Native.cs
- TaskFactory.cs
- RuntimeConfigurationRecord.cs
- WebEvents.cs
- Vector3DAnimationBase.cs
- BindingList.cs
- DataGridViewRowHeaderCell.cs
- RedBlackList.cs
- PeerNameRegistration.cs
- ProcessHostFactoryHelper.cs
- EdmToObjectNamespaceMap.cs
- TypeLoadException.cs
- InternalDuplexChannelListener.cs
- PolicyException.cs
- ErrorHandler.cs
- StreamUpgradeAcceptor.cs
- SkewTransform.cs
- _ConnectOverlappedAsyncResult.cs
- SerializationInfoEnumerator.cs
- HttpModuleAction.cs
- ToolStripTextBox.cs
- MatrixCamera.cs
- CharacterBuffer.cs
- CharKeyFrameCollection.cs
- EncoderBestFitFallback.cs
- Int32Storage.cs
- SupportsEventValidationAttribute.cs
- SplitterPanel.cs
- WizardPanel.cs
- ToolStripItemImageRenderEventArgs.cs
- EndSelectCardRequest.cs
- ColorDialog.cs
- HostingPreferredMapPath.cs
- CollectionBuilder.cs
- Calendar.cs
- GridViewAutomationPeer.cs
- DispatcherHookEventArgs.cs
- ButtonChrome.cs
- AssemblyAttributes.cs
- SimpleTypeResolver.cs
- ThemeableAttribute.cs
- WebSysDefaultValueAttribute.cs
- OleDbConnectionInternal.cs
- ManagedIStream.cs
- ProfileGroupSettings.cs
- CryptoSession.cs
- LocalValueEnumerator.cs
- ProcessModelSection.cs
- HtmlTernaryTree.cs
- ReliabilityContractAttribute.cs