outlook calendar

Oct 15, 2009 at 7:04 PM

i've download your application and i think that is very well. But a question: it's possibile to add appointments in the outlook calendar? I've tried, but without success!

thank you in advance

Coordinator
Oct 15, 2009 at 7:20 PM

I am working now on the UI for adding appointments.  The "Click To Add Appointments" button does not work quite yet, I am hoping to have something working by this evening on this matter.  To add them manually there is an xml file in the ClientBin folder on the SLControlLibrary.Web project named AppointmentOptions.  Just add another line in the Values section named Appointment with the appropriate tags (like the example).  This will give you the new appointments for the mean time.  Like I said before, I am hoping to have some sort of UI for the Appointments by this evening.  Thank you for your interest in the application.  I am trying to get my raitings up so if you like please rate it for me and tell your friends/co-workers about it.

Thanks,

Dixxieonmymind

Oct 15, 2009 at 7:46 PM

ok, i hope you can finish your project because for me is very good. I've rate for you.

I've modified the xml but, it seems doesn't work... it's possible to add appointments from code? if it is possible, you can post me an example?

Coordinator
Oct 15, 2009 at 8:46 PM
To create it through the xml all you have to do is insert the second line in the Values section and then REFRESH the application.  I put enphasis on the refresh because the only time the xml is read is on the load of the Outlook Calendar.  So through the demo all you have to do is re-click the Outlook Calendar button on the left.
<Appointments>
  <Settings>
    <Add id="1" value="Urgent" color="Red" />
    <Add id="2" value="Normal" color="#FFE9EBED" />
  </Settings>
  <Values>
    <Appointment id="1" startdate="10/14/2009" enddate="10/01/2009" starttime="12:30" endtime="13:00" value="1" desc="Happy Birthday." />
    <Appointment id="2" startdate="10/15/2009" enddate="10/01/2009" starttime="12:30" endtime="13:00" value="1" desc="New Appointment" />
  </Values>
</Appointments>
To do this through code you need to find the class ucCalendar.cs in the SLControlLibrary Project under the path "Resources.Controls.OutlookCalendar.ucCalendar.cs".
In this file you find the event AppProvider_OptionsLoaded which is fired after the xml file is read and the object "Appointments" is populated.  To hard code new
appointments you will need to do the following:
Insert your new appointments in this fashion.  If you want to change the date and time that the appointments are created then follow the StartTime example by creating
a new DateTime object passing in the Year, Month, Day, Hour, Minute, Second, Millisecond.  The seconds and milliseconds are not takin into condiseration on the
appointments and the EndDate and EndTime are not working quite yet.  The ID's are not so important but for good coding standards there is already one (or how many
you have added to this point) item in the list from the xml file so I continue on with the that number plus one.  The appointment value is generated from the 
xml file as well but since you are creating just generic appointments you can create a new AppointmentValue object and pass in the Value and Color as shown below.
(sender as AppointmentProvider)._OptionsProvider.AppointmentList.Add(new Appointment()
            { 
                ID=2, 
                Desc="Blah 1", 
                StartDate=DateTime.Now.Date, 
                EndDate = DateTime.Now.Date,
                StartTime = new DateTime(2009, 10, 15, 9, 30, 0, 0), 
                EndTime=DateTime.Now, 
                Value = new AppointmentValue()
                    { 
                        ID = 1, 
                        Value=Enumerations.AppointmentValueOptions.Urgent, 
                        Color= new SolidColorBrush(Colors.Blue)
                    }
            });

            (sender as AppointmentProvider)._OptionsProvider.AppointmentList.Add(new Appointment()
            {
                ID = 3,
                Desc = "Blah 2",
                StartDate = DateTime.Now.Date,
                EndDate = DateTime.Now.Date,
                StartTime = new DateTime(2009, 10, 15, 10, 30,0,0),
                EndTime = DateTime.Now,
                Value = new AppointmentValue()
                {
                    ID = 1,
                    Value = Enumerations.AppointmentValueOptions.Urgent,
                    Color = new SolidColorBrush(Colors.Red)
                }
            });

            Appointments = (sender as AppointmentProvider)._OptionsProvider.AppointmentList;
Once this is done you should be able to see the new apointments that you have created in the Calendar.
Oct 19, 2009 at 8:14 PM
Edited Oct 19, 2009 at 8:25 PM

MOVED to new thread.