コード例 #1
0
        public FormsFlow(IAssemblyBrowser browser)
        {
            InitializeComponent();
            nodeControl      = new NodeControl.NodeDiagram();
            nodeControl.Dock = DockStyle.Fill;
            nodeControl.Factories.Clear();

            this.Controls.Add(nodeControl);

            pnlLoading.BringToFront();
        }
コード例 #2
0
        private void DoAnalysis(NodeControl.NodeDiagram nodeControl)
        {
            var formsCache = AnalysisManager.Instance.GetTypeCache(typeof(System.Windows.Forms.Form));

            var allExistingFormTypes = formsCache.DerivedBy.ToArray();

            Dictionary <Type, NodeControl.Nodes.ConditionNode> nodePerType = new Dictionary <Type, NodeControl.Nodes.ConditionNode>();

            int count = 0;

            foreach (var formType in allExistingFormTypes)
            {
                NodeControl.Nodes.ConditionNode cn = new NodeControl.Nodes.ConditionNode(nodeControl);
                cn.Direction = NodeControl.Nodes.Node.DirectionEnum.Vertical;
                cn.Text      = formType.Name;

                nodePerType[formType] = cn;
                nodes.Add(cn);
                SetStatus("Adding form " + formType.FullName);
                SetProgress((float)count++ / allExistingFormTypes.Length);
            }

            HashSet <MemberInfo> memberTracker = new HashSet <MemberInfo>();

            count = 0;
            foreach (var formType in allExistingFormTypes)
            {
                SetStatus("Scanning links for " + formType.FullName);

                foreach (var ctor in formType.GetConstructors())
                {
                    var memberCache = (MethodBaseCache)AnalysisManager.Instance.GetMemberCache(ctor);


                    foreach (var frmUsedBy in memberCache.UsedBy)
                    {
                        var member = frmUsedBy.Member;

                        Stack <string> path = new Stack <string>();
                        CheckMember(nodePerType, formType, member, memberTracker, path);
                    }
                }


                SetProgress((float)count++ / allExistingFormTypes.Length);
            }
        }