バージョン

LoadFromBinary(Stream) メソッド

バイナリデータを含むストリームから保存された情報を読み込みします。
シンタックス
'宣言
 
Public Overloads Sub LoadFromBinary( _
   ByVal stream As Stream _
) 
public void LoadFromBinary( 
   Stream stream
)

パラメータ

stream
シリアル化された UltraDataSource 情報を含むストリーム。
解説

LoadFromBinary メソッドは、ultraDataSource の構造およびデータを永続化するために SaveAsBinary(Stream) メソッドと組み合わせて使用します。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDataSource


    Dim memoryStream As System.IO.MemoryStream = Nothing

    Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles saveButton.Click
        Me.memoryStream = New System.IO.MemoryStream()

        ' Save data to a stream. Pass in true for the includeData parameter
        ' to save data and not just the structure.
        Me.ultraDataSource1.SaveAsBinary(Me.memoryStream, True)
    End Sub

    Private Sub ClearDataSource_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles clearDataSource.Click
        Me.UltraDataSource1.Rows.Clear()
    End Sub

    Private Sub LoadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loadButton.Click
        ' Make sure the Position is set to a location where the saved data
        ' begins.
        Me.MemoryStream.Position = 0

        ' Retrieve previously saved data from the stream. Pass in true for 
        ' the includeData parameter to save data and not just the structure.
        Me.UltraDataSource1.LoadFromBinary(Me.MemoryStream, True)
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDataSource;
using System.Diagnostics;


		System.IO.MemoryStream memoryStream = null;

		private void saveButton_Click(object sender, System.EventArgs e)
		{
			this.memoryStream = new System.IO.MemoryStream( );

			// Save data to a stream. Pass in true for the includeData parameter
			// to save data and not just the structure.
			this.ultraDataSource1.SaveAsBinary( this.memoryStream, true );
		}

		private void clearDataSource_Click(object sender, System.EventArgs e)
		{
            this.ultraDataSource1.Rows.Clear( );		
		}

		private void loadButton_Click(object sender, System.EventArgs e)
		{
			// Make sure the Position is set to a location where the saved data
			// begins.
            this.memoryStream.Position = 0;			

			// Retrieve previously saved data from the stream. Pass in true for 
			// the includeData parameter to save data and not just the structure.
			this.ultraDataSource1.LoadFromBinary( this.memoryStream, true );
		}
参照