コード例 #1
0
        private void FillBaseControls()
        {
            this.tboxProjectName.Text = nDependProject.Properties.Name;
            List <NDependMetricDefinition> assemblyMetricsDefinionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions("AssemblyMetrics.xml");
            IEnumerable <IAssembly>        lastAnalysisAssembliesList   = codeElementsManager.GetNonThirdPartyAssembliesInApplication();
            DataTable assemblyMetricsDataTable = CreateCodeElemetMetricsDataTable <IAssembly>(lastAnalysisAssembliesList, assemblyMetricsDefinionsList);

            FillCodeElementsDataGridView(this.dgvAssemblies, assemblyMetricsDataTable);
        }
コード例 #2
0
        private void dgvMethods_SelectionChanged(object sender, EventArgs e)
        {
            DataGridView thisDataGridView = (DataGridView)sender;

            if (thisDataGridView.SelectedRows.Count > 0)
            {
                string selectedType = thisDataGridView.SelectedRows[0].Cells[0].Value.ToString();
                IType  nType        = codeElementsManager.GetTypeByName(selectedType);

                List <NDependMetricDefinition> typesMetricsDefinionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions("MethodMetrics.xml");
                FillMetricsListView(thisDataGridView.SelectedRows[0], typesMetricsDefinionsList);

                this.lblCodeElementType.Text = "Type";
                this.lblCodeElementName.Text = selectedType;
            }
        }
コード例 #3
0
        private void dgvNamespaces_SelectionChanged(object sender, EventArgs e)
        {
            DataGridView thisDataGridView = (DataGridView)sender;

            if (thisDataGridView.SelectedRows.Count > 0)
            {
                string     selectedNamespaceName = thisDataGridView.SelectedRows[0].Cells[0].Value.ToString();
                INamespace nNamespace            = codeElementsManager.GetNamespaceByName(selectedNamespaceName);

                List <NDependMetricDefinition> namespaceMetricsDefinionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions("NamespaceMetrics.xml");
                FillMetricsListView(thisDataGridView.SelectedRows[0], namespaceMetricsDefinionsList);

                this.lblCodeElementType.Text = "Namespace";
                this.lblCodeElementName.Text = selectedNamespaceName;

                List <NDependMetricDefinition> typeMetricsDefinionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions("TypeMetrics.xml");
                DataTable typeMetricsDataTable = CreateCodeElemetMetricsDataTable <IType>(nNamespace.ChildTypes, typeMetricsDefinionsList);
                FillCodeElementsDataGridView(this.dgvTypes, typeMetricsDataTable);
            }
        }
コード例 #4
0
        private void dgvAssemblies_SelectionChanged(object sender, EventArgs e)
        {
            DataGridView thisDataGridView = (DataGridView)sender;

            if (thisDataGridView.SelectedRows.Count > 0)
            {
                string    selectedAssemblyName = thisDataGridView.SelectedRows[0].Cells[0].Value.ToString();
                IAssembly assembly             = codeElementsManager.GetAssemblyByName(selectedAssemblyName);

                List <NDependMetricDefinition> assemblyMetricsDefinionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions("AssemblyMetrics.xml");
                FillMetricsListView(thisDataGridView.SelectedRows[0], assemblyMetricsDefinionsList);

                this.lblCodeElementType.Text = "Assembly";
                this.lblCodeElementName.Text = selectedAssemblyName;

                List <NDependMetricDefinition> namespaceMetricsDefinionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions("NamespaceMetrics.xml");
                DataTable namespaceMetricsDataTable = CreateCodeElemetMetricsDataTable <INamespace>(assembly.ChildNamespaces, namespaceMetricsDefinionsList);
                FillCodeElementsDataGridView(this.dgvNamespaces, namespaceMetricsDataTable);
            }
        }
コード例 #5
0
        public Dictionary <NDependMetricDefinition, double> GetCodeElementMetrics <CodeElementType>(CodeElementType codeElement, string xmlMetricDefinitionFile)
        {
            List <NDependMetricDefinition> codeElementMetricsDefinitionsList = new NDependXMLMetricsDefinitionLoader().LoadMetricsDefinitions(xmlMetricDefinitionFile);

            return(GetCodeElementMetricsValues <CodeElementType>(codeElement, codeElementMetricsDefinitionsList));
        }