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
- WpfGeneratedKnownProperties.cs
- ITextView.cs
- X500Name.cs
- GetParentChain.cs
- ExtendedProtectionPolicyTypeConverter.cs
- RemotingConfigParser.cs
- Formatter.cs
- ParameterReplacerVisitor.cs
- BuildResult.cs
- SaveFileDialog.cs
- DocumentApplication.cs
- MeshGeometry3D.cs
- DataGridViewControlCollection.cs
- RegexBoyerMoore.cs
- Helpers.cs
- XsltArgumentList.cs
- ComplexTypeEmitter.cs
- MetadataCacheItem.cs
- TransactionState.cs
- PointLight.cs
- LicenseContext.cs
- StrongNameMembershipCondition.cs
- StateItem.cs
- Underline.cs
- NativeMethods.cs
- XmlIncludeAttribute.cs
- XLinq.cs
- JsonClassDataContract.cs
- SiteMapDesignerDataSourceView.cs
- AuthorizationRule.cs
- Axis.cs
- ReferentialConstraint.cs
- HasCopySemanticsAttribute.cs
- BrushMappingModeValidation.cs
- HttpRuntime.cs
- FileEnumerator.cs
- EntitySetBaseCollection.cs
- WpfWebRequestHelper.cs
- StylusPoint.cs
- MulticastOption.cs
- CompiledQueryCacheEntry.cs
- XslAstAnalyzer.cs
- MemberInfoSerializationHolder.cs
- PartialList.cs
- XmlSchemaSimpleContentExtension.cs
- DefaultProxySection.cs
- Comparer.cs
- EventPrivateKey.cs
- NamespaceList.cs
- FileEnumerator.cs
- DesignTable.cs
- ToolBar.cs
- SqlClientWrapperSmiStreamChars.cs
- DelegatingTypeDescriptionProvider.cs
- CompilationLock.cs
- XsdDateTime.cs
- LineBreak.cs
- _SSPISessionCache.cs
- NCryptNative.cs
- RuntimeHelpers.cs
- Base64Stream.cs
- SoapInteropTypes.cs
- WindowInteractionStateTracker.cs
- SchemaType.cs
- DrawingDrawingContext.cs
- BulletedList.cs
- Binding.cs
- BamlVersionHeader.cs
- NamedElement.cs
- CompositeDispatchFormatter.cs
- BindingGraph.cs
- SrgsRule.cs
- BuildProvidersCompiler.cs
- WizardSideBarListControlItem.cs
- CompressionTransform.cs
- UnsafeNativeMethods.cs
- DataGridViewDataConnection.cs
- OrderPreservingSpoolingTask.cs
- WsiProfilesElement.cs
- GridViewPageEventArgs.cs
- ListBoxItem.cs
- MediaPlayerState.cs
- ActionMessageFilter.cs
- AttributeProviderAttribute.cs
- LambdaCompiler.cs
- DataRowComparer.cs
- QilChoice.cs
- EtwTrace.cs
- NamedPermissionSet.cs
- ReadOnlyCollection.cs
- SafeFileMapViewHandle.cs
- PersonalizationState.cs
- HebrewNumber.cs
- InitializeCorrelation.cs
- ManualResetEvent.cs
- MarshalDirectiveException.cs
- Rule.cs
- DataGridTablesFactory.cs
- IInstanceContextProvider.cs
- AppDomainFactory.cs