Exemplo n.º 1
0
 public TaskData(DateTime nextRun, int intervall, ParameterSet ps,String classname, String assembly,bool startup)
 {
     NextRun = nextRun;
     Intervall = intervall;
     Params = ps;
     Classname = classname;
     Assembly = assembly;
     ExtraRun = false;
     Startup = startup;
 }
Exemplo n.º 2
0
 /// <summary>
 /// creates a new instance from a parameterset
 /// </summary>
 /// <returns>
 /// The instance.
 /// </returns>
 /// <param name='param'>
 /// Parameter.
 /// </param>
 public static object createInstance(ParameterSet param)
 {
     ConstructorInfo ci = param.BaseType.GetConstructor(param.Types);
     object o = ci.Invoke(param.Data);
     return o;  //TODO logging ... try catch ??
 }
Exemplo n.º 3
0
        public static ParameterSet CreateInstance(XmlNode parent)
        {
            String classname = XmlHelper.getAttributeValue(parent,"class");
            String assembly = XmlHelper.getAttributeValue(parent,"assembly");

            ParameterSet ps = new ParameterSet(classname,assembly);

            XmlNodeList lst = parent.SelectNodes(".//param");
            foreach (XmlNode n in lst)
            {
                String paramname = XmlHelper.getAttributeValue(n,"name");
                String paramtype = XmlHelper.getAttributeValue(n,"type");
                String paramvalue = n.InnerXml;

                ps.addParameter(new Parameter(paramname,paramtype,paramvalue));
            }
            return ps;
        }
Exemplo n.º 4
0
        public static ParameterSet CreateInstance(String classname, String assembly, object parameters)
        {
            ParameterSet ps = new ParameterSet(classname, assembly);

            //			XmlNodeList lst = parent.SelectNodes(".//param");
            //			foreach (XmlNode n in lst)
            //			{
            //				String paramname = XmlHelper.getAttributeValue(n,"name");
            //				String paramtype = XmlHelper.getAttributeValue(n,"type");
            //				String paramvalue = n.InnerText;
            //
            //				ps.addParameter(new Parameter(paramname,paramtype,paramvalue));
            //			}

            //			foreach (String s in parameters)
            //			{
            //				ps.addParameter(typeof(String),s);
            //			}
            ps.addParameter(parameters.GetType(),parameters);

            return ps;
        }
Exemplo n.º 5
0
 public static DockableWidget createWindow(ParameterSet param, DelegateSet delegates)
 {
     ConstructorInfo ci = param.BaseType.GetConstructor(param.Types);
     object o = ci.Invoke(param.Data);
     if (o != null)
     {
         DockableWidget wnd = (DockableWidget)o;
         wnd.Params = param;
         wnd.Delegates = delegates;
         wnd.hookDelegates();
         wnd.afterInit();
         return wnd;
     }
     return null;
 }