Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / ResourceExpressionEditor.cs / 1 / ResourceExpressionEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Web.Compilation; ///public class ResourceExpressionEditor : ExpressionEditor { /// public override object EvaluateExpression(string expression, object parseTimeData, Type propertyType, IServiceProvider serviceProvider) { ResourceExpressionFields fields; if (parseTimeData is ResourceExpressionFields) { fields = (ResourceExpressionFields)parseTimeData; } else { fields = ResourceExpressionBuilder.ParseExpression(expression); } if (String.IsNullOrEmpty(fields.ResourceKey)) { return null; } object resource = null; DesignTimeResourceProviderFactory resourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(serviceProvider); IResourceProvider resProvider; if (String.IsNullOrEmpty(fields.ClassKey)) { resProvider = resourceProviderFactory.CreateDesignTimeLocalResourceProvider(serviceProvider); } else { resProvider = resourceProviderFactory.CreateDesignTimeGlobalResourceProvider(serviceProvider, fields.ClassKey); } if (resProvider != null) { resource = resProvider.GetObject(fields.ResourceKey, System.Globalization.CultureInfo.InvariantCulture); } if (resource != null) { Type resourceType = resource.GetType(); if (!propertyType.IsAssignableFrom(resourceType)) { TypeConverter converter = TypeDescriptor.GetConverter(propertyType); if ((converter != null) && converter.CanConvertFrom(resourceType)) { return converter.ConvertFrom(resource); } } } return resource; } public override ExpressionEditorSheet GetExpressionEditorSheet(string expression, IServiceProvider serviceProvider) { return new ResourceExpressionEditorSheet(expression, serviceProvider); } } } // 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
- XmlTypeMapping.cs
- VBCodeProvider.cs
- UnicodeEncoding.cs
- NoClickablePointException.cs
- JsonQNameDataContract.cs
- NegationPusher.cs
- TypeExtensions.cs
- Ref.cs
- OrthographicCamera.cs
- WizardSideBarListControlItem.cs
- DefaultHttpHandler.cs
- HotCommands.cs
- BinaryMessageEncodingElement.cs
- DataGridRow.cs
- ListViewAutomationPeer.cs
- MsmqEncryptionAlgorithm.cs
- TextElementAutomationPeer.cs
- MarshalByRefObject.cs
- DocumentPageViewAutomationPeer.cs
- StringSorter.cs
- SymLanguageVendor.cs
- CommandDevice.cs
- CollectionViewSource.cs
- COM2ExtendedBrowsingHandler.cs
- ReadWriteObjectLock.cs
- DependencyObjectProvider.cs
- CollectionCodeDomSerializer.cs
- SafeSecurityHandles.cs
- PermissionToken.cs
- CommandHelpers.cs
- CqlErrorHelper.cs
- DocumentApplication.cs
- CodeStatement.cs
- TextSelectionProcessor.cs
- Monitor.cs
- Inflater.cs
- WindowsFormsSectionHandler.cs
- ServiceProviders.cs
- WebPartEventArgs.cs
- TextCompositionManager.cs
- ScriptRef.cs
- SecureEnvironment.cs
- PageAsyncTaskManager.cs
- WindowsPen.cs
- TileBrush.cs
- QilName.cs
- SaveFileDialog.cs
- ListBase.cs
- SupportingTokenListenerFactory.cs
- RangeBase.cs
- SrgsItemList.cs
- Vector3DKeyFrameCollection.cs
- ISO2022Encoding.cs
- URL.cs
- Hashtable.cs
- TextDecoration.cs
- TextPattern.cs
- OutOfProcStateClientManager.cs
- Operator.cs
- CapacityStreamGeometryContext.cs
- Win32Interop.cs
- Membership.cs
- DocumentPageTextView.cs
- TextEffect.cs
- MouseGesture.cs
- SizeAnimation.cs
- XslTransform.cs
- MouseWheelEventArgs.cs
- ImageAttributes.cs
- DefaultMemberAttribute.cs
- DictionaryKeyPropertyAttribute.cs
- RepeatBehaviorConverter.cs
- DataGridViewCellMouseEventArgs.cs
- SettingsSavedEventArgs.cs
- LockedActivityGlyph.cs
- ActiveDesignSurfaceEvent.cs
- CalendarDesigner.cs
- Constraint.cs
- PagePropertiesChangingEventArgs.cs
- Facet.cs
- ImageField.cs
- StorageMappingFragment.cs
- FixedPageProcessor.cs
- MethodAccessException.cs
- ApplyImportsAction.cs
- ProfessionalColorTable.cs
- ImageKeyConverter.cs
- cache.cs
- PropertyDescriptorGridEntry.cs
- PtsCache.cs
- TcpAppDomainProtocolHandler.cs
- ChameleonKey.cs
- XmlTextAttribute.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- ScrollPatternIdentifiers.cs
- ApplicationServiceHelper.cs
- QilFactory.cs
- PolicyLevel.cs
- XmlILConstructAnalyzer.cs
- InfocardClientCredentials.cs