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
- RelationshipConverter.cs
- Parser.cs
- LexicalChunk.cs
- CodeGenerator.cs
- UpdateManifestForBrowserApplication.cs
- FamilyMapCollection.cs
- MonthCalendar.cs
- ProfileManager.cs
- StylusPointPropertyInfo.cs
- ItemList.cs
- PartManifestEntry.cs
- ActionFrame.cs
- ResourceManager.cs
- Message.cs
- XmlSchemaAny.cs
- TransactedReceiveScope.cs
- DataObjectFieldAttribute.cs
- IPipelineRuntime.cs
- TextEditorDragDrop.cs
- AssociationType.cs
- TimelineGroup.cs
- PriorityQueue.cs
- JsonDeserializer.cs
- TextTrailingCharacterEllipsis.cs
- EventSinkHelperWriter.cs
- GenericTypeParameterBuilder.cs
- HtmlDocument.cs
- AmbientLight.cs
- XmlReaderSettings.cs
- DelegatingConfigHost.cs
- _ConnectionGroup.cs
- MsmqIntegrationSecurityMode.cs
- ProfileBuildProvider.cs
- TextOutput.cs
- SQLInt64Storage.cs
- SmtpCommands.cs
- DrawingAttributes.cs
- ImageBrush.cs
- MetricEntry.cs
- GestureRecognizer.cs
- xsdvalidator.cs
- CatalogPartDesigner.cs
- CultureTable.cs
- WebPartEditVerb.cs
- DataBinding.cs
- PerfProviderCollection.cs
- HtmlTextBoxAdapter.cs
- documentsequencetextpointer.cs
- Pens.cs
- SqlDataSourceCache.cs
- BindingMAnagerBase.cs
- SelectionWordBreaker.cs
- TextProperties.cs
- Encoding.cs
- BindingMAnagerBase.cs
- HtmlTextViewAdapter.cs
- PolyLineSegment.cs
- SimpleMailWebEventProvider.cs
- CodeConstructor.cs
- TimelineCollection.cs
- WsatAdminException.cs
- RuntimeArgumentHandle.cs
- NumberFunctions.cs
- ObjectNavigationPropertyMapping.cs
- ColumnBinding.cs
- XmlILConstructAnalyzer.cs
- BevelBitmapEffect.cs
- XhtmlConformanceSection.cs
- TemplateKey.cs
- BitmapDecoder.cs
- ProxyFragment.cs
- FontDifferentiator.cs
- ConstructorArgumentAttribute.cs
- HeaderFilter.cs
- DoubleAnimationUsingKeyFrames.cs
- FieldToken.cs
- ColumnTypeConverter.cs
- LateBoundChannelParameterCollection.cs
- TextChange.cs
- XPathChildIterator.cs
- TraceSource.cs
- ScriptMethodAttribute.cs
- TheQuery.cs
- DataServiceKeyAttribute.cs
- UnsettableComboBox.cs
- OperationCanceledException.cs
- TextDecorationUnitValidation.cs
- MultiView.cs
- MissingMemberException.cs
- StrokeCollectionDefaultValueFactory.cs
- PasswordRecoveryDesigner.cs
- Rect3D.cs
- SqlMethodCallConverter.cs
- safelinkcollection.cs
- StackBuilderSink.cs
- PtsContext.cs
- WindowsFormsLinkLabel.cs
- CharacterBufferReference.cs
- ValidateNames.cs
- RequestResponse.cs