Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / BaseDataListComponentEditor.cs / 1 / BaseDataListComponentEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Design; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Web.UI.Design.WebControls.ListControls; using System.Web.UI.WebControls; using System.Windows.Forms; using System.Windows.Forms.Design; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public abstract class BaseDataListComponentEditor : WindowsFormsComponentEditor { private int initialPage; ////// Provides the /// base component editor for Web Forms DataGrid and DataList controls. /// ////// /// public BaseDataListComponentEditor(int initialPage) { this.initialPage = initialPage; } ////// Initializes a new instance of ///. /// /// /// public override bool EditComponent(ITypeDescriptorContext context, object obj, IWin32Window parent) { bool result = false; bool inTemplateMode = false; Debug.Assert(obj is IComponent, "Expected obj to be an IComponent"); IComponent comp = (IComponent)obj; ISite compSite = comp.Site; if (compSite != null) { IDesignerHost designerHost = (IDesignerHost)compSite.GetService(typeof(IDesignerHost)); IDesigner compDesigner = designerHost.GetDesigner(comp); Debug.Assert(compDesigner is TemplatedControlDesigner, "Expected BaseDataList to have a TemplatedControlDesigner"); TemplatedControlDesigner tplDesigner = (TemplatedControlDesigner)compDesigner; inTemplateMode = tplDesigner.InTemplateModeInternal; } if (inTemplateMode == false) { Type[] pageControlTypes = GetComponentEditorPages(); if ((pageControlTypes != null) && (pageControlTypes.Length != 0)) { ComponentEditorForm form = new ComponentEditorForm(obj, pageControlTypes); // Set RightToLeft mode based on resource file string rtlText = SR.GetString(SR.RTL); if (!String.Equals(rtlText, "RTL_False", StringComparison.Ordinal)) { form.RightToLeft = RightToLeft.Yes; form.RightToLeftLayout = true; } if (form.ShowForm(parent, GetInitialComponentEditorPageIndex()) == DialogResult.OK) result = true; } } else { RTLAwareMessageBox.Show(null, SR.GetString(SR.BDL_TemplateModePropBuilder), SR.GetString(SR.BDL_PropertyBuilder), MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 0); } return result; } ////// Edits a component. /// ////// /// protected override int GetInitialComponentEditorPageIndex() { return initialPage; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved./// Gets the index of the initial component editor page. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextContainerHelper.cs
- OracleDataReader.cs
- NameTable.cs
- TokenBasedSetEnumerator.cs
- RotateTransform.cs
- ServiceModelExtensionElement.cs
- FastEncoder.cs
- Currency.cs
- AsymmetricSignatureFormatter.cs
- UriParserTemplates.cs
- HtmlLink.cs
- ValueTable.cs
- TransformerTypeCollection.cs
- ParameterToken.cs
- columnmapfactory.cs
- DelimitedListTraceListener.cs
- DesignerOptionService.cs
- QueryOpeningEnumerator.cs
- XmlnsDictionary.cs
- Encoder.cs
- XPathBinder.cs
- DecimalAverageAggregationOperator.cs
- TypeUnloadedException.cs
- ContentIterators.cs
- StylusOverProperty.cs
- ProbeRequestResponseAsyncResult.cs
- DeferredRunTextReference.cs
- DataReaderContainer.cs
- Vector3DCollection.cs
- CompilerWrapper.cs
- AttachedPropertyBrowsableAttribute.cs
- ScriptMethodAttribute.cs
- FactorySettingsElement.cs
- Stack.cs
- MetadataPropertyCollection.cs
- PartialClassGenerationTaskInternal.cs
- PassportAuthentication.cs
- FormatVersion.cs
- XmlSchemaAttribute.cs
- ConfigurationSchemaErrors.cs
- WindowsScroll.cs
- XmlNodeComparer.cs
- BlobPersonalizationState.cs
- Configuration.cs
- SmtpLoginAuthenticationModule.cs
- BCryptNative.cs
- ScriptManager.cs
- MinimizableAttributeTypeConverter.cs
- ClientFormsAuthenticationCredentials.cs
- DiscardableAttribute.cs
- PropertiesTab.cs
- ResourceContainer.cs
- CodeSubDirectoriesCollection.cs
- SqlOuterApplyReducer.cs
- BooleanExpr.cs
- DefaultValueAttribute.cs
- SafeRightsManagementHandle.cs
- Label.cs
- DataSourceControlBuilder.cs
- AuthenticatingEventArgs.cs
- regiisutil.cs
- FunctionImportMapping.cs
- ReadOnlyHierarchicalDataSourceView.cs
- HtmlEmptyTagControlBuilder.cs
- QuaternionAnimation.cs
- Shape.cs
- AccessDataSource.cs
- DataGridViewRowsRemovedEventArgs.cs
- EndpointIdentityConverter.cs
- TextParagraphCache.cs
- KnownBoxes.cs
- CompilerGlobalScopeAttribute.cs
- ApplyHostConfigurationBehavior.cs
- DragDeltaEventArgs.cs
- FileDialog_Vista.cs
- TextRangeSerialization.cs
- ConnectionStringSettingsCollection.cs
- SafeNativeMethods.cs
- TemplateColumn.cs
- ProcessHostFactoryHelper.cs
- ServicesUtilities.cs
- WCFModelStrings.Designer.cs
- MLangCodePageEncoding.cs
- DecodeHelper.cs
- RtfToken.cs
- HwndSubclass.cs
- SkipStoryboardToFill.cs
- HtmlCalendarAdapter.cs
- OdbcEnvironmentHandle.cs
- SequentialWorkflowHeaderFooter.cs
- FontFamily.cs
- HtmlTableCellCollection.cs
- BasicHttpBinding.cs
- Int32CollectionConverter.cs
- Msec.cs
- InternalConfigRoot.cs
- RandomDelaySendsAsyncResult.cs
- DbConnectionPoolGroup.cs
- ScriptingWebServicesSectionGroup.cs
- BuilderPropertyEntry.cs