Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / ComponentResourceKeyConverter.cs / 1 / 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
- SqlDataSourceCache.cs
- MessageOperationFormatter.cs
- DbDataReader.cs
- CodeObject.cs
- RelationshipDetailsRow.cs
- NavigationExpr.cs
- ComplexPropertyEntry.cs
- ObjectNavigationPropertyMapping.cs
- SR.cs
- LoginStatusDesigner.cs
- SelectedGridItemChangedEvent.cs
- ResourceSet.cs
- XamlRtfConverter.cs
- XmlSchemaSimpleTypeList.cs
- Message.cs
- Operand.cs
- TextViewBase.cs
- BaseTemplateParser.cs
- TextEditorMouse.cs
- FileDialogCustomPlacesCollection.cs
- PropertyDescriptorComparer.cs
- ExpandableObjectConverter.cs
- ToolStripItemEventArgs.cs
- Constants.cs
- ErrorFormatterPage.cs
- ViewSimplifier.cs
- LayoutEditorPart.cs
- FloaterParaClient.cs
- ExtensionSurface.cs
- BaseWebProxyFinder.cs
- WorkflowMessageEventArgs.cs
- StickyNote.cs
- SaveCardRequest.cs
- wgx_render.cs
- ParameterModifier.cs
- TriggerCollection.cs
- XmlQualifiedNameTest.cs
- EventDriven.cs
- SqlConnection.cs
- DtcInterfaces.cs
- SerialReceived.cs
- DateTime.cs
- AdapterDictionary.cs
- StorageRoot.cs
- Privilege.cs
- FilteredDataSetHelper.cs
- FormatConvertedBitmap.cs
- AnimatedTypeHelpers.cs
- Tokenizer.cs
- BeginStoryboard.cs
- IPAddressCollection.cs
- XMLUtil.cs
- MSAAWinEventWrap.cs
- ApplicationActivator.cs
- ConditionedDesigner.cs
- ExpressionBuilder.cs
- PrivilegedConfigurationManager.cs
- ValidatorCompatibilityHelper.cs
- EventlogProvider.cs
- XmlChoiceIdentifierAttribute.cs
- FormDocumentDesigner.cs
- TrustLevelCollection.cs
- LocalizabilityAttribute.cs
- UpdateExpressionVisitor.cs
- DataErrorValidationRule.cs
- WebServiceAttribute.cs
- WinEventQueueItem.cs
- HttpCookieCollection.cs
- BypassElementCollection.cs
- ExpanderAutomationPeer.cs
- SerializerDescriptor.cs
- DecimalFormatter.cs
- TagNameToTypeMapper.cs
- DesignerTransactionCloseEvent.cs
- Parsers.cs
- FontWeight.cs
- NamedPermissionSet.cs
- PrintDialog.cs
- EntityDataSourceContainerNameConverter.cs
- OleDbException.cs
- IdentityVerifier.cs
- SafeThemeHandle.cs
- ListControlStringCollectionEditor.cs
- RowCache.cs
- SiteMapProvider.cs
- WpfMemberInvoker.cs
- FindCriteriaApril2005.cs
- ErrorTableItemStyle.cs
- HtmlTextArea.cs
- FusionWrap.cs
- CachedPathData.cs
- VersionedStream.cs
- TextBlockAutomationPeer.cs
- StringUtil.cs
- PhysicalOps.cs
- MaskInputRejectedEventArgs.cs
- CqlQuery.cs
- DefaultPrintController.cs
- ScalarRestriction.cs
- TextBox.cs