public MainWindowForm() { //This tries to read the settings from "settings.bin", if it failes the settings stay at default values. try { IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); Stream stream = new FileStream("settings.bin", FileMode.Open, FileAccess.Read); oSettings = (KinectSettings)formatter.Deserialize(stream); stream.Close(); } catch (Exception) { } oServer = new KinectServer(oSettings); oServer.eSocketListChanged += new SocketListChangedHandler(UpdateListView); oTransferServer = new TransferServer(); oTransferServer.lVertices = lAllVertices; oTransferServer.lNormals = lAllNormals; oTransferServer.lUVs = lAllUVs; oTransferServer.lIndices = lAllIndices; oTransferServer.lColors = lAllColors; InitializeComponent(); }
public void SendSettings(KinectSettings settings) { List<byte> lData = settings.ToByteList(); byte[] bTemp = BitConverter.GetBytes(lData.Count); lData.InsertRange(0, bTemp); lData.Insert(0, 2); if (SocketConnected()) oSocket.Send(lData.ToArray()); }
public void SendSettings(KinectSettings settings) { List <byte> lData = settings.ToByteList(); byte[] bTemp = BitConverter.GetBytes(lData.Count); lData.InsertRange(0, bTemp); lData.Insert(0, 2); if (SocketConnected()) { oSocket.Send(lData.ToArray()); } }
public MainWindowForm() { //This tries to read the settings from "settings.bin", if it failes the settings stay at default values. try { IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); Stream stream = new FileStream("settings.bin", FileMode.Open, FileAccess.Read); oSettings = (KinectSettings)formatter.Deserialize(stream); stream.Close(); } catch(Exception) { } oServer = new KinectServer(oSettings); oServer.eSocketListChanged += new SocketListChangedHandler(UpdateListView); InitializeComponent(); }
public KinectServer(KinectSettings settings) { this.oSettings = settings; }