예제 #1
0
 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;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 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);
 }
예제 #7
0
 public void HideFromHomePage(UiNode node)
 {
     OnHideFromHomePage?.Invoke(node);
 }