Added enhanced listview display for appointments using tiles
This commit is contained in:
		
							parent
							
								
									ebde96e76d
								
							
						
					
					
						commit
						cc3656a925
					
				@ -115,6 +115,7 @@
 | 
			
		||||
            // 
 | 
			
		||||
            // listView1
 | 
			
		||||
            // 
 | 
			
		||||
            this.listView1.Activation = System.Windows.Forms.ItemActivation.OneClick;
 | 
			
		||||
            this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
 | 
			
		||||
            this.columnHeader1,
 | 
			
		||||
            this.columnHeader2});
 | 
			
		||||
@ -129,19 +130,20 @@
 | 
			
		||||
            this.listView1.ShowItemToolTips = true;
 | 
			
		||||
            this.listView1.Size = new System.Drawing.Size(226, 507);
 | 
			
		||||
            this.listView1.TabIndex = 4;
 | 
			
		||||
            this.listView1.TileSize = new System.Drawing.Size(300, 38);
 | 
			
		||||
            this.listView1.UseCompatibleStateImageBehavior = false;
 | 
			
		||||
            this.listView1.View = System.Windows.Forms.View.Details;
 | 
			
		||||
            this.listView1.View = System.Windows.Forms.View.Tile;
 | 
			
		||||
            this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick);
 | 
			
		||||
            // 
 | 
			
		||||
            // columnHeader1
 | 
			
		||||
            // 
 | 
			
		||||
            this.columnHeader1.Text = "Date";
 | 
			
		||||
            this.columnHeader1.Width = 78;
 | 
			
		||||
            this.columnHeader1.Width = 200;
 | 
			
		||||
            // 
 | 
			
		||||
            // columnHeader2
 | 
			
		||||
            // 
 | 
			
		||||
            this.columnHeader2.Text = "Subject";
 | 
			
		||||
            this.columnHeader2.Width = 163;
 | 
			
		||||
            this.columnHeader2.Width = 200;
 | 
			
		||||
            // 
 | 
			
		||||
            // grpRefresh
 | 
			
		||||
            // 
 | 
			
		||||
@ -170,7 +172,6 @@
 | 
			
		||||
            this.apptCalendar.Name = "apptCalendar";
 | 
			
		||||
            this.apptCalendar.OtherMonthForeColor = System.Drawing.Color.LightGray;
 | 
			
		||||
            this.apptCalendar.SelectedBackColor = System.Drawing.Color.LightBlue;
 | 
			
		||||
            this.apptCalendar.SelectedDate = new System.DateTime(2013, 4, 26, 0, 0, 0, 0);
 | 
			
		||||
            this.apptCalendar.SelectedForeColor = System.Drawing.Color.Blue;
 | 
			
		||||
            this.apptCalendar.Size = new System.Drawing.Size(226, 242);
 | 
			
		||||
            this.apptCalendar.TabIndex = 1;
 | 
			
		||||
 | 
			
		||||
@ -119,23 +119,26 @@ namespace Outlook2013TodoAddIn
 | 
			
		||||
            int sameDay = -1; // startRange.Day;
 | 
			
		||||
 | 
			
		||||
            List<ListViewItem> lstCol = new List<ListViewItem>();
 | 
			
		||||
            ListViewGroup grp = null;
 | 
			
		||||
            lstItems.ToList().ForEach(i =>
 | 
			
		||||
            {
 | 
			
		||||
                if (i.Start.Day != sameDay)
 | 
			
		||||
                {
 | 
			
		||||
                    ListViewItem dateItem = new ListViewItem() { Text = i.Start.ToShortDateString() };
 | 
			
		||||
                    dateItem.Font = new Font(this.listView1.Font, FontStyle.Bold);
 | 
			
		||||
                    lstCol.Add(dateItem);
 | 
			
		||||
                    grp = new ListViewGroup(i.Start.ToShortDateString(), HorizontalAlignment.Left);
 | 
			
		||||
                    this.listView1.Groups.Add(grp); // TODO: Style it?
 | 
			
		||||
                    sameDay = i.Start.Day;
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                ListViewItem current = new ListViewItem() { Text = i.Start.ToShortTimeString() };
 | 
			
		||||
                string loc = "-"; // TODO: If no second line is specified, the tile is stretched to only one line
 | 
			
		||||
                if (!String.IsNullOrEmpty(i.Location)) loc = i.Location;
 | 
			
		||||
                ListViewItem current = new ListViewItem(new string[] { String.Format("{0} {1}", i.Start.ToShortTimeString(), i.Subject), loc });
 | 
			
		||||
                current.SubItems.Add(i.Subject);
 | 
			
		||||
 | 
			
		||||
                // current.SubItems.Add(i.Location);
 | 
			
		||||
                // current.Font = new Font(this.Font, FontStyle.Bold);
 | 
			
		||||
                // current.UseItemStyleForSubItems = false;
 | 
			
		||||
 | 
			
		||||
                current.ToolTipText = String.Format("{0} - {1}  {2}", i.Start.ToShortTimeString(), i.End.ToShortTimeString(), i.Subject);
 | 
			
		||||
                current.Tag = i;
 | 
			
		||||
 | 
			
		||||
                current.Group = grp;
 | 
			
		||||
                switch (i.BusyStatus)
 | 
			
		||||
                {
 | 
			
		||||
                    case Outlook.OlBusyStatus.olBusy:
 | 
			
		||||
@ -155,16 +158,6 @@ namespace Outlook2013TodoAddIn
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                lstCol.Add(current);
 | 
			
		||||
 | 
			
		||||
                // Add location into a new line (if available)
 | 
			
		||||
                if (!String.IsNullOrEmpty(i.Location))
 | 
			
		||||
                {
 | 
			
		||||
                    ListViewItem locationItem = new ListViewItem() { Text = String.Empty };
 | 
			
		||||
                    locationItem.SubItems.Add(i.Location);
 | 
			
		||||
                    locationItem.ForeColor = current.ForeColor;
 | 
			
		||||
                    locationItem.Tag = i;
 | 
			
		||||
                    lstCol.Add(locationItem);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            this.listView1.Items.Clear();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user