Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CommonRemoteMemoryBlock.cs
- OperationDescription.cs
- StringOutput.cs
- ObjectRef.cs
- PersonalizationProviderCollection.cs
- PageOutputColor.cs
- ReadWriteObjectLock.cs
- IdentityHolder.cs
- ViewCellSlot.cs
- ValuePattern.cs
- ProvideValueServiceProvider.cs
- BooleanAnimationUsingKeyFrames.cs
- HttpRequestWrapper.cs
- ClientTargetCollection.cs
- IPAddressCollection.cs
- AccessViolationException.cs
- ProfileGroupSettings.cs
- ErrorWrapper.cs
- CustomValidator.cs
- StaticContext.cs
- AlternationConverter.cs
- RSAPKCS1SignatureFormatter.cs
- TextBounds.cs
- StatusBarPanel.cs
- ComPlusServiceLoader.cs
- DataGridToolTip.cs
- SoapEnumAttribute.cs
- TokenBasedSetEnumerator.cs
- SourceFilter.cs
- SystemColors.cs
- ExpressionBuilder.cs
- DirectoryRootQuery.cs
- WorkflowApplicationCompletedEventArgs.cs
- AssociationTypeEmitter.cs
- ControlUtil.cs
- TextServicesCompartment.cs
- SchemaMapping.cs
- DescendantOverDescendantQuery.cs
- BackgroundWorker.cs
- BitmapImage.cs
- HTMLTextWriter.cs
- XmlUTF8TextReader.cs
- UpdateCommand.cs
- UInt32.cs
- PointCollectionValueSerializer.cs
- GeometryValueSerializer.cs
- DataGridRowEventArgs.cs
- PersonalizationDictionary.cs
- AccessKeyManager.cs
- NativeMethods.cs
- HTTPNotFoundHandler.cs
- TreeViewImageKeyConverter.cs
- StringExpressionSet.cs
- BidOverLoads.cs
- MimeTypeAttribute.cs
- XPathArrayIterator.cs
- FloaterParagraph.cs
- BasicDesignerLoader.cs
- StrokeRenderer.cs
- ISSmlParser.cs
- MissingMemberException.cs
- Crypto.cs
- ChtmlCalendarAdapter.cs
- QuerySubExprEliminator.cs
- AssemblyHelper.cs
- SourceInterpreter.cs
- ISAPIWorkerRequest.cs
- JsonReader.cs
- RegistryExceptionHelper.cs
- ListViewHitTestInfo.cs
- SoapMessage.cs
- StylusPointPropertyInfoDefaults.cs
- IndexerNameAttribute.cs
- MultiAsyncResult.cs
- Process.cs
- ImagingCache.cs
- AssemblyEvidenceFactory.cs
- TextEffect.cs
- RedistVersionInfo.cs
- MailAddress.cs
- GlobalizationAssembly.cs
- WindowsAuthenticationModule.cs
- BackStopAuthenticationModule.cs
- ActionFrame.cs
- ObjectContextServiceProvider.cs
- DataTrigger.cs
- SqlUnionizer.cs
- TransactionException.cs
- Model3D.cs
- EventWaitHandle.cs
- HandlerWithFactory.cs
- DialogResultConverter.cs
- ColumnMapVisitor.cs
- TypeConverterAttribute.cs
- SerialPinChanges.cs
- DynamicValidatorEventArgs.cs
- ComponentEditorPage.cs
- XmlSubtreeReader.cs
- RuleConditionDialog.Designer.cs
- AppDomainManager.cs