コード例 #1
0
ファイル: Form1.cs プロジェクト: gravbox/GbSchedule
        private void cmdAppointment_Click(object sender, EventArgs e)
        {
            if (Schedule1.AppointmentCollection.Count == 0)
            {
                return;
            }

            Schedule1.SelectionType = Gravitybox.Controls.Schedule.SelectionTypeConstants.None;
            foreach (Gravitybox.Objects.Appointment appointment in Schedule1.AppointmentCollection)
            {
                appointment.Appearance.IsRound           = true;
                appointment.Appearance.BackColor         = Color.White;
                appointment.Appearance.BackColor2        = Color.LightSkyBlue;
                appointment.Appearance.BackGradientStyle = Gravitybox.Objects.GradientStyleConstants.ForwardDiagonal;
                appointment.Appearance.Transparency      = 35;
                appointment.Appearance.TextVAlign        = StringAlignment.Center;

                appointment.Header.Appearance.BackColor         = Color.White;
                appointment.Header.Appearance.BackColor2        = Color.Aqua;
                appointment.Header.Appearance.BackGradientStyle = Gravitybox.Objects.GradientStyleConstants.Horizontal;
                appointment.Header.HeaderType = Gravitybox.Objects.AppointmentHeader.HeaderTypeConstants.Text;
                appointment.Header.Text       = "This is a very long header text!";
                appointment.Header.Appearance.TextTrimming = StringTrimming.EllipsisCharacter;
                appointment.Header.Appearance.TextVAlign   = StringAlignment.Center;
            }

            Schedule1.Refresh();
        }
コード例 #2
0
ファイル: XMLForm.cs プロジェクト: gravbox/GbSchedule
 private void RandomAppointments()
 {
     for (int ii = 1; ii <= 10; ii++)
     {
         DateTime newDate = schedule1.MinDate.AddDays(RandomInt(DAYCOUNT));
         DateTime newTime = schedule1.StartTime.AddMinutes(RandomInt(480));
         int      length  = 1 + RandomInt(119);
         schedule1.AppointmentCollection.Add("", newDate, newTime, length);
     }
     schedule1.Refresh();
 }
コード例 #3
0
        private void NextSlotForm_Load(object sender, System.EventArgs e)
        {
            this.WindowState     = FormWindowState.Maximized;
            this.Timer1.Interval = 800;

            lblDescription.Text = "This screen has a number of predefined appointments. An appointment will display in the top, left hand corner of the schedule and then move to the next free slot every 2 seconds. This functionality allows you query the schedule for available appointment space. Press 'Close' to close the screen.";

            schedule1.SetMinMaxDate(DateTime.Parse("1/1/2004"), DateTime.Parse("1/5/2004"));
            schedule1.DayLength            = 9;
            schedule1.RowHeader.Size       = 25;
            schedule1.ColumnHeader.AutoFit = true;
            schedule1.AllowSelector        = false;

            //Load some appointments
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), DateTime.Parse("10:00:00 AM"), 60);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), DateTime.Parse("12:00:00 PM"), 90);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), DateTime.Parse("2:00:00 PM"), 60);

            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("8:30:00 AM"), 30);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("10:00:00 AM"), 30);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("11:00:00 AM"), 60);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("3:00:00 PM"), 60);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("4:30:00 PM"), 30);

            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/3/2004"), DateTime.Parse("8:00:00 AM"), 30);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/3/2004"), DateTime.Parse("10:30:00 AM"), 120);
            schedule1.AppointmentCollection.Add("", DateTime.Parse("1/3/2004"), DateTime.Parse("3:30:00 PM"), 45);

            //Setup some appointment properties
            int ii = 1;

            foreach (Appointment element in schedule1.AppointmentCollection)
            {
                element.Subject = "This is appointment " + ii.ToString();
                ii += 1;
            }

            //*******************************************
            //Add the appointment for which we will search for slots
            //Its key is "xyz", this can be any unique string
            Appointment appointment;

            appointment         = schedule1.AppointmentCollection.Add("xyz", DateTime.Parse("1/1/2004"), DateTime.Parse("8:00:00 AM"), 60);
            appointment.Subject = "Test Appt";
            appointment.Appearance.BackColor = Color.LightBlue;
            Timer1.Enabled = true;

            //Refresh the schedule
            schedule1.Refresh();
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: gravbox/GbSchedule
        private void LoadTestAppointments()
        {
            Appointment appointment;

            schedule1.AppointmentCollection.Clear();

            appointment                      = schedule1.AppointmentCollection.Add("", DateTime.Today, DateTime.Parse("10:00:00 AM"), 60);
            appointment.Subject              = "This is a test!";
            appointment.ToolTipText          = appointment.Subject;
            appointment.Appearance.BackColor = System.Drawing.Color.Yellow;

            appointment                      = schedule1.AppointmentCollection.Add("", DateTime.Today, DateTime.Parse("11:00:00 AM"), 60);
            appointment.Subject              = "Just Another Test!";
            appointment.ToolTipText          = appointment.Subject;
            appointment.IsFlagged            = true;
            appointment.Appearance.BackColor = System.Drawing.Color.Aqua;

            schedule1.Refresh();
        }
コード例 #5
0
ファイル: IconForm.cs プロジェクト: gravbox/GbSchedule
        private void cmdAdd_Click(object sender, System.EventArgs e)
        {
            //Add an appointment
            Appointment appointment;

            schedule1.AppointmentCollection.Clear();
            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), "9:00:00 AM", 120);
            appointment.Subject = "This is a test";

            //Add images from the ImageList to the appointment
            appointment.IconCollection.Add("", ImageList1.Images[0]);
            appointment.IconCollection.Add("", ImageList1.Images[1]);

            schedule1.Refresh();
        }
コード例 #6
0
        private void cmdAdd_Click(object sender, System.EventArgs e)
        {
            //Add an appointment
            Appointment appointment;

            schedule1.AppointmentCollection.Clear();
            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("9:00:00 AM"), 90);
            appointment.Subject = "This is a test";

            //Add providers to the appointment
            appointment.ProviderList.Add(schedule1.ProviderCollection[0]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[1]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[2]);

            //Redraw the schedule
            schedule1.Refresh();
        }
コード例 #7
0
        private void MainForm_Load(object sender, System.EventArgs e)
        {
            //Setup Schedule
            schedule1.SetMinMaxDate(DateTime.Parse("1/1/2004"), DateTime.Parse("1/5/2004"));
            schedule1.StartTime              = DateTime.Parse("8:00:00 AM");
            schedule1.DayLength              = 10;
            schedule1.ConflictDisplay        = Gravitybox.Controls.Schedule.ConflictDisplayConstants.SideBySide;
            schedule1.ViewMode               = Gravitybox.Controls.Schedule.ViewModeConstants.DayRoomTopTimeLeft;
            schedule1.AppointmentBar.BarType = Gravitybox.Controls.Schedule.AppointmentBarConstants.None;
            schedule1.AllowSelector          = false;

            //Add NoDropAreas
            schedule1.NoDropAreaCollection.Add("", Color.Red, DateTime.Parse("12:00:00 PM"), 90);             //Lunch hour

            //Load Data
            Appointment appointment = null;
            Provider    provider    = null;
            Room        room        = null;
            Category    category    = null;

            //Load Providers
            provider = schedule1.ProviderCollection.Add("", "Sam", Color.LightGoldenrodYellow);
            provider = schedule1.ProviderCollection.Add("", "Julie", Color.LightGray);
            provider = schedule1.ProviderCollection.Add("", "Joe", Color.LightGreen);

            //Load Categories
            category = schedule1.CategoryCollection.Add("", "Major", Color.LightBlue);
            category = schedule1.CategoryCollection.Add("", "Cleaning", Color.LightCoral);
            category = schedule1.CategoryCollection.Add("", "Misc", Color.LightCyan);

            //Load Rooms
            room = schedule1.RoomCollection.Add("", "Exam I");
            room = schedule1.RoomCollection.Add("", "Exam II");

            //Load Appointments
            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), schedule1.RoomCollection[0], DateTime.Parse("8:00:00 AM"), 60);
            appointment.Subject = "Sue Collins";
            appointment.CategoryList.Add(schedule1.CategoryCollection[0]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[1]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), schedule1.RoomCollection[0], DateTime.Parse("9:30:00 AM"), 60);
            appointment.Subject = "Joe Jones";
            appointment.CategoryList.Add(schedule1.CategoryCollection[0]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[2]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), schedule1.RoomCollection[0], DateTime.Parse("10:30:00 AM"), 60);
            appointment.Subject = "Bill Sellers";
            appointment.CategoryList.Add(schedule1.CategoryCollection[1]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[1]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), schedule1.RoomCollection[1], DateTime.Parse("8:30:00 AM"), 60);
            appointment.Subject = "Jack Jones";
            appointment.CategoryList.Add(schedule1.CategoryCollection[1]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[0]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), schedule1.RoomCollection[1], DateTime.Parse("9:30:00 AM"), 60);
            appointment.Subject = "Mike Martin";
            appointment.CategoryList.Add(schedule1.CategoryCollection[0]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[1]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), schedule1.RoomCollection[1], DateTime.Parse("10:30:00 AM"), 90);
            appointment.Subject = "Ian Davis";
            appointment.CategoryList.Add(schedule1.CategoryCollection[2]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[0]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), schedule1.RoomCollection[0], DateTime.Parse("9:00:00 AM"), 90);
            appointment.Subject = "Rusty Grey";
            appointment.CategoryList.Add(schedule1.CategoryCollection[1]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[1]);

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), schedule1.RoomCollection[0], DateTime.Parse("10:00:00 AM"), 90);
            appointment.Subject = "John Smith";
            appointment.CategoryList.Add(schedule1.CategoryCollection[2]);
            appointment.ProviderList.Add(schedule1.ProviderCollection[0]);

            //Format all appointments
            foreach (Appointment element in schedule1.AppointmentCollection)
            {
                element.Appearance.IsRound      = true;
                element.Appearance.Transparency = 30;
                element.Appearance.BackColor    = Color.LightBlue;
            }

            schedule1.Refresh();
        }
コード例 #8
0
        private void LoadSet1()
        {
            const int   Transparency = 40;
            Appointment appointment;

            schedule1.SetMinMaxDate(DateTime.Parse("1/1/2004"), DateTime.Parse("1/5/2004"));
            schedule1.AppointmentCollection.Clear();

            appointment                                = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), DateTime.Parse("8:00:00 AM"), 120);
            appointment.Subject                        = "Appointment 1";
            appointment.Appearance.IsRound             = true;
            appointment.Appearance.BackColor           = Color.LightBlue;
            appointment.Header.Appearance.AllowBreak   = true;
            appointment.Header.Appearance.Transparency = Transparency;

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/1/2004"), DateTime.Parse("11:00:00 AM"), 120);
            appointment.Subject = "Appointment 2";
            appointment.Appearance.BackColor           = Color.LightCoral;
            appointment.Appearance.Transparency        = Transparency;
            appointment.Header.Appearance.AllowBreak   = true;
            appointment.Header.Appearance.Transparency = appointment.Appearance.Transparency;

            appointment                                = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("9:30:00 AM"), 60);
            appointment.Subject                        = "Appointment 3";
            appointment.Appearance.IsRound             = true;
            appointment.Appearance.Transparency        = Transparency;
            appointment.Appearance.BackColor           = Color.LightCyan;
            appointment.Header.Icon                    = schedule1.DefaultIcons.IconInfo;
            appointment.Header.Appearance.Transparency = appointment.Appearance.Transparency;

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/2/2004"), DateTime.Parse("12:30:00 PM"), 60);
            appointment.Subject = "Appointment 4";
            appointment.Appearance.Transparency        = Transparency;
            appointment.Appearance.BackColor           = Color.LightGoldenrodYellow;
            appointment.Header.HeaderType              = AppointmentHeader.HeaderTypeConstants.None;
            appointment.Header.Appearance.Transparency = appointment.Appearance.Transparency;

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/3/2004"), DateTime.Parse("10:00:00 AM"), 60);
            appointment.Subject = "Appointment 5";
            appointment.Appearance.Transparency        = Transparency;
            appointment.Appearance.IsRound             = true;
            appointment.Appearance.BackColor           = Color.LightGray;
            appointment.Header.HeaderType              = AppointmentHeader.HeaderTypeConstants.DateHeader;
            appointment.Header.Appearance.Transparency = appointment.Appearance.Transparency;

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/3/2004"), DateTime.Parse("1:30:00 PM"), 60);
            appointment.Subject = "Appointment 6";
            appointment.Appearance.Transparency        = Transparency;
            appointment.Appearance.BackColor           = Color.LightGreen;
            appointment.Header.HeaderType              = AppointmentHeader.HeaderTypeConstants.Text;
            appointment.Header.Text                    = "Custom";
            appointment.Header.Appearance.Transparency = appointment.Appearance.Transparency;

            appointment         = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/4/2004"), DateTime.Parse("8:30:00 AM"), 90);
            appointment.Subject = "Appointment 7";
            appointment.Appearance.Transparency        = Transparency;
            appointment.Appearance.BackColor           = Color.LightPink;
            appointment.Header.Appearance.Transparency = 0;

            appointment                                = schedule1.AppointmentCollection.Add("", DateTime.Parse("1/5/2004"), DateTime.Parse("11:30:00 AM"), 90);
            appointment.Subject                        = "Appointment 8";
            appointment.Appearance.IsRound             = true;
            appointment.Appearance.Transparency        = Transparency;
            appointment.Appearance.BackColor           = Color.LightSeaGreen;
            appointment.Header.Appearance.Transparency = 0;
            appointment.Header.HeaderType              = AppointmentHeader.HeaderTypeConstants.None;

            schedule1.Refresh();
        }