Example #1
0
 public void AddWorkspace(Workspace workspace, KinectClient client)
 {
     StateObject state = clientStateObjectDictionary[client];
     if (state == null)
     {
         state = stateObjectClientDictionary.Keys.First();
     }
     WorkspaceMessage message = new WorkspaceMessage()
     {
         ID = workspace.ID,
         Name = workspace.Name,
         Vertices = workspace.Vertices.ToArray()
     };
     SerializeAndSendMessage(message, state.WorkSocket);
 }
        private void ProcessWorkspaceMessage(object obj)
        {
            WorkspaceMessage msg = (WorkspaceMessage) obj;
            Workspace workspace = WorkspaceProcessor.ProcessWorkspace(
                new Workspace() {Vertices = new ObservableCollection<Point>(msg.Vertices)});
            WorkspaceMessage updatedMessage = new WorkspaceMessage()
            {
                ID = msg.ID,
                Name = msg.Name,
                VertexDepths = workspace.VertexDepths,
                Vertices3D = workspace.Vertices3D.ToArray(),
                Vertices = workspace.Vertices.ToArray(),
            };

            WorkspaceMessageArrived(updatedMessage);
        }