Пример #1
0
 private void btnFilter_Click(object sender, EventArgs e)
 {
     _filteredMessageSet = _messageSet.Filter(this.dtFrom.Value, this.dtTo.Value);
     this.statusBar.Text = _filteredMessageSet.Count + " filtered messages";
     if (_filteredMessageSet.Count > 0)
     {
         this.btnSaveAs.Enabled = true;
     }
 }
Пример #2
0
        private void loadFile(FileInfo fileInfo)
        {
            XmlDocument xdoc = new XmlDocument();

            xdoc.Load(fileInfo.FullName);
            _messageSet = new MessageSet();
            _messageSet.LoadArchive(xdoc);

            DisplayMessagesInGrid();
            this.statusBar.Text    = _messageSet.Count + " messages";
            this.btnSaveAs.Enabled = false;
            _filteredMessageSet    = null;
        }
Пример #3
0
        public MessageSet Filter(DateTime from, DateTime to)
        {
            MessageSet filteredMessageSet = new MessageSet();

            foreach (DataRow row in DataTable.Rows)
            {
                DateTime rowDateTime = (DateTime)row["date"];

                if (from < rowDateTime && rowDateTime < to)
                {
                    filteredMessageSet.CopyFromRowValues(row);
                }
            }
            return(filteredMessageSet);
        }
Пример #4
0
        public frmMain()
        {
            this.Font = SystemFonts.DialogFont;
            InitializeComponent();

            _messageSet = new MessageSet();

            this.dgMessages.Columns.Add("address", "To");
            this.dgMessages.Columns.Add("contact_name", "Who");
            this.dgMessages.Columns.Add("date", "Date");
            this.dgMessages.Columns.Add("type", "Type");
            this.dgMessages.Columns.Add("body", "Body");

            this.dtTo.Value   = DateTime.Today;
            this.dtFrom.Value = DateTime.Today.AddMonths(-6);
        }