Пример #1
0
        public static RhspManager CreateManager(RhspServiceContext context, Type managerType)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context", "Context has not yet been set.");
            }

            if (!typeof(RhspManager).IsAssignableFrom(managerType))
            {
                throw new RhspException(
                          "The requested type '" + managerType + "' is not compatable " +
                          "with manager type '" + typeof(RhspManager).Name + "'");
            }

            RhspManager manager = (RhspManager)Activator.CreateInstance(managerType);

            manager.context = context;
            manager.OnLoad(EventArgs.Empty);
            return(manager);
        }
 public RhspManagerInvoker(RhspManager manager, MethodInfo method, object[] parameters)
 {
     this.manager    = manager;
     this.method     = method;
     this.parameters = parameters;
 }