IDocumentBase.LoadFromStream

Fore Syntax

LoadFromStream(Stream: IIOStream);

Fore.NET Syntax

LoadFromStream(Stream: System.IO.Stream);

Parameters

Stream. The stream from which the file is loaded into the document.

Description

The LoadFromStream method loads stream contents passed by the Stream parameter into the document.

Fore Example

Executing the example requires a form with a button and the FlashBox component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    CrInfo: IMetabaseObjectCreateInfo;
    Doc: IDocument;
    MemStr: IMemoryStream;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DOCUMENT;
    CrInfo.Id := "Flash_Document";
    CrInfo.Name := "Flash_Document";
    CrInfo.Parent := MB.Root;
    MObj := MB.CreateObject(CrInfo).Edit;
    Doc := MObj As IDocument;
    MemStr := New MemoryStream.Create;
    FlashBox1.SaveToStream(MemStr);
    Doc.LoadFromStream(MemStr);
    Dispose MemStr;
    MObj.Save;
End Sub Button1OnClick;

After executing the example on clicking the button the Document object with the Flash_Document identifier is created in repository, in which the flash object, loaded in FlashBox1, is saved.

See also:

IDocumentBase