Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- RefreshPropertiesAttribute.cs
- BreakRecordTable.cs
- PropertyItemInternal.cs
- UnionExpr.cs
- DiscoveryDocumentSerializer.cs
- PenContexts.cs
- LocalizabilityAttribute.cs
- ByteStack.cs
- Encoder.cs
- BufferAllocator.cs
- BindingExpressionUncommonField.cs
- ManagementOperationWatcher.cs
- FaultCode.cs
- TextBoxAutoCompleteSourceConverter.cs
- WinCategoryAttribute.cs
- DebugView.cs
- CustomAttributeBuilder.cs
- MachineSettingsSection.cs
- HtmlInputSubmit.cs
- SettingsPropertyNotFoundException.cs
- DocumentPageTextView.cs
- LassoSelectionBehavior.cs
- Group.cs
- FileInfo.cs
- TextTreePropertyUndoUnit.cs
- WizardSideBarListControlItem.cs
- DataServiceBehavior.cs
- ZipIOExtraFieldZip64Element.cs
- SQLInt32Storage.cs
- PrinterResolution.cs
- NameTable.cs
- UpdateManifestForBrowserApplication.cs
- Divide.cs
- RestClientProxyHandler.cs
- SemanticKeyElement.cs
- ModelVisual3D.cs
- MethodBuilder.cs
- TextSchema.cs
- DoubleAnimationUsingKeyFrames.cs
- IssuanceLicense.cs
- Error.cs
- SerializerDescriptor.cs
- StrokeSerializer.cs
- WebPartHelpVerb.cs
- PathFigure.cs
- OdbcConnectionHandle.cs
- ProxyWebPartConnectionCollection.cs
- ServerIdentity.cs
- FieldToken.cs
- DrawingContextDrawingContextWalker.cs
- BamlReader.cs
- Event.cs
- HttpCapabilitiesEvaluator.cs
- PopOutPanel.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- GuidTagList.cs
- DataSourceComponent.cs
- SqlConnectionPoolGroupProviderInfo.cs
- UTF7Encoding.cs
- OracleInternalConnection.cs
- TaskSchedulerException.cs
- AppLevelCompilationSectionCache.cs
- ExponentialEase.cs
- BooleanFacetDescriptionElement.cs
- X509CertificateStore.cs
- QilPatternVisitor.cs
- TextContainerChangeEventArgs.cs
- ScrollChrome.cs
- FullTextState.cs
- InvalidFilterCriteriaException.cs
- MDIClient.cs
- DbgCompiler.cs
- Matrix.cs
- QueryContinueDragEvent.cs
- ShaderRenderModeValidation.cs
- CompilerScope.Storage.cs
- QilFunction.cs
- ToolStripScrollButton.cs
- peersecuritysettings.cs
- Merger.cs
- HTMLTextWriter.cs
- RTLAwareMessageBox.cs
- GorillaCodec.cs
- Vector3DValueSerializer.cs
- BitConverter.cs
- SqlVisitor.cs
- _SpnDictionary.cs
- ClientProxyGenerator.cs
- CompressEmulationStream.cs
- SingleObjectCollection.cs
- ExpressionWriter.cs
- RuleSetDialog.cs
- EditorZoneDesigner.cs
- StorageModelBuildProvider.cs
- CodeDirectionExpression.cs
- SecurityPermission.cs
- SimpleRecyclingCache.cs
- ColorConvertedBitmap.cs
- Parser.cs
- DependencyPropertyChangedEventArgs.cs