Exemplo n.º 1
0
        private bool PromptForThisType(string startingDirectory)
        {
            bool successfulLoad = false;

            if (selectedRuleSetData != null)
            {
                ActivitySelector activitySelector = new ActivitySelector();
                activitySelector.RuleSet = selectedRuleSetData.RuleSet;
                if (!String.IsNullOrEmpty(startingDirectory))
                    activitySelector.InitialDirectory = startingDirectory;

                activitySelector.ShowDialog();
                if (!string.IsNullOrEmpty(activitySelector.AssemblyPath))
                    selectedRuleSetData.AssemblyPath = activitySelector.AssemblyPath;
                if (activitySelector.Activity != null)
                {
                    selectedRuleSetData.Activity = activitySelector.Activity;
                    successfulLoad = true;
                }
            }

            return successfulLoad;
        }
Exemplo n.º 2
0
        private void getActivityButton_Click(object sender, EventArgs e)
        {
            ActivitySelector activitySelector = new ActivitySelector();

            if (selectedRuleSetData != null)
            {
                activitySelector.AssemblyPath = selectedRuleSetData.AssemblyPath;
                activitySelector.Activity = selectedRuleSetData.Activity;
                activitySelector.RuleSet = selectedRuleSetData.RuleSet;
            }

            activitySelector.ShowDialog();

            if (selectedRuleSetData != null && !String.IsNullOrEmpty(activitySelector.AssemblyPath) && activitySelector.Activity != null)
            {
                if (string.CompareOrdinal(selectedRuleSetData.AssemblyPath, activitySelector.AssemblyPath) != 0 || selectedRuleSetData.Activity != activitySelector.Activity)
                {
                    selectedRuleSetData.AssemblyPath = activitySelector.AssemblyPath;
                    selectedRuleSetData.Activity = activitySelector.Activity;
                    activityBox.Text = activitySelector.Activity.ToString();
                    this.PopulateMembers();
                    this.MarkDirty(selectedRuleSetData);
                }
            }
        }