private SocieteView ToView(Societe societe) { var cnxView = new ConnectionView { ServerName = societe.ServerName, User = societe.User, DatabaseName = societe.DatabaseName, Password = societe.Password, Type = societe.Type }; return(new SocieteView { Activite = societe.Activite, Adresse = societe.Adresse, CodeBureau = societe.CodeBureau, CodePostal = societe.CodePostal, Id = societe.Id, MatriculFiscal = societe.MatriculFiscal, MatriculCle = societe.MatriculCle, MatriculCodeTva = societe.MatriculCodeTva, MatriculCategorie = societe.MatriculCategorie, MatriculEtablissement = societe.MatriculEtablissement, NumeroEmployeur = societe.NumeroEmployeur, Pays = societe.Pays, RaisonSocial = societe.RaisonSocial, Ville = societe.Ville, CleEmployeur = societe.CleEmployeur, ConnectionView = cnxView, CnssTypeMatricule = societe.CnssTypeMatricule }); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { //pass the same connection in to update the settings. ConnectionView ConnectionView = new ConnectionView(); ConnectionView.DataContext = new ConnectionViewModel(connection); ConnectionView.Show(); }
public void InstantiateModel(OBJFile model) { nodes = new List <TestNode>(); foreach (Vector3 v in model.vertexPositions) { GameObject vertex = Instantiate(vertexPrefab, v, Quaternion.identity); VertexView ver = vertex.GetComponent <VertexView>(); TestNode testNode = new TestNode(ver); nodes.Add(testNode); } foreach (Face tri in model.faces) { GameObject connection1 = Instantiate(sidePrefab, Vector3.zero, Quaternion.identity); GameObject connection2 = Instantiate(sidePrefab, Vector3.zero, Quaternion.identity); GameObject connection3 = Instantiate(sidePrefab, Vector3.zero, Quaternion.identity); ConnectionView conn1 = connection1.GetComponent <ConnectionView>(); ConnectionView conn2 = connection2.GetComponent <ConnectionView>(); ConnectionView conn3 = connection3.GetComponent <ConnectionView>(); conn1.SetConection(tri.vertices[0].position, tri.vertices[1].position); conn2.SetConection(tri.vertices[0].position, tri.vertices[2].position); conn3.SetConection(tri.vertices[1].position, tri.vertices[2].position); } graph = new TestGraph(nodes, ConnectionView.conections); graph.GenerateGraphConections(); }
// Called when we press the left mouse button private void WindowMouseStartDownLeftButton(MouseEventArgs e) { bool hitFound = false; foreach (KeyValuePair <uint, NodeView> m in nodevs) { if (hitFound) { m.Value.Selected = false; continue; } hitFound = m.Value.HitTest(e.X, e.Y); if (!hitFound) { m.Value.Selected = false; continue; } Debug.Assert(hitFound); SelectedNode = m.Value; m.Value.Selected = true; if (m.Value.HitTestStdout(e.X, e.Y)) { // We've hit stdout. Add a pipe. NewConnection = new ConnectionView(); NewConnection.From = m.Value; NewConnection.FromPort = NodePort.NodePortOut; NewConnection.State = ConnectionState.Dragging; NewConnection.DraggingX = e.X; NewConnection.DraggingY = e.Y; s = EditorState.AddingPipe; } else if (m.Value.HitTestStderr(e.X, e.Y)) { NewConnection = new ConnectionView(); NewConnection.From = m.Value; NewConnection.FromPort = NodePort.NodePortErr; NewConnection.State = ConnectionState.Dragging; NewConnection.DraggingX = e.X; NewConnection.DraggingY = e.Y; s = EditorState.AddingPipe; } else { MovingX = m.Value.X - e.X; MovingY = m.Value.Y - e.Y; s = EditorState.MovingNode; } } }
public void ShowConnection(object sender, EventArgs e) { this.StopLoading(); this.EnableCommand(true, this._service, Guids.COMMAND_HOME_ID); this.EnableCommand(true, this._service, Guids.COMMAND_FILTERS_ID); this.EnableCommand(true, this._service, Guids.COMMAND_ADVANCED_SEARCH_ID); this.EnableCommand(true, this._service, Guids.COMMAND_REFRESH_ID); this.EnableCommand(true, this._service, Guids.COMMAND_CONNECTION_ID); this._connectionView = new ConnectionView(this, this._userService, this._basicAuthenticationService); this._historyNavigator.AddView(this._connectionView); SelectedView = this._connectionView; }
private void ConfigureViewService() { LazyLoader.Set <ConnectionView>(() => { ConnectionView view = null; PluginContext.Host.Invoke(() => view = new ConnectionView()); return(view); }); ViewService.Configure(e => { e.Bind <AddUserControl, AddUserViewModel>() .OnClosing(() => LazyLoader.Get <ConnectionView>().As <ConnectionViewModel>().Refresh()); e.Bind <ChangePasswordView, ChangePasswordViewModel>(); e.Bind <UpdateUserControl, UpdateUserViewModel>() .OnShow(vm => vm.Refresh()); }); }
public static void Show() { main = UIAssistant.main.panels.Find(x => x.name == "Connection").GetComponent <ConnectionView>(); Animation anim = main.GetComponent <Animation>(); anim.Play(main.maximizingClipName); anim.enabled = true; anim[main.maximizingClipName].time = anim[main.maximizingClipName].length; anim.Sample(); anim.enabled = false; UIAssistant.main.SetPanelVisible(main.name, true); UIAssistant.main.FreezPanel(main.name); main.connectionView.SetActive(true); main.messageView.SetActive(false); main.isMinimized = false; }
private void Deserialize() { if (OpenFilename.Length > 0) { // Add models FileStream fs = File.Open( OpenFilename, FileMode.Open ); BinaryFormatter fmt = new BinaryFormatter(); nodems = (Dictionary <uint, NodeModel>)fmt.Deserialize(fs); // Create the views (nodes and links) based on the nodems. foreach (KeyValuePair <uint, NodeModel> m in nodems) { NodeView v = new NodeView(); v.Selected = false; v.Model = m.Value; nodevs.Add(m.Key, v); } foreach (KeyValuePair <uint, NodeModel> p in nodems) { NodeModel m = p.Value; if (m.GetOutNodeID() > 0) { ConnectionView N = new ConnectionView(); N.From = nodevs[m.ID]; N.FromPort = NodePort.NodePortOut; N.To = nodevs[m.GetOutNodeID()]; links.Add(N); } if (m.GetErrNodeID() > 0) { ConnectionView N = new ConnectionView(); N.From = nodevs[m.ID]; N.FromPort = NodePort.NodePortErr; N.To = nodevs[m.GetErrNodeID()]; links.Add(N); } } fs.Close(); } }
public void NodesAdded(IEnumerable <TreeNode> Nodes, TreeNode Parent) { XmppAccountNode XmppAccountNode = this.Account; if (XmppAccountNode is null) { return; } ConnectionView View = XmppAccountNode.View; if (View is null) { return; } foreach (TreeNode Node in Nodes) { View.NodeAdded(Parent, Node); } }
public SimulatorPlugin(ConnectionView generalView, IIncidentEditView incidentEditView) { this.generalView = generalView; this.incidentEditView = incidentEditView; }
private void WindowMouseUp(object sender, MouseEventArgs e) { switch (s) { case EditorState.MovingNode: { s = EditorState.Start; SelectedNode = null; break; } case EditorState.AddingPipe: { s = EditorState.Start; bool hitFound = false; foreach (KeyValuePair <uint, NodeView> v in nodevs) { hitFound = v.Value.HitTest(e.X, e.Y); if (!hitFound) { continue; } // Remove any old connections that start from the // start node, to be consistent with the model. links.RemoveWhere( c => c.From == NewConnection.From && c.FromPort == NewConnection.FromPort ); { // A NODE MAY HAVE ONLY 1 INCOMING CONNECTION // (In the future we might change this limitation) // Remove connections that end at the target node // so that only one input is allowed at a node. links.RemoveWhere( c => c.To == v.Value ); // Reset the Out/Err node IDs that linked to this node... foreach (NodeModel m in nodems.Values) { if (m.GetOutNodeID() == v.Value.Model.ID) { m.SetOutNode(null); } if (m.GetErrNodeID() == v.Value.Model.ID) { m.SetErrNode(null); } } } if (NewConnection.FromPort == NodePort.NodePortOut) { NewConnection.From.Model.SetOutNode(null); } if (NewConnection.FromPort == NodePort.NodePortErr) { NewConnection.From.Model.SetErrNode(null); } NewConnection.To = v.Value; NewConnection.State = ConnectionState.Start; // If NewConnection.To equals NewConnection.From // we inform the user that this is not allowed. if (NewConnection.To == NewConnection.From) { Console.WriteLine( "A node must refer to a different node"); break; } if (NewConnection.FromPort == NodePort.NodePortOut) { NewConnection.From.Model.SetOutNode(v.Value.Model); } if (NewConnection.FromPort == NodePort.NodePortErr) { NewConnection.From.Model.SetErrNode(v.Value.Model); } links.Add(NewConnection); break; } NewConnection = null; // Delete the reference to NewConnection. SelectedNode = null; break; } case EditorState.ContextMenu: { MouseUp -= CMenu.WindowMouseUp; s = EditorState.Start; break; } } UpdateView(); }
public void DisposeConnectionView() { this._connectionView = null; }
public static void OnClickRemoveConnection(ConnectionView connection) { instance.connections.Remove(connection); }
void Awake() { main = this; cpanel = GetComponent <CPanel>(); }
public MoBaseView() { Connection = new ConnectionView(this); }