←Select platform

CopyTo Method

Summary

Copies the items of the collection to a LiveStreamControl array, starting at the specified array index.

Syntax
C#
C++/CLI
public void CopyTo( 
   LiveStreamControl[] array, 
   int arrayIndex 
) 
public:  
   void CopyTo( 
      array<LiveStreamControl^>^ array, 
      Int32 arrayIndex 
   ) 

Parameters

array

The one-dimensional, zero-based array that is the destination of the items to be copied from the collection.

arrayIndex

The zero-based index in the destination array at which copying begins.

Exceptions

The following exceptions can be thrown:

Remarks

Copies the items of the collection to a LiveStreamControl array, starting at the specified array index.

Example
C#
using Leadtools; 
using Leadtools.MediaStreaming; 
 
 
 
public Server _server = null; 
public bool _result = false; 
public void LiveStreamControlsCopyToExample() 
{ 
   try 
   { 
      // create an instance of the server object 
      _server = new Leadtools.MediaStreaming.Server(); 
      string strPath = "Live/Stream1"; // live stream's path 
      LiveStreams Streams = _server.GetLiveStreams(); 
      LiveStream stream = Streams.CreateLiveStream(); 
      stream.Path = strPath; 
      stream.UseDeviceEncoding = false; 
 
      // select video device 
      stream.VideoDevices.Selection = 3; 
      // select audio device 
      stream.AudioDevices.Selection = 0; 
 
      Streams.AddLiveStream(stream); 
      _server.SetLiveStreams(Streams); 
 
      // retrieve a copy of the Live Stream Controls 
      LiveStreamControls StreamControls = _server.GetLiveStreamControls(); 
 
      // allocate a new array for the copied Live Stream Controls 
      LiveStreamControl[] copiedStreams = new LiveStreamControl[Streams.Count]; 
 
      // copy them 
      StreamControls.CopyTo(copiedStreams, 0); 
 
      // set the result to what we expect 
      _result = (copiedStreams.Length == StreamControls.Count); 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.MediaStreaming Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.