public StartWorkflowViaReceiveActivityController() { TargetObjectType = typeof(Task); passIntAction = new ParametrizedAction(this, "StartWithInteger", PredefinedCategory.Edit, typeof(int)); passIntAction.Execute += new ParametrizedActionExecuteEventHandler(passIntAction_Execute); passStringAction = new ParametrizedAction(this, "StartWithString", PredefinedCategory.Edit, typeof(string)); passStringAction.Execute += new ParametrizedActionExecuteEventHandler(passStringAction_Execute); }
public EasyTestController(){ _parametrizedAction = new ParametrizedAction(this,"Parameter",PredefinedCategory.View, typeof(string)); _loadModelAction = new SingleChoiceAction(this,"Action",PredefinedCategory.View); _loadModelAction.Items.Add(new ChoiceActionItem("LoadModel", null)); _loadModelAction.ItemType=SingleChoiceActionItemType.ItemIsOperation; _loadModelAction.Execute+=SingleChoiceActionOnExecute; }
public ReceiveCorrelationsDemoController() { TargetObjectType = typeof(Task); startWorkflowAction = new ParametrizedAction(this, "StartWorkflow", PredefinedCategory.Edit, typeof(string)); startWorkflowAction.Execute += new ParametrizedActionExecuteEventHandler(startWorkflowAction_Execute); stopWorkflowAction = new ParametrizedAction(this, "StopWorkflow", PredefinedCategory.Edit, typeof(string)); stopWorkflowAction.Execute += new ParametrizedActionExecuteEventHandler(stopWorkflowAction_Execute); }
private Action GetRevealedDependencyParameterizedAction() { ParametrizedAction revealDependencyParameterized = new ParametrizedAction("reveal-dependency"); Parameter agentParameter = GetAgentParameter(); Parameter dependencyParameter = GetDependencyParameter(); revealDependencyParameterized.AddParameter(agentParameter); revealDependencyParameterized.AddParameter(dependencyParameter); CompoundFormula preconditions = new CompoundFormula("and"); CompoundFormula effects = new CompoundFormula("and"); ParametrizedPredicate revealedSomething = GetParameterizedRevealedSomething(); ParametrizedPredicate revealedDependency = GetParameterizedRevealed(); ParametrizedPredicate belongsTo = GetParameterizedBelongsTo(); Predicate notRevealedSomething = revealedSomething.Negate(); Predicate notRevealedDependency = revealedDependency.Negate(); preconditions.AddOperand(notRevealedSomething); preconditions.AddOperand(notRevealedDependency); preconditions.AddOperand(belongsTo); effects.AddOperand(revealedSomething); effects.AddOperand(revealedDependency); revealDependencyParameterized.Preconditions = preconditions; revealDependencyParameterized.SetEffects(effects); return(revealDependencyParameterized); }
public WebShowDetailViewFromDashboardController() { openDetailViewAction = new ParametrizedAction(this, "Dashboard_OpenDetailView", "Dashboard", typeof(string)); openDetailViewAction.Caption = "OpenDetailView"; openDetailViewAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; openDetailViewAction.Execute += OpenDetailViewAction_Execute; }
public CustomizeMenuActionsController() { TargetObjectType = typeof(CustomizeMenuActionControl); TargetViewType = ViewType.DetailView; CustomStringParametrizedAction = new ParametrizedAction(this, "StringEditMask", PredefinedCategory.RecordEdit, typeof(string)); CustomStringParametrizedAction.PaintStyle = DevExpress.ExpressApp.Templates.ActionItemPaintStyle.Image; CustomStringParametrizedAction.ToolTip = "String Edit Mask Customize"; CustomDateParametrizedAction = new ParametrizedAction(this, "DateTimeEditMask", PredefinedCategory.RecordEdit, typeof(DateTime)); CustomDateParametrizedAction.ToolTip = "DateTime Edit Mask Customize"; CustomDateParametrizedAction.PaintStyle = DevExpress.ExpressApp.Templates.ActionItemPaintStyle.Image; CustomizeWidthSingleChoiceAction = new SingleChoiceAction(this, "CustomWidth", PredefinedCategory.Reports); CustomizeWidthSingleChoiceAction.Items.Add(new ChoiceActionItem("First", null)); CustomizeWidthSingleChoiceAction.Items.Add(new ChoiceActionItem("Second", null)); CustomizeWidthSingleChoiceAction.Items.Add(new ChoiceActionItem("Third", null)); ClientClickScriptViaCustomizeControl = new SimpleAction(this, "ClientScriptOnEvent", PredefinedCategory.Reports); ClientClickScriptViaCustomizeControl.ToolTip = "Client click script is edit using ActionBase.CustomizeControl event"; ClientClickScriptViaExtentionsSimpleAction = new SimpleAction(this, "ClientScript", PredefinedCategory.Reports); ClientClickScriptViaExtentionsSimpleAction.ToolTip = "Client click script is edit using extention"; ClientClickScriptViaExtentionsSimpleAction.SetClientScript("alert('Clicked!');", false); CustomStringParametrizedAction.CustomizeControl += CustomStringParametrizedAction_CustomizeControl; CustomDateParametrizedAction.CustomizeControl += CustomDateParametrizedAction_CustomizeControl; CustomizeWidthSingleChoiceAction.CustomizeControl += CustomizeWidthSingleChoiceAction_CustomizeControl; ClientClickScriptViaCustomizeControl.CustomizeControl += ClientClickScriptViaCustomizeControl_CustomizeControl; }
public ExportReportToTXT_TestController() : base() { ParametrizedAction exportToTxt = new ParametrizedAction(this, "ExportToTxt", DialogActionContainerName, typeof(string)); exportToTxt.Execute += exportToTxt_Execute; }
public WebFilterTreeListViewController() { findNodeAction = new ParametrizedAction(this, "FindNode", DevExpress.Persistent.Base.PredefinedCategory.FullTextSearch, typeof(String)); findNodeAction.Caption = "Smart Search"; findNodeAction.PaintStyle = DevExpress.ExpressApp.Templates.ActionItemPaintStyle.Image; findNodeAction.Execute += new ParametrizedActionExecuteEventHandler(findNodeAction_Execute); }
public StartWorkflowViaReceiveActivityController() { TargetObjectType = typeof(Task); passIntAction = new ParametrizedAction(this, "StartWithInteger", PredefinedCategory.Edit, typeof(int)); passIntAction.Execute += new ParametrizedActionExecuteEventHandler(passIntAction_Execute); passStringAction = new ParametrizedAction(this, "StartWithString", PredefinedCategory.Edit, typeof(string)); passStringAction.Execute += new ParametrizedActionExecuteEventHandler(passStringAction_Execute); }
public EasyTestController() { _parametrizedAction = new ParametrizedAction(this, "Parameter", PredefinedCategory.View, typeof(string)); var singleChoiceAction = new SingleChoiceAction(this, "Action", PredefinedCategory.View); singleChoiceAction.Items.Add(new ChoiceActionItem("LoadModel", null)); singleChoiceAction.Execute += SingleChoiceActionOnExecute; }
public DateParametrizedActionController() { DateActtion = new ParametrizedAction(this, "DateAction", DevExpress.Persistent.Base.PredefinedCategory.Edit, typeof(DateTime)); DateActtion.Execute += DateActtion_Execute; DateActtion.CustomizeControl += DateActtion_CustomizeControl; }
public ParametrizedActionValueTypeStringController() { this.TargetViewId = "ParametrizedActionRootObject_DetailView"; ParametrizedAction parametrizedAction = new ParametrizedAction(this, "String", "StringValueParametrizedActions", typeof(string)); parametrizedAction.ToolTip = ActionsDemoStrings.StringValueTooltip; parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(ParametrizedActionRootObject.parametrizedAction_Execute); }
public ParametrizedActionConfirmationMessageIsEmptyController() { targetProperty = "ConfirmationMessageIsEmpty"; ParametrizedAction parametrizedAction = new ParametrizedAction(this, "ParametrizedAction" + targetProperty, PredefinedCategory.Edit, typeof(string)); parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(ParametrizedActionRootObject.parametrizedAction_Execute); parametrizedAction.Caption = ActionsDemoStrings.ConfirmationMessageIsEmpty; parametrizedAction.ToolTip = ActionsDemoStrings.ConfirmationMessageIsEmptyTooltip; }
public ReceiveCorrelationsDemoController() { TargetObjectType = typeof(Task); startWorkflowAction = new ParametrizedAction(this, "StartWorkflow", PredefinedCategory.RecordEdit, typeof(string)); startWorkflowAction.Execute += new ParametrizedActionExecuteEventHandler(startWorkflowAction_Execute); stopWorkflowAction = new ParametrizedAction(this, "StopWorkflow", PredefinedCategory.RecordEdit, typeof(string)); stopWorkflowAction.Execute += new ParametrizedActionExecuteEventHandler(stopWorkflowAction_Execute); }
public ParametrizedActionController() { ParametrizedAction parametrizedAction = new ParametrizedAction(this, "ParametrizedDemoAction", PredefinedCategory.Edit, typeof(string)); parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(ParametrizedActionRootObject.parametrizedAction_Execute); parametrizedAction.Value = ActionsDemoStrings.SimpleString; parametrizedAction.ImageName = ActionsDemoStrings.ParametrizedActionImageName; parametrizedAction.ToolTip = ActionsDemoStrings.ParametrizedActionTooltip; }
public UniversalSearchController() { OpenDetailViewAction = new SimpleAction(this, "ShowDetailView", "Hidden"); OpenDetailViewAction.Caption = "ShowDetailView"; OpenDetailViewAction.Execute += ShowDetailView_Execute; // Target required Views (via the TargetXXX properties) and create their Actions. SearchAction = new ParametrizedAction(this, "Universal Search", DevExpress.Persistent.Base.PredefinedCategory.View, typeof(string)); SearchAction.Execute += Search_Execute; this.TargetObjectType = typeof(UniversalSearchResult); FullTextSearchTargetPropertiesMode = FullTextSearchTargetPropertiesMode.AllSearchableMembers; }
public WinFilterTreeListViewController() { ParametrizedAction findNodeAction = new ParametrizedAction(this, "FindNode", DevExpress.Persistent.Base.PredefinedCategory.FullTextSearch, typeof(String)); findNodeAction.Caption = "Smart Search"; findNodeAction.Execute += new ParametrizedActionExecuteEventHandler(findNodeAction_Execute); ParametrizedAction focusNodeAction = new ParametrizedAction(this, "FocusNode", DevExpress.Persistent.Base.PredefinedCategory.FullTextSearch, typeof(String)); focusNodeAction.Caption = "Focus"; focusNodeAction.Execute += new ParametrizedActionExecuteEventHandler(focusNodeAction_Execute); }
public EasyTestController() { _parametrizedAction = new ParametrizedAction(this, "Parameter", PredefinedCategory.View, typeof(string)); _easyTestAction = new SingleChoiceAction(this, "EasyTestAction", PredefinedCategory.View) { Caption = "EasyTestAction" }; _easyTestAction.Items.Add(new ChoiceActionItem(LoadModel, null)); _easyTestAction.Items.Add(new ChoiceActionItem(MergeModel, null)); _easyTestAction.ItemType = SingleChoiceActionItemType.ItemIsOperation; _easyTestAction.Execute += SingleChoiceActionOnExecute; }
public StatisticsTopCustomersController() { TargetViewId = ViewIdProvider.StatisticsTopCustomers; _topCustomersPeriodAction = new SingleChoiceAction(this, TopCustomersPeriod, PredefinedCategory.Filters); _topCustomersPeriodAction.Items.Add(new ChoiceActionItem(ThisMonth, ThisMonth)); _topCustomersPeriodAction.Items.Add(new ChoiceActionItem(LastMonth, LastMonth)); _topCustomersPeriodAction.Items.Add(new ChoiceActionItem(Last12Months, Last12Months)); _topCustomersPeriodAction.Caption = "Period"; _topCustomersPeriodAction.Execute += TopCustomersPeriodOnExecute; var topCustomersCountAction = new ParametrizedAction(this, TopCustomersCount, PredefinedCategory.Filters, typeof(int)); topCustomersCountAction.Execute += TopCustomersCountActionOnExecute; }
private static Action ReadAction(CompoundExpression exp, Domain d) { string sName = exp.SubExpressions[0].ToString(); Action pa = null; int iExpression = 0; for (iExpression = 1; iExpression < exp.SubExpressions.Count; iExpression++) { if (exp.SubExpressions[iExpression].ToString() == ":parameters") { CompoundExpression ceParams = (CompoundExpression)exp.SubExpressions[iExpression + 1]; if (ceParams.Type != "N/A") { pa = new ParametrizedAction(sName); ReadParameters((CompoundExpression)exp.SubExpressions[iExpression + 1], (ParametrizedAction)pa); } iExpression++; } else if (exp.SubExpressions[iExpression].ToString() == ":effect") { if (pa == null) { pa = new Action(sName); } ReadEffect((CompoundExpression)exp.SubExpressions[iExpression + 1], pa, d, pa is ParametrizedAction); iExpression++; } else if (exp.SubExpressions[iExpression].ToString() == ":precondition") { if (pa == null) { pa = new Action(sName); } ReadPrecondition((CompoundExpression)exp.SubExpressions[iExpression + 1], pa, d, pa is ParametrizedAction); iExpression++; } else if (exp.SubExpressions[iExpression].ToString() == ":observe") { if (pa == null) { pa = new Action(sName); } ReadObserve((CompoundExpression)exp.SubExpressions[iExpression + 1], pa, d, pa is ParametrizedAction); iExpression++; } } return(pa); }
/* * private List<Action> GetRevealedDummyDependencyActions(List<Agent> m_agents) * { * List<Action> actions = new List<Action>(); * foreach(Agent agent in m_agents) * { * int amountOfDependencies = amountOfAgentDependencies[agent]; * if (amountOfDependencies < maxDependenciesOfAgent) //only do this dummy action for agents which don't have the max dependencies amount, so they will not stuck the other agents who want to reveal a dependency... * actions.Add(GetRevealedDummyDependencyAction(agent)); * } * * return actions; * } */ /* * private Action GetRevealedDummyDependencyAction(Agent agent) * { * Constant a = mapAgentToConstant[agent]; * Action dummyAction = new Action("reveal-dummy-dependency_" + a.Name); * * CompoundFormula preconditions = new CompoundFormula("and"); * * GroundedFunctionPredicate amountOfDepRevGrounded = GetAmountOfDependenciesRevealedGrounded(a); * GroundedFunctionPredicate equalsToMax = GetEqualsToMaxGrounded(amountOfDepRevGrounded); * Predicate notEqualsToMax = equalsToMax.Negate(); * * GroundedFunctionPredicate increaseAmountOfDepRev = GetIncreaseAmountOfDependenciesRevealedGrounded(amountOfDepRevGrounded); * //GroundedPredicate revealedSomething = new GroundedPredicate("revealed-something"); * //revealedSomething.AddConstant(a); * * //Predicate notRevealedSomething = revealedSomething.Negate(); * * preconditions.AddOperand(notEqualsToMax); * PredicateFormula effects = new PredicateFormula(increaseAmountOfDepRev); * * foreach (Dependency dependency in agentsDependencies[agent]) * { * GroundedPredicate revealedDependency = new GroundedPredicate("revealed"); * Constant d = mapDependencyToConstant[dependency]; * revealedDependency.AddConstant(d); * * preconditions.AddOperand(revealedDependency); * } * * dummyAction.Preconditions = preconditions; * dummyAction.SetEffects(effects); * * return dummyAction; * } */ /* * private Action GetResetDependenciesRevealedAction(GroundedFunctionPredicate totalCostFunctionPredicate) * { * Action resetDependenciesRevealed = new Action(resetDependenciesActionName); * * CompoundFormula preconditions = new CompoundFormula("and"); * CompoundFormula effects = new CompoundFormula("and"); * * foreach(Constant agent in agentsConstants) * { * GroundedPredicate revealedSomething = new GroundedPredicate("revealed-something"); * revealedSomething.AddConstant(agent); * * Predicate notRevealedSomething = revealedSomething.Negate(); * * preconditions.AddOperand(revealedSomething); * effects.AddOperand(notRevealedSomething); * } * * effects.AddOperand(GetIncreaseTotalCostFunction(totalCostFunctionPredicate, revealedDependencyCost)); * * resetDependenciesRevealed.Preconditions = preconditions; * resetDependenciesRevealed.SetEffects(effects); * * return resetDependenciesRevealed; * } */ private Action GetRevealedDependencyParameterizedAction() { ParametrizedAction revealDependencyParameterized = new ParametrizedAction("reveal-dependency"); Parameter agentParameter = GetAgentParameter(); Parameter dependencyParameter = GetDependencyParameter(); Parameter num1Parameter = GetNum1Parameter(); Parameter num2Parameter = GetNum2Parameter(); revealDependencyParameterized.AddParameter(agentParameter); revealDependencyParameterized.AddParameter(dependencyParameter); revealDependencyParameterized.AddParameter(num1Parameter); revealDependencyParameterized.AddParameter(num2Parameter); CompoundFormula preconditions = new CompoundFormula("and"); CompoundFormula effects = new CompoundFormula("and"); ParametrizedPredicate nextN1N2 = GetParameterizedNext(num1Parameter, num2Parameter); ParametrizedPredicate revealedNumberOfDependenciesN1 = GetParameterizedRevealedNumberOfDependencies(agentParameter, num1Parameter); ParametrizedPredicate revealedNumberOfDependenciesN2 = GetParameterizedRevealedNumberOfDependencies(agentParameter, num2Parameter); //ParametrizedPredicate revealedSomething = GetParameterizedRevealedSomething(); ParametrizedPredicate revealedDependency = GetParameterizedRevealed(); ParametrizedPredicate belongsTo = GetParameterizedBelongsTo(); Predicate NotRevealedNumberOfDependenciesN1 = revealedNumberOfDependenciesN1.Negate(); //Predicate notRevealedSomething = revealedSomething.Negate(); //Predicate notRevealedDependency = revealedDependency.Negate(); preconditions.AddOperand(nextN1N2); preconditions.AddOperand(revealedNumberOfDependenciesN1); //preconditions.AddOperand(notRevealedSomething); //preconditions.AddOperand(notRevealedDependency); preconditions.AddOperand(belongsTo); //effects.AddOperand(revealedSomething); effects.AddOperand(revealedDependency); if (limitingTheNumberOfDependenciesToBeRevealed) { effects.AddOperand(NotRevealedNumberOfDependenciesN1); effects.AddOperand(revealedNumberOfDependenciesN2); } revealDependencyParameterized.Preconditions = preconditions; revealDependencyParameterized.SetEffects(effects); return(revealDependencyParameterized); }
public FullTextContains(){ var singleChoiceAction = new SingleChoiceAction(this,GetType().Name,PredefinedCategory.ObjectsCreation){ ItemType = SingleChoiceActionItemType.ItemIsOperation, }; TargetObjectType = typeof(FullTextContainsObject); singleChoiceAction.Items.Add(new ChoiceActionItem(XpandGridListEditor, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(AdvBandedListEditor, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(CollectionSourceCriteria, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(CriteriaPropertyEditorEx, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(ColumnFilterChanged, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(XpandObjectSpaceProvider, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(PopupCriteriaPropertyEditorEx, null)); singleChoiceAction.Execute+=SingleChoiceActionOnExecute; _parametrizedAction = new ParametrizedAction(this,"FullTextContainsParam",PredefinedCategory.View, typeof(string)); _parametrizedAction.Execute+=ParametrizedActionOnExecute; }
public GenerateDataController() { TargetObjectType = typeof(TObject); GenerateData = new ParametrizedAction( this, $"{GetType().FullName}.{nameof(GenerateData)}", DevExpress.Persistent.Base.PredefinedCategory.Edit, typeof(int) ) { Caption = "Generate", Value = 300 }; GenerateData.Execute += GenerateData_Execute; }
/// <summary> /// После организации фрейма обработка контроллера FilterController /// </summary> protected override void OnFrameAssigned() { base.OnFrameAssigned(); standardFilterController = Frame.GetController <FilterController>(); if (standardFilterController != null) { standardFullTextFilterAction = standardFilterController.FullTextFilterAction; standardSetFilterAction = standardFilterController.SetFilterAction; standardFilterController.FullTextSearchTargetPropertiesMode = FullTextSearchTargetPropertiesMode.AllSearchableMembers; standardFilterController.CustomBuildCriteria += new EventHandler <CustomBuildCriteriaEventArgs>(standardFilterController_CustomBuildCriteria); standardFilterController.CustomGetFullTextSearchProperties += new EventHandler <CustomGetFullTextSearchPropertiesEventArgs>(standardFilterController_CustomGetFullTextSearchProperties); } }
public FullTextContains() { var singleChoiceAction = new SingleChoiceAction(this, GetType().Name, PredefinedCategory.ObjectsCreation) { ItemType = SingleChoiceActionItemType.ItemIsOperation, }; TargetObjectType = typeof(FullTextContainsObject); singleChoiceAction.Items.Add(new ChoiceActionItem(XpandGridListEditor, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(AdvBandedListEditor, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(CollectionSourceCriteria, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(CriteriaPropertyEditorEx, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(ColumnFilterChanged, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(XpandObjectSpaceProvider, null)); singleChoiceAction.Items.Add(new ChoiceActionItem(PopupCriteriaPropertyEditorEx, null)); singleChoiceAction.Execute += SingleChoiceActionOnExecute; _parametrizedAction = new ParametrizedAction(this, "FullTextContainsParam", PredefinedCategory.View, typeof(string)); _parametrizedAction.Execute += ParametrizedActionOnExecute; }
public CustomizeParametrizedActionController() : base() { TargetObjectType = typeof(CustomizeActionControlObject); ItemClickSimpleAction = new SimpleAction(this, "ItemClick", PredefinedCategory.RecordEdit); CustomStringParametrizedAction = new ParametrizedAction(this, "StringEditMask", PredefinedCategory.RecordEdit, typeof(string)); CustomStringParametrizedAction.ToolTip = "String Edit Mask Customize"; CustomizeWidthSingleChoiceAction = new SingleChoiceAction(this, "CustomWidth", PredefinedCategory.View); CustomizeWidthSingleChoiceAction.Items.Add(new ChoiceActionItem("First", null)); CustomizeWidthSingleChoiceAction.Items.Add(new ChoiceActionItem("Second", null)); CustomizeWidthSingleChoiceAction.Items.Add(new ChoiceActionItem("Third", null)); CustomDateParametrizedAction = new ParametrizedAction(this, "DateTimeEditMask", PredefinedCategory.View, typeof(DateTime)); CustomDateParametrizedAction.ToolTip = "DateTime Edit Mask Customize"; CustomizeWidthSingleChoiceAction.CustomizeControl += CustomizeWidthSingleChoiceAction_CustomizeControl; ItemClickSimpleAction.CustomizeControl += ItemClickSimpleAction_CustomizeControl; CustomStringParametrizedAction.CustomizeControl += CustomStringParametrizedAction_CustomizeControl; CustomDateParametrizedAction.CustomizeControl += CustomDateParametrizedAction_CustomizeControl; }
private Action GetStartGoingSoloParameterizedAction() { ParametrizedAction startGoingSoloParameterized = new ParametrizedAction("start-going-solo"); Parameter agentParameter = GetAgentParameter(); startGoingSoloParameterized.AddParameter(agentParameter); ParametrizedPredicate inJoinedStage = GetParameterizedInJoinedStagePredicate(); ParametrizedPredicate goingSolo = GetParameterizedGoingSoloPredicate(); Predicate notInJoinedStage = inJoinedStage.Negate(); PredicateFormula preconditions = new PredicateFormula(inJoinedStage); CompoundFormula effects = new CompoundFormula("and"); effects.AddOperand(goingSolo); effects.AddOperand(notInJoinedStage); startGoingSoloParameterized.Preconditions = preconditions; startGoingSoloParameterized.SetEffects(effects); return(startGoingSoloParameterized); }
public DetailViewActionsObjectViewCotroller() { TargetViewType = ViewType.DetailView; TargetObjectType = typeof(DetailViewActionsObject); SimpleAction simpleAction = new SimpleAction(this, "SimpleAction", "DetailViewActions"); simpleAction.ImageName = ActionsDemoStrings.SimpleActionImageName; simpleAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; simpleAction.Execute += new SimpleActionExecuteEventHandler(simpleAction_Execute); SingleChoiceAction singleChoiceAction = new SingleChoiceAction(this, "SingleChoiceAction", "DetailViewActions"); singleChoiceAction.ImageName = ActionsDemoStrings.SingleChoiceActionImageName; singleChoiceAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; singleChoiceAction.Execute += new SingleChoiceActionExecuteEventHandler(singleChoiceAction_Execute); singleChoiceAction.ItemType = SingleChoiceActionItemType.ItemIsOperation; ChoiceActionItem item1 = new ChoiceActionItem("Item1", null); ChoiceActionItem item2 = new ChoiceActionItem("Item2", null); ChoiceActionItem item21 = new ChoiceActionItem("Item2.1", null); item2.Items.Add(item21); singleChoiceAction.Items.Add(item1); singleChoiceAction.Items.Add(item2); ParametrizedAction parametrizedAction = new ParametrizedAction(this, "ParametrizedAction", "DetailViewActions", typeof(int)); parametrizedAction.ShortCaption = "GO"; parametrizedAction.ImageName = ActionsDemoStrings.ParametrizedActionImageName; parametrizedAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(parametrizedAction_Execute); PopupWindowShowAction popupWindowShowAction = new PopupWindowShowAction(this, "PopupWindowShowAction", "DetailViewActions"); popupWindowShowAction.ImageName = ActionsDemoStrings.PopupWindowShowActionImageName; popupWindowShowAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; popupWindowShowAction.CustomizePopupWindowParams += new CustomizePopupWindowParamsEventHandler(popupWindowShowAction_CustomizePopupWindowParams); popupWindowShowAction.Execute += new PopupWindowShowActionExecuteEventHandler(popupWindowShowAction_Execute); }
private static void ReadParameters(CompoundExpression exp, ParametrizedAction pa) { // unfortunately, expressions have a weird non standard structure with no type -(? i - pos ? j - pos ) // so we must have a special case List <string> lTokens = exp.ToTokenList(); List <string> lNames = new List <string>(); string sType = ""; int iCurrent = 0; while (iCurrent < lTokens.Count) { if (lTokens[iCurrent] == "-") { sType = lTokens[iCurrent + 1]; foreach (string sName in lNames) { pa.AddParameter(new Parameter(sType, sName)); } lNames = new List <string>(); sType = ""; iCurrent += 2; } else { lNames.Add(lTokens[iCurrent]); iCurrent++; } } if (lNames.Count != 0) //allowing no types specified { foreach (string sName in lNames) { pa.AddParameter(new Parameter("OBJ", sName)); } } }
public ParametrizedActionSelectionDependencyController() { TargetObjectType = typeof(DemoItem); targetProperty = "SelectionDependency"; ParametrizedAction parametrizedAction = new ParametrizedAction(this, "ParametrizedActionIndependent", PredefinedCategory.Edit, typeof(string)); parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(ParametrizedActionRootObject.parametrizedAction_Execute); parametrizedAction.SelectionDependencyType = SelectionDependencyType.Independent; parametrizedAction.Caption = parametrizedAction.SelectionDependencyType.ToString(); parametrizedAction.ToolTip = ActionsDemoStrings.SelectionDependencyIndependentTooltip; parametrizedAction = new ParametrizedAction(this, "ParametrizedActionRequireMultipleObjects", PredefinedCategory.Edit, typeof(string)); parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(ParametrizedActionRootObject.parametrizedAction_Execute); parametrizedAction.SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects; parametrizedAction.Caption = parametrizedAction.SelectionDependencyType.ToString(); parametrizedAction.ToolTip = ActionsDemoStrings.SelectionDependencyRequireMultipleObjectsTooltip; parametrizedAction = new ParametrizedAction(this, "ParametrizedActionRequireSingleObject", PredefinedCategory.Edit, typeof(string)); parametrizedAction.Execute += new ParametrizedActionExecuteEventHandler(ParametrizedActionRootObject.parametrizedAction_Execute); parametrizedAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; parametrizedAction.Caption = parametrizedAction.SelectionDependencyType.ToString(); parametrizedAction.ToolTip = ActionsDemoStrings.SelectionDependencyRequireSingleObjectTooltip; }
protected virtual MenuActionItemBase CreateParametrizedactionObject(ParametrizedAction parametrizedAction) { ParametrizedActionMenuActionItem actionObject = new ParametrizedActionMenuActionItem(parametrizedAction); return(actionObject); }
protected virtual MenuActionItemBase CreateParametrizedactionObject(ParametrizedAction parametrizedAction) { ParametrizedActionMenuActionItem actionObject = new ParametrizedActionMenuActionItem(parametrizedAction); return actionObject; }
public ViewController1() { ParametrizedAction filterAction = new ParametrizedAction(this, "FilterRange", "Edit", typeof(DateTime)); filterAction.Execute += new ParametrizedActionExecuteEventHandler(filterAction_Execute); }
public static IObservable <T> WhenExecute <T>(this ParametrizedAction action, Func <ParametrizedActionExecuteEventArgs, IObservable <T> > retriedExecution) => action.WhenExecute().SelectMany(retriedExecution).Retry(() => action.Application);
public static IObservable <ParametrizedActionExecuteEventArgs> WhenExecute(this ParametrizedAction action) => Observable.FromEventPattern <ParametrizedActionExecuteEventHandler, ParametrizedActionExecuteEventArgs>( h => action.Execute += h, h => action.Execute -= h, ImmediateScheduler.Instance) .Select(pattern => pattern.EventArgs);