示例#1
0
        private void SetActionInputsControls()
        {
            List <ActionInputValueInfo> actionInputsDetails = WorkSpace.Instance.PlugInsManager.GetActionEditInfo(mAct.PluginId, mAct.ServiceId, mAct.ActionId);

            foreach (ActionInputValueInfo actionInputValueInfo in actionInputsDetails)
            {
                ActInputValue actInputValue = (from x in mAct.InputValues where x.Param == actionInputValueInfo.Param select x).SingleOrDefault();

                if (actInputValue == null)
                {
                    actInputValue           = new ActInputValue();
                    actInputValue.Param     = actionInputValueInfo.Param;
                    actInputValue.ParamType = actionInputValueInfo.ParamType;
                    mAct.InputValues.Add(actInputValue);
                }
                else
                {
                    actInputValue.ParamType = actionInputValueInfo.ParamType;
                }

                // Add ActionInputValueUserControl for the param value to edit
                ActionInputValueUserControl actionInputValueUserControl = new ActionInputValueUserControl(Context.GetAsContext(mAct.Context), actInputValue);
                DockPanel.SetDock(actionInputValueUserControl, Dock.Top);
                actionInputValueUserControl.Margin = new Thickness(0, 10, 0, 0);
                xActionInputControlsPnl.Children.Add(actionInputValueUserControl);
            }
        }
示例#2
0
        private void SetActionInputsControls()
        {
            List <ActionInputValueInfo> actionInputsDetails = WorkSpace.Instance.PlugInsManager.GetActionEditInfo(mAct.PluginId, mAct.ServiceId, mAct.ActionId);

            foreach (ActInputValue param in mAct.InputValues)
            {
                // update the type based on the info json of the plugin
                param.ParamType = (from x in actionInputsDetails where x.Param == param.Param select x.ParamType).SingleOrDefault();

                // Add ActionInputValueUserControl for the param value to edit
                ActionInputValueUserControl actionInputValueUserControl = new ActionInputValueUserControl(param);
                DockPanel.SetDock(actionInputValueUserControl, Dock.Top);
                actionInputValueUserControl.Margin = new Thickness(0, 10, 0, 0);
                xActionInputControlsPnl.Children.Add(actionInputValueUserControl);
            }
        }
示例#3
0
        private void AutoCreateEditPage()
        {
            int rows = mAct.InputValues.Count;

            for (int i = 0; i < rows; i++)
            {
                ActionConfigGrid.RowDefinitions.Add(new RowDefinition()
                {
                    Height = new GridLength(35)
                });
            }

            ActionConfigGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(30, GridUnitType.Star)
            });
            ActionConfigGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(70, GridUnitType.Star)
            });

            int rnum = 0;

            foreach (ActInputValue param in mAct.InputValues)
            {
                Label l = new Label()
                {
                    Content = param.Param
                };
                ActionConfigGrid.Children.Add(l);
                l.Style = App.GetStyle("@InputFieldLabelStyle");
                Grid.SetRow(l, rnum);


                //TODO: based on the param type create textbox, check box, combo, etc...

                ActionInputValueUserControl actionInputValueUserControl = new ActionInputValueUserControl();
                actionInputValueUserControl.BindControl(param);
                actionInputValueUserControl.Margin = new Thickness(5);
                ActionConfigGrid.Children.Add(actionInputValueUserControl);
                Grid.SetRow(actionInputValueUserControl, rnum);
                Grid.SetColumn(actionInputValueUserControl, 1);
                rnum++;
            }
        }
示例#4
0
        private void AutoCreateEditPage()
        {
            string pluginId  = mAct.GetInputParamValue("PluginId");       //TODO: use const
            string serviceId = mAct.GetInputParamValue("ServiceId");      //TODO: use const
            string actionId  = mAct.GetInputParamValue("GingerActionId"); //TODO: use const

            PluginIdLabel.Content  = pluginId;
            ServiceIdLabel.Content = serviceId;
            ActionIdLabel.Content  = actionId;

            int rows = mAct.InputValues.Count;

            for (int i = 0; i < rows; i++)
            {
                ActionConfigGrid.RowDefinitions.Add(new RowDefinition()
                {
                    Height = new GridLength(35)
                });
            }

            ActionConfigGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(30, GridUnitType.Star)
            });
            ActionConfigGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(70, GridUnitType.Star)
            });

            int rnum = 0;

            List <ActionInputValueInfo> list = WorkSpace.Instance.PlugInsManager.GetActionEditInfo(pluginId, serviceId, actionId);


            foreach (ActInputValue param in mAct.InputValues)
            {
                if (param.Param == "PluginId" || param.Param == "ServiceId" || param.Param == "GingerActionId" || param.Param == "GA")   // TODO: use const
                {
                    continue;
                }

                // update the type based on the info json of the plugin
                param.ParamType = (from x in list where x.Param == param.Param select x.ParamType).SingleOrDefault();

                Label l = new Label()
                {
                    Content = param.Param
                };
                ActionConfigGrid.Children.Add(l);
                l.Style = App.GetStyle("@InputFieldLabelStyle");
                Grid.SetRow(l, rnum);



                //TODO: based on the param type create textbox, check box, combo, etc...

                ActionInputValueUserControl actionInputValueUserControl = new ActionInputValueUserControl();
                actionInputValueUserControl.BindControl(param);
                actionInputValueUserControl.Margin = new Thickness(5);
                ActionConfigGrid.Children.Add(actionInputValueUserControl);
                Grid.SetRow(actionInputValueUserControl, rnum);
                Grid.SetColumn(actionInputValueUserControl, 1);
                rnum++;
            }
        }