CodeImp.Gluon.AgendaItem.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            if(recur == AgendaItemRecur.Annually)
                return description + " - " + recursions;
            else
                return description;
        }

Usage Example

Esempio n. 1
0
        // This sets up the panel for a specific day
        public void SetupDay(DateTime day)
        {
            thisday = day;

            string datestr = day.ToLongDateString();

            datelabel.Text = datestr.Replace(",", " ").ToUpper();
            Deselect();

            // Determine begin and end date for this day
            DateTime dstart = new DateTime(day.Year, day.Month, day.Day);
            DateTime dend   = new DateTime(dstart.Year, dstart.Month, dstart.Day);

            dend = dend.AddDays(1);
            dend = dend.AddTicks(-1);

            // Setup items
            List <AgendaItem> items = General.Agenda.GetItems(dstart, dend);

            for (int i = 0; i < NUM_ITEMS; i++)
            {
                // Within range of items or this day?
                if (i < items.Count)
                {
                    AgendaItem ditem   = items[i];
                    DateTime   itemend = ditem.startdate + ditem.duration;
                    itemlabels[i].Text       = ditem.startdate.Hour + ":" + ditem.startdate.Minute.ToString("00") + "      -";
                    itemlabels[i].Visible    = true;
                    itemends[i].Text         = itemend.Hour + ":" + itemend.Minute.ToString("00");
                    itemends[i].Visible      = true;
                    itembuttons[i].Text      = ditem.ToString();
                    itembuttons[i].ColorText = ditem.color;
                    itembuttons[i].SetupColors(General.Colors);
                    itembuttons[i].Tag     = ditem;
                    itembuttons[i].Visible = true;
                }
                else
                {
                    itembuttons[i].Tag     = null;
                    itemlabels[i].Visible  = false;
                    itembuttons[i].Visible = false;
                    itemends[i].Visible    = false;
                }
            }
        }
All Usage Examples Of CodeImp.Gluon.AgendaItem::ToString