示例#1
0
        public static Event LoadEvent()
        {
            Event ev = new Event();
            ev.Title = br.ReadString();
            ev.Date = br.ReadString();
            ev.Text = br.ReadString();

            return ev;
        }
示例#2
0
        public EventEditor(Event evsent, Series series, ListViewItem lvi)
        {
            InitializeComponent();
            frmMain.EditorOpened();

            this.series = series;
            this.lvi = lvi;
            this.Text = evsent.Title;

            ev = evsent;
            ev.Locked = true;

            PopulateControls();
        }
示例#3
0
 /// <summary>
 /// Update the ListViewItem associated with this event.
 /// </summary>
 /// <param name="ev"></param>
 /// <param name="lvi"></param>
 public void UpdateEvent(Event ev, ListViewItem lvi)
 {
     lvi.SubItems[0].Text = ev.Title;
     lvi.SubItems[1].Text = ev.Date;
     lvi.SubItems[2].Text = ev.Text;
 }
示例#4
0
        /// <summary>
        /// Add an event to the form and underlying series.
        /// </summary>
        /// <param name="ev"></param>
        public void AddEvent(Event ev)
        {
            // Add event to ListView
            ListViewItem lvi = new ListViewItem(ev.Title);
            lvi.SubItems.Add(ev.Date);
            lvi.SubItems.Add(ev.Text);
            lvi.Tag = ev;

            lstEvents.Items.Add(lvi);

            series.Events.Add(ev);
        }