private void AddAction(object sender, RoutedEventArgs e) { ObservableList <IAct> ActionsList = new ObservableList <IAct>(); // We create one dummy activity in case we convert code without function mBusinessFlow.Activities = new ObservableList <Activity>(); Activity at = new Activity(); at.ActivityName = "Activity1"; mBusinessFlow.Activities.Add(at); mBusinessFlow.CurrentActivity = at; mBusinessFlow.CurrentActivity.TargetApplication = WorkSpace.Instance.Solution.MainApplication.ToString(); //"Google"; //TargetApplication.SelectedItem.ToString(); //App.BusinessFlow = mBusinessFlow; //AddActionPage addAction = new AddActionPage(); //addAction.ShowAsWindow(ActionsList); // We will get only one action currently Act a = (Act)ActionsList[0]; CommonFunctionMapping CFM = new CommonFunctionMapping(); CFM.TargetAction = a; mCommonFunctionConvertor.CommonFunctionMappingList.Add(CFM); }
public void LoadCommonFunctionMapping(object sender, RoutedEventArgs e) { //TODO: remove when save/load is working temp for testing only CommonFunctionMapping CFM1 = new CommonFunctionMapping(); ActGenElement a = new ActGenElement() { Description = "Click Web Element - {Param0}" }; CFM1.Function_Name = "ClickWebElement"; CFM1.TargetAction = a; mCommonFunctionConvertor.CommonFunctionMappingList.Add(CFM1); CommonFunctionMapping CFM2 = new CommonFunctionMapping(); ActGotoURL a2 = new ActGotoURL() { Description = "Goto URL - {Param1}" }; CFM2.Function_Name = "GotoURL"; CFM2.TargetAction = a2; mCommonFunctionConvertor.CommonFunctionMappingList.Add(CFM2); CommonFunctionMapping CFM3 = new CommonFunctionMapping(); ActGenElement a3 = new ActGenElement(); a3.Description = "General Web Element - WebEditTxt"; a3.LocateBy = eLocateBy.ByName; a3.LocateValue = "{OR ObjName={Param1} PropName=_path}"; CFM3.Function_Name = "WebEditTxtChange"; CFM3.TargetAction = a3; mCommonFunctionConvertor.CommonFunctionMappingList.Add(CFM3); CommonFunctionMapping CFM4 = new CommonFunctionMapping(); ActGenElement a4 = new ActGenElement(); a4.Description = "General Web Element - WebButtonClick"; a4.LocateBy = eLocateBy.ByName; a4.LocateValue = "{OR ObjName={Param1} PropName=name}"; CFM4.Function_Name = "WebButtonClick"; CFM4.TargetAction = a4; mCommonFunctionConvertor.CommonFunctionMappingList.Add(CFM4); //temp TODO: fix me to select file // Use load after repo is fixed CommonFunctionMappingUCGrid.DataSourceList = mCommonFunctionConvertor.CommonFunctionMappingList; }