コード例 #1
0
        public void RegisterAssemblies(string path)
        {
            isLoaded = true;

            string[] assemblies = Directory.GetFiles(path, "*.dll");

            foreach (string assemblyName in assemblies)
            {
                Assembly assembly = Assembly.LoadFile(assemblyName);

                Type[] types = assembly.GetExportedTypes();

                foreach (Type type in types)
                {
                    if (type.IsSubclassOf(typeof(UserControl)))
                    {
                        UserControl userControl = Activator.CreateInstance(type) as UserControl;

                        ITemplateUI templateUI = userControl as ITemplateUI;

                        if (templateUI != null)
                        {
                            esTemplateInfo templateInfo = templateUI.Init();

                            if (templateInfo != null)
                            {
                                templateUserInterfaces.Add(templateInfo);
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        public bool GatherUserInput()
        {
            try
            {
                foreach (UserControl userControl in this.CurrentUIControls.Values)
                {
                    ITemplateUI templateUI = userControl as ITemplateUI;

                    if (!templateUI.OnExecute())
                    {
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                MainWindow.ShowError(ex);
            }

            return(true);
        }