Ejemplo n.º 1
0
        private void activitiesBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            membersBox.Items.Clear();

            if (activitiesBox.SelectedItem != null)
            {
                membersBox.Items.AddRange(RuleSetToolkitEditor.GetMembers(activitiesBox.SelectedItem as Type).ToArray());
            }
        }
Ejemplo n.º 2
0
 Assembly activitySelector_AssemblyResolve(object sender, ResolveEventArgs args)
 {
     if (!String.IsNullOrEmpty(assemblyBox.Text))
     {
         return(RuleSetToolkitEditor.ResolveAssembly(assemblyBox.Text, args.Name));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
        private void PopulateActivities()
        {
            activitiesBox.Items.Clear();

            Assembly assembly = RuleSetToolkitEditor.LoadAssembly(assemblyBox.Text);

            if (assembly != null)
            {
                try
                {
                    Type[] types = assembly.GetTypes();
                    foreach (Type type in types)
                    {
                        // add a check here if you want to constrain the kinds of Types (e.g. Activity) that rulesets can be authored against

                        //if (type.IsSubclassOf(typeof(Activity)))
                        //{
                        activitiesBox.Items.Add(type);
                        //}
                    }
                }
                catch (ReflectionTypeLoadException ex)
                {
                    MessageBox.Show(string.Format(CultureInfo.InvariantCulture, "Error loading types from assembly '{0}': \r\n\n{1}", assembly.FullName, ex.LoaderExceptions[0].Message), "Type Load Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            if (activity != null && activitiesBox.Items.Contains(activity))
            {
                activitiesBox.SelectedItem = activity;
            }

            else if (activitiesBox.Items.Count > 0)
            {
                activitiesBox.SetSelected(0, true);
            }
        }