Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FloaterParagraph.cs
- MouseGestureConverter.cs
- XPathScanner.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- NativeMethods.cs
- WpfSharedBamlSchemaContext.cs
- RelationshipFixer.cs
- ServicePointManagerElement.cs
- SignatureToken.cs
- SurrogateDataContract.cs
- StylusCollection.cs
- RenderDataDrawingContext.cs
- EventDescriptor.cs
- FormDesigner.cs
- ImageListStreamer.cs
- WorkflowInlining.cs
- DtrList.cs
- NullableDoubleSumAggregationOperator.cs
- NumberEdit.cs
- DuplicateMessageDetector.cs
- JsonQueryStringConverter.cs
- XmlSchemaAnnotated.cs
- ValidatedControlConverter.cs
- DynamicPropertyReader.cs
- ResourceType.cs
- PeerName.cs
- EdgeProfileValidation.cs
- ControlAdapter.cs
- AnimationClock.cs
- XmlCharacterData.cs
- ActivationArguments.cs
- SoapEnumAttribute.cs
- OleDbParameterCollection.cs
- ColorConverter.cs
- SortQuery.cs
- DriveNotFoundException.cs
- processwaithandle.cs
- PageParser.cs
- Rule.cs
- SamlAttributeStatement.cs
- RegularExpressionValidator.cs
- MultidimensionalArrayItemReference.cs
- CompilationSection.cs
- SerializableTypeCodeDomSerializer.cs
- PointIndependentAnimationStorage.cs
- WebPartMovingEventArgs.cs
- CellQuery.cs
- SafeRightsManagementHandle.cs
- TableItemStyle.cs
- IPEndPoint.cs
- CqlGenerator.cs
- CardSpaceException.cs
- SrgsElementFactory.cs
- BufferedReceiveManager.cs
- ItemCollectionEditor.cs
- QfeChecker.cs
- QuaternionKeyFrameCollection.cs
- ClientConfigPaths.cs
- ToolboxComponentsCreatedEventArgs.cs
- AncillaryOps.cs
- EntityDataSourceSelectingEventArgs.cs
- TextEditorThreadLocalStore.cs
- ResourceWriter.cs
- WebPartAuthorizationEventArgs.cs
- Scene3D.cs
- DiscardableAttribute.cs
- DataRowView.cs
- HostedHttpTransportManager.cs
- RecognizerInfo.cs
- PageAsyncTaskManager.cs
- DisplayNameAttribute.cs
- FixedSOMTableCell.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TableRow.cs
- OutOfMemoryException.cs
- _DomainName.cs
- NonBatchDirectoryCompiler.cs
- TokenBasedSetEnumerator.cs
- DataServiceRequestArgs.cs
- EventSchemaTraceListener.cs
- SecureConversationServiceCredential.cs
- LogEntrySerialization.cs
- Base64Encoding.cs
- HostProtectionException.cs
- SpecialFolderEnumConverter.cs
- ScriptManagerProxy.cs
- Transform3DGroup.cs
- Bold.cs
- Paragraph.cs
- FormatException.cs
- recordstate.cs
- ModelVisual3D.cs
- DictionarySectionHandler.cs
- FullTextBreakpoint.cs
- CodeCastExpression.cs
- Selection.cs
- SimpleApplicationHost.cs
- DurableServiceAttribute.cs
- ICspAsymmetricAlgorithm.cs
- MarshalByRefObject.cs