コード例 #1
0
        private void AssembliesDataGridViewSelectionChangedEventManager(DataGridView senderDataGridView, DataGridView targetNamespacesDataGridView, ListView targetMetricsListView, Label targetElementTypeLabel, Label targetElementNameLabel)
        {
            if (senderDataGridView.SelectedRows.Count > 0)
            {
                string selectedAssemblyName = senderDataGridView.SelectedRows[0].Cells[0].Value.ToString();
                IAssembly assembly = codeElementsManager.GetAssemblyByName(selectedAssemblyName);

                List<NDependMetricDefinition> nDependNamespaceMetricsDefinionsList = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions("NamespaceMetrics.xml");
                List<UserDefinedMetricDefinition> userDefinedNamespaceMetricsDefinitionList = new XMLMetricsDefinitionLoader().LoadUserDefinedMetricsDefinitions("NamespaceUserDefinedMetrics.xml");
                DataTable namespaceMetricsDataTable = dataTableHelper.CreateCodeElementMetricsDataTable<INamespace>(assembly.ChildNamespaces, nDependNamespaceMetricsDefinionsList, userDefinedNamespaceMetricsDefinitionList);
                FillCodeElementsDataGridView(targetNamespacesDataGridView, namespaceMetricsDataTable, true);
            }
        }
コード例 #2
0
        private void AssembliesDataGridViewClickEventManager(DataGridView senderDataGridView, ListView targetNDependMetricsListView, ListView targetUserDefinedMetricsListView, string codeSection, Label targetElementTypeLabel, Label targetElementNameLabel)
        {
            if (senderDataGridView.SelectedRows.Count > 0)
            {
                string selectedAssemblyName = senderDataGridView.SelectedRows[0].Cells[0].Value.ToString();

                List<NDependMetricDefinition> assemblyNDependMetricsDefinionsList = new XMLMetricsDefinitionLoader().LoadNDependMetricsDefinitions("AssemblyMetrics.xml");
                List<UserDefinedMetricDefinition> assemblyUserDefinedMetricsDefinitionsList = new XMLMetricsDefinitionLoader().LoadUserDefinedMetricsDefinitions("AssemblyUserDefinedMetrics.xml");
                FillMetricsListView(targetNDependMetricsListView, targetUserDefinedMetricsListView, codeSection, senderDataGridView.SelectedRows[0], assemblyNDependMetricsDefinionsList, assemblyUserDefinedMetricsDefinitionsList);

                targetElementTypeLabel.Text = "Assembly";
                targetElementNameLabel.Text = selectedAssemblyName;
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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);
 }