private string GenerateName(UiNode uiNode) { //auto naming List<UiNode> nodes = GetUINodesForPanel(uiNode.PanelId); List<string> names = nodes.Select(x => x.Settings["Name"].Value).ToList(); for (int i = 1; i <= names.Count + 1; i++) { if (!names.Contains($"{uiNode.DefaultName} {i}")) return $"{uiNode.DefaultName} {i}"; } return null; }
private string GenerateName(UiNode uiNode) { //auto naming List <UiNode> nodes = GetUINodesForPanel(uiNode.PanelId); List <string> names = nodes.Select(x => x.Settings["Name"].Value).ToList(); for (int i = 1; i <= names.Count + 1; i++) { if (!names.Contains($"{uiNode.DefaultName} {i}")) { return($"{uiNode.DefaultName} {i}"); } } return(null); }
private void OnNewNode(Node node) { if (!(node is UiNode)) { return; } UiNode n = (UiNode)node; n.OnAddToUiEngine(this); if (string.IsNullOrEmpty(n.Settings["Name"].Value)) { n.Settings["Name"].Value = GenerateName(n); } OnNewUiNode?.Invoke(n); engine.UpdateNodeInEditor(n); //engine.UpdateNodeOnDashboard(n); engine.UpdateNodeInDb(n); }
public void HideFromHomePage(UiNode node) { OnHideFromHomePage?.Invoke(node); }
private static void OnUiNodeUpdated(UiNode uinode) { hub.Clients.Group(uinode.PanelId).OnUiNodeUpdated(uinode); if (uinode.Settings["ShowOnHomePage"].Value == "true") hub.Clients.Group(MAIN_PAGE_ID).OnUiNodeUpdated(uinode); }
private static void OnHideFromHomePage(UiNode uinode) { hub.Clients.Group(MAIN_PAGE_ID).OnHideFromHomePage(uinode); }