示例#1
0
 private void DisplayPercentageCheckbox_CheckedChanged(object sender, EventArgs e)
 {
     if (DisplayPercentageCheckbox.Checked == true)
     {
         EntityFieldAnalyserManager.SetChartFieldsType(entityFields, ChartFieldTypes, false);
         EntityFieldAnalyserManager.SetChartFieldAvailable(entityFields, ChartFieldAvailable, true);
         EntityFieldAnalyserManager.SetChartManagedUnmanagedFields(chartManagedUnmanagedFields, false);
     }
     else
     {
         EntityFieldAnalyserManager.SetChartFieldsType(entityFields, ChartFieldTypes, true);
         EntityFieldAnalyserManager.SetChartFieldAvailable(entityFields, ChartFieldAvailable, false);
         EntityFieldAnalyserManager.SetChartManagedUnmanagedFields(chartManagedUnmanagedFields, true);
     }
 }
示例#2
0
        private void AnalyseEntity()
        {
            fieldTypeCombobox.Enabled         = false;
            buttonExport.Enabled              = false;
            analyseButton.Enabled             = false;
            DisplayPercentageCheckbox.Enabled = false;
            WorkAsync(new WorkAsyncInfo
            {
                Message = "Analysing ...",
                Work    = (worker, args) =>
                {
                    try
                    {
                        dtFields     = new DataTable();
                        entityFields = EntityFieldAnalyserManager.getEntityFields(Service, entitySelectedSchemaName, entitySelectedName, worker);

                        #region Entity Fiels Metadata  Set
                        dtFields.Columns.Add("Display Name", typeof(string));
                        dtFields.Columns.Add("Schema Name", typeof(string));
                        dtFields.Columns.Add("Managed/Unmanaged", typeof(string));
                        dtFields.Columns.Add("IsAuditable", typeof(bool));
                        dtFields.Columns.Add("IsSearchable", typeof(bool));
                        dtFields.Columns.Add("Required Level", typeof(string));
                        dtFields.Columns.Add("Introduced Version", typeof(String));
                        dtFields.Columns.Add("CreatedOn", typeof(DateTime));
                        dtFields.Columns.Add("Target", typeof(string));
                        dtFields.Columns.Add("Percentage Of Use", typeof(string));
                        #endregion

                        args.Result = entityFields;
                    }
                    catch (Exception e) {
                        MessageBox.Show(e.Message, "Warning");
                    }
                },
                ProgressChanged = e =>
                {
                    // If progress has to be notified to user, use the following method:
                    SetWorkingMessage(e.UserState.ToString());
                },
                PostWorkCallBack = (args) =>
                {
                    fieldTypeCombobox.Items.Clear();
                    if (args.Error != null)
                    {
                        MessageBox.Show(args.Error.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    var result = (Dictionary <AttributeTypeCode, List <entityParam> >)args.Result;
                    if (result != null)
                    {
                        foreach (var type in result.Keys)
                        {
                            fieldTypeCombobox.Items.Add(type);
                        }
                        #region Set Charts Data
                        EntityFieldAnalyserManager.setStatisticsFieldText(label7);
                        EntityFieldAnalyserManager.SetChartFieldsType(result, ChartFieldTypes);
                        EntityFieldAnalyserManager.SetChartFieldAvailable(result, ChartFieldAvailable);
                        EntityFieldAnalyserManager.SetChartManagedUnmanagedFields(chartManagedUnmanagedFields);
                        #endregion
                        #region Manage Componenet Visibilty
                        searchEntity.Enabled = true;
                        DisplayPercentageCheckbox.Enabled      = true;
                        DisplayPercentageCheckbox.Visible      = true;
                        fieldTypeCombobox.Enabled              = true;
                        DisplayPercentageCheckbox.Checked      = false;
                        EntityFieldsCreatedGroupBox.Visible    = true;
                        ManagedUnmanagedFieldsgroupBox.Visible = true;
                        EntityFieldsTypesGroupBox.Visible      = true;
                        fieldCalculatorGroupBox.Visible        = true;
                        buttonExport.Enabled  = true;
                        analyseButton.Enabled = true;
                        #endregion
                        fieldTypeCombobox.SelectedIndex = 0;       //Select the second type in the fields type combobox
                        #region Chart ToolTip
                        ToolTip toolTip = new ToolTip();
                        toolTip.SetToolTip(this.EntityFieldsCreatedGroupBox, "This Chart Display The Percentage of Use of the Entity Total Fields Volume");
                        toolTip.SetToolTip(this.ManagedUnmanagedFieldsgroupBox, "This Chart Display The Count Managed/Unmanaged Fields in Your Entity");
                        toolTip.SetToolTip(this.EntityFieldsTypesGroupBox, "This Chart Display The Count of Fields Per Type");
                        #endregion
                    }
                }
            });
        }