private void FillBaseControls()
        {
            FillNDependProjectInfo();
            IEnumerable <IAssembly>            lastAnalysisAssembliesList               = codeElementsManager.GetNonThirdPartyAssembliesInApplication();
            List <NDependMetricDefinition>     nDependAssemblyMetricsDefinionsList      = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions("AssemblyMetrics.xml");
            List <UserDefinedMetricDefinition> userDefinedAssemblyMetricsDefinitionList = new XMLMetricsDefinitionLoader().LoadUserDefinedMetricsDefinitions("AssemblyUserDefinedMetrics.xml");
            DataTable assemblyMetricsDataTable = dataTableHelper.CreateCodeElementMetricsDataTable <IAssembly>(lastAnalysisAssembliesList, nDependAssemblyMetricsDefinionsList, userDefinedAssemblyMetricsDefinitionList);

            FillCodeAsembliestDataGridView(assemblyMetricsDataTable);
            FillTestAssembliesDataGridView(assemblyMetricsDataTable);
            FillSpecFlowBDDAssembliesDataGridView(assemblyMetricsDataTable);
        }
        private void NamespacesDataGridViewSelectionChangedEventManager(DataGridView senderDataGridView, DataGridView targetTypesDataGridView, ListView targetMetricsListView, Label targetElementTypeLabel, Label targetElementNameLabel)
        {
            if (senderDataGridView.SelectedRows.Count > 0)
            {
                string     selectedNamespaceName = senderDataGridView.SelectedRows[0].Cells[0].Value.ToString();
                INamespace nNamespace            = codeElementsManager.GetNamespaceByName(selectedNamespaceName);

                List <NDependMetricDefinition>     nDependTypeMetricsDefinionsList      = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions("TypeMetrics.xml");
                List <UserDefinedMetricDefinition> userDefinedTypeMetricsDefinitionList = new XMLMetricsDefinitionLoader().LoadUserDefinedMetricsDefinitions("TypeUserDefinedMetrics.xml");
                DataTable typeMetricsDataTable = dataTableHelper.CreateCodeElementMetricsDataTable <IType>(nNamespace.ChildTypes, nDependTypeMetricsDefinionsList, userDefinedTypeMetricsDefinitionList);
                FillCodeElementsDataGridView(targetTypesDataGridView, typeMetricsDataTable, true);
            }
        }
        private void MethodsDataGridViewClickEventManager(DataGridView senderDataGridView, ListView targetNDependMetricsListView, ListView targetUserDefinedMetricsListView, string codeSection, Label targetElementTypeLabel, Label targetElementNameLabel)
        {
            if (senderDataGridView.SelectedRows.Count > 0)
            {
                string selectedMethod = senderDataGridView.SelectedRows[0].Cells[0].Value.ToString();

                List <NDependMetricDefinition>     methodsNDependMetricsDefinionsList       = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions("MethodMetrics.xml");
                List <UserDefinedMetricDefinition> methodsUserDefinedMetricsDefinitionsList = new XMLMetricsDefinitionLoader().LoadUserDefinedMetricsDefinitions("MethodUserDefinedMetrics.xml");
                FillMetricsListView(targetNDependMetricsListView, targetUserDefinedMetricsListView, codeSection, senderDataGridView.SelectedRows[0], methodsNDependMetricsDefinionsList, methodsUserDefinedMetricsDefinitionsList);

                targetElementTypeLabel.Text = "Method";
                targetElementNameLabel.Text = selectedMethod;
            }
        }
        private void TypesDataGridViewSelectionChangedEventManager(DataGridView senderDataGridView, DataGridView targetMethodsDataGridView, ListView targetMetricsListView, Label targetElementTypeLabel, Label targetElementNameLabel)
        {
            if (senderDataGridView.SelectedRows.Count > 0)
            {
                string selectedType = senderDataGridView.SelectedRows[0].Cells[0].Value.ToString();
                IType  nType        = codeElementsManager.GetTypeByName(selectedType);

                List <NDependMetricDefinition>     nDependMethodMetricsDefinionsList      = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions("MethodMetrics.xml");
                List <UserDefinedMetricDefinition> userDefinedMethodMetricsDefinitionList = new XMLMetricsDefinitionLoader().LoadUserDefinedMetricsDefinitions("MethodUserDefinedMetrics.xml");
                DataTable methodMetricsDataTable    = dataTableHelper.CreateCodeElementMetricsDataTable <IMethod>(nType.MethodsAndContructors, nDependMethodMetricsDefinionsList, userDefinedMethodMetricsDefinitionList);
                bool      isTestMethodsDataViewGrid = targetMethodsDataGridView.Name == "dgvUnitTestsMethods" || targetMethodsDataGridView.Name == "dgvBDDMethods";
                FillCodeElementsDataGridView(targetMethodsDataGridView, methodMetricsDataTable, !isTestMethodsDataViewGrid);
            }
        }
예제 #5
0
        public Dictionary <NDependMetricDefinition, double> GetCodeElementMetrics <CodeElementType>(CodeElementType codeElement, string xmlMetricDefinitionFile)
        {
            List <NDependMetricDefinition> codeElementMetricsDefinitionsList = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions(xmlMetricDefinitionFile);

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