Пример #1
0
 internal ReflectionContext(WorkflowAssembly workflowAssembly, Dictionary <Type, Dictionary <string, int> > imageIndexMapping, TreeNode currentNode, Dictionary <Type, List <Type> > componentMapping, TreeView treeView)
 {
     this.workflowAssembly  = workflowAssembly;
     this.imageIndexMapping = imageIndexMapping;
     this.currentNode       = currentNode;
     this.componentMapping  = componentMapping;
     this.treeView          = treeView;
 }
Пример #2
0
        private void LoadAssembly(string fullName)
        {
            WorkflowAssembly workflowAssembly = null;

            try
            {
                workflowAssembly = WorkflowAssembly.LoadFrom(fullName);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Could not load the requested assembly: " + exception.ToString());
                return;
            }

            assemblyResolverDialog.DialogEnabled = false;
            Assembly assembly = null;

            // Check that the Assembly, or an Assembly with
            // the same name, has not already been loaded by
            // the program.  If either of the above is true then
            // the newly loaded assembly would just be ignored.
            // Instead of showing duplicate assembly nodes, we
            // will just display an error and then make this a
            // no-op.
            try
            {
                assembly = Assembly.Load(workflowAssembly.Assembly.FullName);
            }
            catch (Exception)
            {
            }

            if (assembly != null)
            {
                MessageBox.Show("Either the assembly is already loaded or an assembly with the same Assembly Qualified Name is already loaded.  Please choose a different assembly.");
                return;
            }

            assemblyResolverDialog.DialogEnabled = true;
            assemblyResolverDialog.ToResolve.Add(workflowAssembly.Assembly);

            ReflectionContext context = new ReflectionContext(workflowAssembly, imageIndexMapping, null, componentMapping, treeView1);

            // Start the reflection chain.
            RootComponent component = new RootComponent();

            component.PerformReflection(context);
        }