Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / ComponentResourceKeyConverter.cs / 1305600 / ComponentResourceKeyConverter.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Globalization; using System.ComponentModel.Design.Serialization; using System.Diagnostics; namespace System.Windows.Markup { ////// TypeConverter for a resource value expression /// public class ComponentResourceKeyConverter : ExpressionConverter { ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert from /// ////// true if conversion is possible /// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == null) { throw new ArgumentNullException("sourceType"); } return base.CanConvertFrom(context, sourceType); } ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert to /// ////// true if conversion is possible /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { // Validate Input Arguments if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// ////// value that is result of conversion /// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { return base.ConvertFrom(context, culture, value); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// /// /// Type to convert to /// ////// converted value /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { // Validate Input Arguments ComponentResourceKey key = value as ComponentResourceKey; if (key == null) { throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "ComponentResourceKey")); } if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Globalization; using System.ComponentModel.Design.Serialization; using System.Diagnostics; namespace System.Windows.Markup { ////// TypeConverter for a resource value expression /// public class ComponentResourceKeyConverter : ExpressionConverter { ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert from /// ////// true if conversion is possible /// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == null) { throw new ArgumentNullException("sourceType"); } return base.CanConvertFrom(context, sourceType); } ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert to /// ////// true if conversion is possible /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { // Validate Input Arguments if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// ////// value that is result of conversion /// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { return base.ConvertFrom(context, culture, value); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// /// /// Type to convert to /// ////// converted value /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { // Validate Input Arguments ComponentResourceKey key = value as ComponentResourceKey; if (key == null) { throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "ComponentResourceKey")); } if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } } } // 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
- DefaultValidator.cs
- ScriptingRoleServiceSection.cs
- ChangeNode.cs
- DataGridPageChangedEventArgs.cs
- CalendarDateRangeChangingEventArgs.cs
- cache.cs
- RolePrincipal.cs
- safesecurityhelperavalon.cs
- SafeSecurityHandles.cs
- ItemCollection.cs
- ObfuscateAssemblyAttribute.cs
- CompilerWrapper.cs
- SqlUserDefinedAggregateAttribute.cs
- _ListenerRequestStream.cs
- TreeNodeEventArgs.cs
- SafeCertificateContext.cs
- SmtpNtlmAuthenticationModule.cs
- Resources.Designer.cs
- Accessors.cs
- DbException.cs
- SQLDoubleStorage.cs
- TextElementEditingBehaviorAttribute.cs
- XDRSchema.cs
- BindingOperations.cs
- DataViewSettingCollection.cs
- TextParagraphProperties.cs
- MimePart.cs
- MemberMaps.cs
- OptionalRstParameters.cs
- VisualBasicReference.cs
- FilterElement.cs
- NameValueFileSectionHandler.cs
- DataSourceNameHandler.cs
- ArgumentOutOfRangeException.cs
- BitmapMetadataBlob.cs
- WebMessageFormatHelper.cs
- _LocalDataStore.cs
- XmlProcessingInstruction.cs
- TableCellAutomationPeer.cs
- ScrollViewerAutomationPeer.cs
- DocumentViewerConstants.cs
- GridViewDeleteEventArgs.cs
- CopyNodeSetAction.cs
- DispatcherTimer.cs
- RegexWorker.cs
- ScopelessEnumAttribute.cs
- ConsumerConnectionPoint.cs
- TransferMode.cs
- WpfPayload.cs
- AssemblyAttributes.cs
- SoapExtensionTypeElement.cs
- BitmapEncoder.cs
- CodeCompileUnit.cs
- AppSettingsSection.cs
- AnonymousIdentificationModule.cs
- StringUtil.cs
- RegexBoyerMoore.cs
- XsdDateTime.cs
- StyleHelper.cs
- TabItem.cs
- Hyperlink.cs
- BoolExpr.cs
- FixedLineResult.cs
- DeflateEmulationStream.cs
- IntranetCredentialPolicy.cs
- ComboBox.cs
- InvalidComObjectException.cs
- SizeAnimationUsingKeyFrames.cs
- NavigationHelper.cs
- Condition.cs
- FlowPosition.cs
- FrameSecurityDescriptor.cs
- ToolTipService.cs
- StrongNameUtility.cs
- ComponentEditorPage.cs
- SecureConversationVersion.cs
- GACMembershipCondition.cs
- ErrorTableItemStyle.cs
- XamlSerializerUtil.cs
- DataRowCollection.cs
- DecoderFallbackWithFailureFlag.cs
- ObjectCloneHelper.cs
- WindowPattern.cs
- QilChoice.cs
- Transform.cs
- MimePart.cs
- ServiceHostingEnvironmentSection.cs
- WriteFileContext.cs
- PageRanges.cs
- StylusLogic.cs
- DbModificationCommandTree.cs
- RotateTransform3D.cs
- ManipulationDevice.cs
- BigInt.cs
- DiscreteKeyFrames.cs
- BasicExpressionVisitor.cs
- TemplateBindingExtensionConverter.cs
- UnsafeNetInfoNativeMethods.cs
- CultureTable.cs
- TransactionFlowBindingElementImporter.cs