Exemple #1
0
        private void buttonRefresh_Click(object sender, EventArgs e)
        {
            try
            {
                AssemblyDefinition assemblyDefinition = AssemblyDefinition.ReadAssembly(_assemblyFullFileName);
                textBoxAssembly.Text = assemblyDefinition.Name.ToString();

                _result = AssemblyAnalyzer.AnalyzeAssembly(assemblyDefinition);
                if (_result.ContainsNetOfficeReferences)
                {
                    buttonRefresh.Enabled              = true;
                    buttonReport.Enabled               = true;
                    panelInvalidAssembly.Visible       = false;
                    panelVersionTable.Visible          = true;
                    panelNoNetOfficeReferences.Visible = false;
                    panelResultTable.Visible           = true;
                    SetupVersionInfo(_result.Office, "Office");
                    SetupVersionInfo(_result.Excel, "Excel");
                    SetupVersionInfo(_result.Word, "Word");
                    SetupVersionInfo(_result.Outlook, "Outlook");
                    SetupVersionInfo(_result.PowerPoint, "PowerPoint");
                    SetupVersionInfo(_result.Access, "Access");
                    SetupVersionInfo(_result.Project, "Project");
                    SetupVersionInfo(_result.Visio, "Visio");
                }
                else
                {
                    buttonRefresh.Enabled              = false;
                    buttonReport.Enabled               = false;
                    panelInvalidAssembly.Visible       = false;
                    panelVersionTable.Visible          = false;
                    panelNoNetOfficeReferences.Visible = true;
                    panelResultTable.Visible           = false;
                }
            }
            catch (BadImageFormatException)
            {
                buttonRefresh.Enabled              = false;
                buttonReport.Enabled               = false;
                panelVersionTable.Visible          = false;
                panelNoNetOfficeReferences.Visible = false;
                panelResultTable.Visible           = false;
                panelInvalidAssembly.Visible       = true;
            }
            catch (Exception exception)
            {
                ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.NonCritical, _currentLanguageID);
                errorForm.ShowDialog(this);
            }
        }
Exemple #2
0
        public ReportControl(AnalyzerResult report, int currentLanguageID)
        {
            InitializeComponent();
            if (null == report.Report)
                return;
            _report = report;
            _currentLanguageID = currentLanguageID;
            comboBoxFilter.SelectedIndex = 0;
            Translator.TranslateControls(this, "OfficeCompatibility.ReportMessageTable.txt", _currentLanguageID);

            pictureBoxField.Image = imageList1.Images[3];
            pictureBoxProperty.Image = imageList1.Images[7];
            pictureBoxMethod.Image = imageList1.Images[5];
        }
Exemple #3
0
        public ReportControl(AnalyzerResult report, int currentLanguageID)
        {
            InitializeComponent();
            if (null == report.Report)
            {
                return;
            }
            _report                      = report;
            _currentLanguageID           = currentLanguageID;
            comboBoxFilter.SelectedIndex = 0;
            Translator.TranslateControls(this, "OfficeCompatibility.ReportMessageTable.txt", _currentLanguageID);

            pictureBoxField.Image    = imageList1.Images[3];
            pictureBoxProperty.Image = imageList1.Images[7];
            pictureBoxMethod.Image   = imageList1.Images[5];
        }
        private void buttonRefresh_Click(object sender, EventArgs e)
        {
            try
            {
                AssemblyDefinition assemblyDefinition = AssemblyDefinition.ReadAssembly(_assemblyFullFileName);
                textBoxAssembly.Text = assemblyDefinition.Name.ToString();

                _result = AssemblyAnalyzer.AnalyzeAssembly(assemblyDefinition);
                if (_result.ContainsNetOfficeReferences)
                {
                    buttonRefresh.Enabled = true;
                    buttonReport.Enabled = true;
                    panelInvalidAssembly.Visible = false;
                    panelVersionTable.Visible = true;
                    panelNoNetOfficeReferences.Visible = false;
                    panelResultTable.Visible = true;
                    SetupVersionInfo(_result.Office, "Office");
                    SetupVersionInfo(_result.Excel, "Excel");
                    SetupVersionInfo(_result.Word, "Word");
                    SetupVersionInfo(_result.Outlook, "Outlook");
                    SetupVersionInfo(_result.PowerPoint, "PowerPoint");
                    SetupVersionInfo(_result.Access, "Access");
                    SetupVersionInfo(_result.Project, "Project");
                    SetupVersionInfo(_result.Visio, "Visio");
                }
                else
                {
                    buttonRefresh.Enabled = false;
                    buttonReport.Enabled = false;
                    panelInvalidAssembly.Visible = false;
                    panelVersionTable.Visible = false;
                    panelNoNetOfficeReferences.Visible = true;
                    panelResultTable.Visible = false;
                }
            }
            catch (BadImageFormatException)
            {
                    buttonRefresh.Enabled = false;
                    buttonReport.Enabled = false;
                    panelVersionTable.Visible = false;
                    panelNoNetOfficeReferences.Visible = false;
                    panelResultTable.Visible = false;
                    panelInvalidAssembly.Visible = true;
            }
            catch (Exception exception)
            {
                ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.NonCritical, _currentLanguageID);
                errorForm.ShowDialog(this);
            }
        }