Exemplo n.º 1
0
        public ObservableList <StandAloneAction> GetStandAloneActions()
        {
            ObservableList <StandAloneAction> list = new ObservableList <StandAloneAction>();

            foreach (PluginService pluginService in GetPluginServices())
            {
                foreach (MethodInfo MI in pluginService.mStandAloneMethods)
                {
                    GingerActionAttribute token = (GingerActionAttribute)Attribute.GetCustomAttribute(MI, typeof(GingerActionAttribute), false);
                    StandAloneAction      DA    = new StandAloneAction();
                    DA.ID = token.Id;
                    // AssemblyName AN = MI.DeclaringType.Assembly.GetName();
                    DA.PluginID    = PluginID; //AN.Name;
                    DA.ServiceID   = pluginService.ServiceId;
                    DA.Description = token.Description;
                    foreach (ParameterInfo PI in MI.GetParameters())
                    {
                        if (PI.ParameterType.Name != nameof(GingerAction))
                        {
                            DA.InputValues.Add(new ActionInputValueInfo()
                            {
                                Param = PI.Name, ParamType = PI.ParameterType
                            });
                        }
                    }
                    list.Add(DA);
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        public void GingerOfficePluginTestActionx3()
        {
            //Arrange
            ObservableList <PluginPackage> Plugins = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <PluginPackage>();
            PluginPackage p = (from x in Plugins where x.PluginID == "GingerOfficePlugin" select x).SingleOrDefault();
            ObservableList <StandAloneAction> list = p.GetStandAloneActions();
            StandAloneAction standAloneAction      = list[0];
            GingerAction     GA = new GingerAction(standAloneAction.ID);

            GA.InputParams["PluginID"].Value       = p.PluginID;
            GA.InputParams["PluginActionID"].Value = standAloneAction.ID;
            GA.InputParams["A"].Value = "hi";
            GA.InputParams["B"].Value = "yo";


            // Act
            for (int i = 0; i < 3; i++)
            {
                WorkSpace.Instance.PlugInsManager.Execute(GA);
            }


            //Assert
            Assert.AreEqual(1, WorkSpace.Instance.LocalGingerGrid.NodeList.Count, "GingerGrid nodes 1 - only one service is up - reuse");
        }
Exemplo n.º 3
0
        public List <ActionInputValueInfo> GetActionEditInfo(string pluginId, string serviceId, string actionId)
        {
            PluginPackage    pluginPackage    = (from x in mPluginPackages where x.PluginID == pluginId select x).SingleOrDefault();
            StandAloneAction standAloneAction = (from x in pluginPackage.LoadServicesInfoFromFile() where x.ServiceID == serviceId && x.ID == actionId select x).SingleOrDefault();

            return(standAloneAction.InputValues);
        }
Exemplo n.º 4
0
        public void GingerOfficePluginTestAction()
        {
            //Arrange
            ObservableList <PluginPackage> Plugins = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <PluginPackage>();
            PluginPackage p = (from x in Plugins where x.PluginID == "GingerOfficePlugin" select x).SingleOrDefault();
            ObservableList <StandAloneAction> list = p.GetStandAloneActions();
            StandAloneAction standAloneAction      = list[0];
            GingerAction     GA = new GingerAction(standAloneAction.ID);

            GA.InputParams["PluginID"].Value       = p.PluginID;
            GA.InputParams["PluginActionID"].Value = standAloneAction.ID;
            GA.InputParams["A"].Value = "hi";
            GA.InputParams["B"].Value = "yo";

            // Act
            WorkSpace.Instance.PlugInsManager.Execute(GA);

            //Assert
            Assert.AreEqual("ab", GA.Output.Values[0].Param, "Test action output");
        }