public void InitReport(IReportGenerationManager reportManager)
        {
            this.reportManager = reportManager;
            this.reports = ServiceLocator.Current.GetAllInstances<IChatReportGenerator>().ToList();
            this.cblReports.Items.Clear();
            foreach (var reportGenerator in this.reports)
            {
                this.cblReports.Items.Add(reportGenerator.Name, true);
            }

            try
            {
                this.chats = this.chatRepository.GetAll();
            }
            catch (Exception ex)
            {
                if (ex.Message == "Unable to open the database file")
                {
                    MessageBox.Show(
                        "Unable to open skype data. Perhaps Skype is running. It should be closed.",
                        "Warning",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                }
                else
                {
                    UIUtils.ShowException(ex, true);
                }
                Application.Exit();
            }
            this.cbChats.Items.AddRange(this.chats.OrderByDescending(c => c.LastChange).ToArray());
            if (this.cbChats.Items.Count != 0)
            {
                this.cbChats.SelectedIndex = 0;
            }
        }
Ejemplo n.º 2
0
        public void InitReport(IReportGenerationManager reportManager)
        {
            this.reportManager = reportManager;
            this.reports       = ServiceLocator.Current.GetAllInstances <IChatReportGenerator>().ToList();
            this.cblReports.Items.Clear();
            foreach (var reportGenerator in this.reports)
            {
                this.cblReports.Items.Add(reportGenerator.Name, true);
            }

            try
            {
                this.chats = this.chatRepository.GetAll();
            }
            catch (Exception ex)
            {
                if (ex.Message == "Unable to open the database file")
                {
                    MessageBox.Show(
                        "Unable to open skype data. Perhaps Skype is running. It should be closed.",
                        "Warning",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                }
                else
                {
                    UIUtils.ShowException(ex, true);
                }
                Application.Exit();
            }
            this.cbChats.Items.AddRange(this.chats.OrderByDescending(c => c.LastChange).ToArray());
            if (this.cbChats.Items.Count != 0)
            {
                this.cbChats.SelectedIndex = 0;
            }
        }
 public void InitReport(IReportGenerationManager reportManager)
 {
     this.reportManager = reportManager;
 }
 public void InitReport(IReportGenerationManager reportManager)
 {
     this.reportManager = reportManager;
 }