Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / ResourceReferenceKeyNotFoundException.cs / 1 / 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
- BinaryMethodMessage.cs
- RealProxy.cs
- XmlSchemaSimpleTypeRestriction.cs
- ServiceDeploymentInfo.cs
- ObjectViewFactory.cs
- RecipientInfo.cs
- VBIdentifierNameEditor.cs
- GradientStop.cs
- MenuAdapter.cs
- SHA384Managed.cs
- DynamicValidator.cs
- FormatVersion.cs
- wgx_sdk_version.cs
- DropSource.cs
- DrawingGroupDrawingContext.cs
- HttpRuntime.cs
- MappingSource.cs
- ObjectPropertyMapping.cs
- TextElement.cs
- ZipIOLocalFileDataDescriptor.cs
- DataGridViewComboBoxEditingControl.cs
- OperatingSystem.cs
- TraceSection.cs
- SqlClientFactory.cs
- CannotUnloadAppDomainException.cs
- XmlUTF8TextWriter.cs
- SeekableReadStream.cs
- BitmapEffectInputConnector.cs
- ToolStripHighContrastRenderer.cs
- PropertyGridCommands.cs
- MediaSystem.cs
- FixUp.cs
- ScriptingScriptResourceHandlerSection.cs
- DataGridViewCellPaintingEventArgs.cs
- Win32.cs
- XAMLParseException.cs
- SchemaMapping.cs
- Button.cs
- IPCCacheManager.cs
- NaturalLanguageHyphenator.cs
- PreProcessInputEventArgs.cs
- EnvelopedSignatureTransform.cs
- FileEnumerator.cs
- AsymmetricSignatureDeformatter.cs
- StringBuilder.cs
- SupportingTokenSecurityTokenResolver.cs
- ArrayElementGridEntry.cs
- PermissionSet.cs
- SchemaImporterExtensionsSection.cs
- UnicastIPAddressInformationCollection.cs
- SafeEventLogWriteHandle.cs
- XhtmlBasicSelectionListAdapter.cs
- TemplateXamlParser.cs
- DbConnectionHelper.cs
- TreeView.cs
- InheritablePropertyChangeInfo.cs
- _AutoWebProxyScriptHelper.cs
- EntitySqlQueryBuilder.cs
- TableFieldsEditor.cs
- CatalogPartCollection.cs
- BindingListCollectionView.cs
- SafeViewOfFileHandle.cs
- ControlTemplate.cs
- DataSourceExpression.cs
- While.cs
- DiagnosticEventProvider.cs
- SchemaMerger.cs
- SQLBytes.cs
- HandlerFactoryWrapper.cs
- Operand.cs
- MarshalByRefObject.cs
- WorkflowCreationContext.cs
- WithParamAction.cs
- CompositeDispatchFormatter.cs
- RegexCaptureCollection.cs
- DiscreteKeyFrames.cs
- ExtenderProvidedPropertyAttribute.cs
- MembershipValidatePasswordEventArgs.cs
- SafeNativeMethods.cs
- DataGridRelationshipRow.cs
- FaultBookmark.cs
- ImageSource.cs
- HuffModule.cs
- SharedUtils.cs
- SHA512Cng.cs
- CodeDelegateInvokeExpression.cs
- ConnectionManagementElement.cs
- XmlSchemas.cs
- FormViewInsertEventArgs.cs
- Convert.cs
- HttpConfigurationSystem.cs
- DecimalAnimationBase.cs
- FilterRepeater.cs
- NetNamedPipeBinding.cs
- WebInvokeAttribute.cs
- Internal.cs
- RuntimeUtils.cs
- behaviorssection.cs
- TypeExtensionConverter.cs
- WindowsGraphicsWrapper.cs