Ticket Q106778
Visible to All Users

Save Event to a Stream - Copy Event between Storages

created 17 years ago

Hi
I would like to an Event over the network to another machine and was hoping that I could use the SaveToStream function to save an individual event and its custom fields to a stream, Preferably a stringstream.
Any Ideas would be great.
Thanks
Alan

Comments (3)
Serge (DevExpress Support) 17 years ago

    Hi Alan,
    By design, the ExpressScheduler doesn't provide methods to store a single Event in a stream. As a way out, I recommend that you try using the following approach:

    1. Set up an extra unbound TcxSchedulerStorage (let's name it TemporaryStorage), which we will use to copy the necessary Events. The Storage should have the same set of custom fields, as the main Storage of your Scheduler.
    2. Use the following code to copy an Event from the main Storage to the TemporaryStorage:
    Delphi
    with TemporaryStorage do begin createEvent.Assign(<ASourceEvent>); PostEvents; end;
    1. Call the SaveToStream method of the TemporaryStorage, to store its data in a stream.
    2. Call the LoadFromStream method of the TemporaryStorage in the other copy of your application, to load its data from the stream.
    3. Use the following code to copy the Event from the TemporaryStorage to the main Storage in the other copy of your application:
    Delphi
    with DestinationStorage do begin createEvent.Assign(TemporaryStorage.Events[0]); PostEvents; end;

    Will this solution meet your requirements?
    Thanks,
    Serge
    P.S. By the way, you're using an older build of our components. Please visit our version info page at http://www.devexpress.com/Support/Versions.xml, to learn about the most recent versions of our products, and obtain instructions on how to update them.

      Thanks Serge
      What a great Idea, I would never have thought of this :¬).
      I will test this over the next few days and let you know.
      Alan

      Serge (DevExpress Support) 17 years ago

        Ok, Alan, I'm looking forward to hearing from you :)
        Regards,
        Serge

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.