示例#1
0
        private ActivityBuilder ReadXamlDefinition()
        {
            var xamlStr = RootActivity.ToString();

            try
            {
                if (xamlStr.Length != 0)
                {
                    using (var sw = new StringReader(xamlStr))
                    {
                        var xamlXmlWriterSettings = new XamlXmlReaderSettings
                        {
                            LocalAssembly = System.Reflection.Assembly.GetAssembly(typeof(VirtualizedContainerService))
                        };
                        var xw   = ActivityXamlServices.CreateBuilderReader(new XamlXmlReader(sw, new XamlSchemaContext(), xamlXmlWriterSettings));
                        var load = XamlServices.Load(xw);
                        return(load as ActivityBuilder);
                    }
                }
            }
            catch (Exception e)
            {
                Dev2Logger.Error("Error loading XAML: ", e, GlobalConstants.WarewolfError);
            }
            return(null);
        }
示例#2
0
        /// <summary>
        /// Prints the activity tree, starting from the root or optionally from a given origin.
        ///
        /// Call this method from any place that's called during a tick, such as the Tick() method itself or
        /// the Before(First|Last)Run() methods. The origin activity will be marked in the output.
        /// </summary>
        /// <param name="origin">Activity from which to start traversing, and which to mark. If null, mark the calling activity, and start traversal from the root.</param>
        /// <param name="level">Initial level of indentation.</param>
        protected void PrintActivityTree(Activity origin = null, int level = 0)
        {
            if (origin == null)
            {
                RootActivity.PrintActivityTree(this);
            }
            else
            {
                Console.Write(new string(' ', level * 2));
                if (origin == this)
                {
                    Console.Write("*");
                }

                Console.WriteLine(this.GetType().ToString().Split('.').Last());

                if (ChildActivity != null)
                {
                    ChildActivity.PrintActivityTree(origin, level + 1);
                }

                if (NextInQueue != null)
                {
                    NextInQueue.PrintActivityTree(origin, level);
                }
            }
        }
        private void ImportHierarchy(RootActivity root)
        {
            chkCreateParts.Checked         = root.CreateParticipants;
            chkCreateUserAuth.Checked      = root.CreateUserAuthorization;
            chkExtractProviderPack.Checked = root.ExtractProviderPackage;
            txtUsername.Text = root.TemplateUsername;

            FillHierarchy(root.RootActivities);
        }
示例#4
0
 protected void PrintActivityTree(Activity origin = null, int level = 0)
 {
     if (origin == null)
     {
         RootActivity.PrintActivityTree(this);
     }
     else
     {
     }
 }
        private RootActivity GetHierarchy()
        {
            var root = new RootActivity
            {
                CreateParticipants      = chkCreateParts.Checked,
                CreateUserAuthorization = chkCreateUserAuth.Checked,
                ExtractProviderPackage  = chkExtractProviderPack.Checked,
                TemplateUsername        = txtUsername.Text,
                RootActivities          = tvHierarchy.Nodes[0].Nodes.OfType <TreeNode>()
                                          .Select(CreateLearningActivityFromTreeNode)
                                          .Where(la => la != null)
                                          .ToList()
            };


            return(root);
        }