Print Page | Close Window

Removing all resources

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=4125
Printed Date: 22 November 2024 at 4:26am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Removing all resources
Posted By: WaaZ
Subject: Removing all resources
Date Posted: 03 May 2006 at 12:09pm

Hi,

I have somewhere in my code that i need to erase every thing from the calendar. It was working with the previous version 9.8.2 and also 10.1.1 with

Quote

CalendarControl.DataProvider.RemoveAllEvents()

Until i have to remove the resources also.. and I used:

Quote

CalendarControl.MultipleResources.RemoveAll()

What happen is that the Dataprovider is then set to NULL after i execute this line... Which is wrong since there is no use to do such a thing as far as I see. This may be the case because you set the MultipleResources[counter].SetProvider(null) maybe or something similar...




Replies:
Posted By: sserge
Date Posted: 04 May 2006 at 8:20am

Yes, that's true. And what is the problem?

Let me add some notes:

1. Important.

   Do not modify CalendarControl.MultipleResources collection directly - use SetMultipleResources method.

   See points 3, 4 for reasons.
 
Example:
  
Dim arRes as new CalendarResources
     <fill new resources configuration>
     <use CalendarControl.MultipleResources if need>
  CalendarControl.SetMultipleResources arRes

2. Multiresources is not a separate feature, this is a significant part of CalendarControl kernel.

   CalendarControl.SetDataProvider sets a single resource with empty schedules ID collection and creates a data provider for it.     

   CalendarControl.DataProvider is the same as CalendarControl.MultipleResources[0].DataProvider 

   So far, a DataProvider lives in a Resource. That means that each resource can have a separate data provider -- other file or of any other type (DB, MAPI, CUSTOM).

3. CalendarView-s also have MultipleResources and SetMultipleResources members.

   This can be used to have main resources/schedules configuration in the CalendarControl, and to set a particular configuration to each view. If MultipleResources for a view is not set - CalendarControl.MultipleResources are used by a view by default.

    CalendarControl.SetMultipleResources resets view's MultipleResources.

4. CalendarReminders manager works using CalendarControl.MultipleResources. When you call CalendarControl.SetMultipleResources - reminders manager is restarted with the new configuration.

--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net