Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / GridViewActionList.cs / 1 / GridViewActionList.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.Design.WebControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Design;
using System.Diagnostics;
using System.Web.UI.Design;
using System.Web.UI.Design.Util;
using System.Web.UI.WebControls;
using System.Windows.Forms;
///
internal class GridViewActionList : DesignerActionList {
private GridViewDesigner _gridViewDesigner;
private bool _allowDeleting;
private bool _allowEditing;
private bool _allowSorting;
private bool _allowPaging;
private bool _allowSelection;
private bool _allowRemoveField;
private bool _allowMoveLeft;
private bool _allowMoveRight;
///
public GridViewActionList(GridViewDesigner gridViewDesigner) : base(gridViewDesigner.Component) {
_gridViewDesigner = gridViewDesigner;
}
///
/// Lets the GridView designer specify whether the Delete action should be visible/enabled
///
internal bool AllowDeleting {
get {
return _allowDeleting;
}
set {
_allowDeleting = value;
}
}
///
/// Lets the GridView designer specify whether the Edit action should be visible/enabled
///
internal bool AllowEditing {
get {
return _allowEditing;
}
set {
_allowEditing = value;
}
}
///
/// Lets the GridView designer specify whether the Move Left action should be visible/enabled
///
internal bool AllowMoveLeft {
get {
return _allowMoveLeft;
}
set {
_allowMoveLeft = value;
}
}
///
/// Lets the GridView designer specify whether the Move Right action should be visible/enabled
///
internal bool AllowMoveRight {
get {
return _allowMoveRight;
}
set {
_allowMoveRight = value;
}
}
///
/// Lets the GridView designer specify whether the Page action should be visible/enabled
///
internal bool AllowPaging {
get {
return _allowPaging;
}
set {
_allowPaging = value;
}
}
///
/// Lets the GridView designer specify whether the Remove Field action should be visible/enabled
///
internal bool AllowRemoveField {
get {
return _allowRemoveField;
}
set {
_allowRemoveField = value;
}
}
///
/// Lets the GridView designer specify whether the Select action should be visible/enabled
///
internal bool AllowSelection {
get {
return _allowSelection;
}
set {
_allowSelection = value;
}
}
///
/// Lets the GridView designer specify whether the Sort action should be visible/enabled
///
internal bool AllowSorting {
get {
return _allowSorting;
}
set {
_allowSorting = value;
}
}
public override bool AutoShow {
get {
return true;
}
set {
}
}
///
///
/// Property used by chrome to display the delete checkbox. Called through reflection.
///
public bool EnableDeleting {
get {
return _gridViewDesigner.EnableDeleting;
}
set {
_gridViewDesigner.EnableDeleting = value;
}
}
///
///
/// Property used by chrome to display the delete checkbox. Called through reflection.
///
public bool EnableEditing {
get {
return _gridViewDesigner.EnableEditing;
}
set {
_gridViewDesigner.EnableEditing = value;
}
}
///
///
/// Property used by chrome to display the page checkbox. Called through reflection.
///
public bool EnablePaging {
get {
return _gridViewDesigner.EnablePaging;
}
set {
_gridViewDesigner.EnablePaging = value;
}
}
///
///
/// Property used by chrome to display the select checkbox. Called through reflection.
///
public bool EnableSelection {
get {
return _gridViewDesigner.EnableSelection;
}
set {
_gridViewDesigner.EnableSelection = value;
}
}
///
///
/// Property used by chrome to display the sort checkbox. Called through reflection.
///
public bool EnableSorting {
get {
return _gridViewDesigner.EnableSorting;
}
set {
_gridViewDesigner.EnableSorting = value;
}
}
///
///
/// Handler for the Add new field action. Called through reflection.
///
public void AddNewField() {
_gridViewDesigner.AddNewField();
}
///
///
/// Handler for the edit fields action. Called through reflection.
///
public void EditFields() {
_gridViewDesigner.EditFields();
}
///
///
/// Handler for the move field left action. Called through reflection.
///
public void MoveFieldLeft() {
_gridViewDesigner.MoveLeft();
}
///
///
/// Handler for the move field right action. Called through reflection.
///
public void MoveFieldRight() {
_gridViewDesigner.MoveRight();
}
///
///
/// Handler for the remove field action. Called through reflection.
///
public void RemoveField() {
_gridViewDesigner.RemoveField();
}
///
public override DesignerActionItemCollection GetSortedActionItems() {
DesignerActionItemCollection items = new DesignerActionItemCollection();
items.Add(new DesignerActionMethodItem(this,
"EditFields",
SR.GetString(SR.GridView_EditFieldsVerb),
"Action",
SR.GetString(SR.GridView_EditFieldsDesc)));
items.Add(new DesignerActionMethodItem(this,
"AddNewField",
SR.GetString(SR.GridView_AddNewFieldVerb),
"Action",
SR.GetString(SR.GridView_AddNewFieldDesc)));
if (AllowMoveLeft) {
items.Add(new DesignerActionMethodItem(this,
"MoveFieldLeft",
SR.GetString(SR.GridView_MoveFieldLeftVerb),
"Action",
SR.GetString(SR.GridView_MoveFieldLeftDesc)));
}
if (AllowMoveRight) {
items.Add(new DesignerActionMethodItem(this,
"MoveFieldRight",
SR.GetString(SR.GridView_MoveFieldRightVerb),
"Action",
SR.GetString(SR.GridView_MoveFieldRightDesc)));
}
if (AllowRemoveField) {
items.Add(new DesignerActionMethodItem(this,
"RemoveField",
SR.GetString(SR.GridView_RemoveFieldVerb),
"Action",
SR.GetString(SR.GridView_RemoveFieldDesc)));
}
if (AllowPaging) {
items.Add(new DesignerActionPropertyItem("EnablePaging",
SR.GetString(SR.GridView_EnablePaging),
"Behavior",
SR.GetString(SR.GridView_EnablePagingDesc)));
}
if (AllowSorting) {
items.Add(new DesignerActionPropertyItem("EnableSorting",
SR.GetString(SR.GridView_EnableSorting),
"Behavior",
SR.GetString(SR.GridView_EnableSortingDesc)));
}
if (AllowEditing) {
items.Add(new DesignerActionPropertyItem("EnableEditing",
SR.GetString(SR.GridView_EnableEditing),
"Behavior",
SR.GetString(SR.GridView_EnableEditingDesc)));
}
if (AllowDeleting) {
items.Add(new DesignerActionPropertyItem("EnableDeleting",
SR.GetString(SR.GridView_EnableDeleting),
"Behavior",
SR.GetString(SR.GridView_EnableDeletingDesc)));
}
if (AllowSelection) {
items.Add(new DesignerActionPropertyItem("EnableSelection",
SR.GetString(SR.GridView_EnableSelection),
"Behavior",
SR.GetString(SR.GridView_EnableSelectionDesc)));
}
return items;
}
}
}
// 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
- Transform3D.cs
- Cursor.cs
- KeyPressEvent.cs
- EncoderParameter.cs
- CompatibleComparer.cs
- CodeDirectoryCompiler.cs
- WsatConfiguration.cs
- webeventbuffer.cs
- SecurityDescriptor.cs
- RegexCode.cs
- DataViewListener.cs
- MarkupCompiler.cs
- ConfigDefinitionUpdates.cs
- _NativeSSPI.cs
- RemotingAttributes.cs
- ClipboardData.cs
- TemplateColumn.cs
- HashHelper.cs
- SystemColorTracker.cs
- PropertyInformation.cs
- Clipboard.cs
- SecurityDocument.cs
- WebReferenceOptions.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- DivideByZeroException.cs
- LambdaCompiler.Unary.cs
- DeferredRunTextReference.cs
- BinaryFormatter.cs
- HttpValueCollection.cs
- GradientBrush.cs
- ListViewUpdateEventArgs.cs
- SmiTypedGetterSetter.cs
- ActiveXContainer.cs
- ApplicationActivator.cs
- RowsCopiedEventArgs.cs
- XmlSchemaAnyAttribute.cs
- OutputScopeManager.cs
- CounterSampleCalculator.cs
- ACE.cs
- XPathAxisIterator.cs
- EventBookmark.cs
- RenderCapability.cs
- XmlRootAttribute.cs
- XmlParserContext.cs
- DataKeyCollection.cs
- Vertex.cs
- OutgoingWebRequestContext.cs
- Assert.cs
- Win32.cs
- OdbcFactory.cs
- Thickness.cs
- FunctionImportElement.cs
- WebHttpSecurity.cs
- RepeatButtonAutomationPeer.cs
- AppSettingsReader.cs
- RemoteWebConfigurationHostServer.cs
- TextServicesCompartmentEventSink.cs
- DataReceivedEventArgs.cs
- HostingEnvironmentWrapper.cs
- DeploymentExceptionMapper.cs
- SQLBinaryStorage.cs
- OperatorExpressions.cs
- FileUtil.cs
- PeerToPeerException.cs
- CompModSwitches.cs
- XmlILCommand.cs
- BitmapEffectRenderDataResource.cs
- CollectionTraceRecord.cs
- BaseComponentEditor.cs
- WeakHashtable.cs
- sqlstateclientmanager.cs
- FactoryId.cs
- Point3DAnimationUsingKeyFrames.cs
- OdbcParameter.cs
- Compiler.cs
- UserInitiatedNavigationPermission.cs
- LinqDataSource.cs
- HttpHandlersSection.cs
- PerformanceCounter.cs
- DynamicObjectAccessor.cs
- recordstate.cs
- QilScopedVisitor.cs
- WizardStepBase.cs
- EditorPartChrome.cs
- XmlSchemaComplexContentRestriction.cs
- Tuple.cs
- ListQueryResults.cs
- HTMLTagNameToTypeMapper.cs
- HttpApplicationFactory.cs
- ManifestResourceInfo.cs
- RedBlackList.cs
- ComProxy.cs
- ListItemsCollectionEditor.cs
- DateTimeAutomationPeer.cs
- ModelChangedEventArgsImpl.cs
- SQLRoleProvider.cs
- TextCharacters.cs
- TextRangeEditLists.cs
- AccessedThroughPropertyAttribute.cs
- Mappings.cs