Пример #1
0
        void addFolderClick(object sender, RoutedEventArgs e)
        {
            var inputbox = new Dialogs.InputBox("请输入文件夹名称", "添加文件夹");

            inputbox.Owner = MainWindow.Instance;
            if (inputbox.ShowDialog() == true && !inputbox.Value.IsBlank())
            {
                SunRizServer.ControlWindowFolder folder = new SunRizServer.ControlWindowFolder();
                folder.ParentId      = _folderId;
                folder.Name          = inputbox.Value.Trim();
                folder.ControlUnitId = _controlUnitId;

                MainWindow.Instance.Cursor = Cursors.Hand;
                Helper.Remote.Invoke <int>("UpdateControlWindowFolder", (ret, err) =>
                {
                    MainWindow.Instance.Cursor = null;
                    if (err != null)
                    {
                        MessageBox.Show(MainWindow.Instance, err);
                    }
                    else
                    {
                        folder.id = ret;
                        folder.ChangedProperties.Clear();

                        //添加node对象
                        var newNode = new ControlWindowContainerNode(_controlUnitId, folder);
                        this.Nodes.Insert(0, newNode);
                        this.IsExpanded = true;
                    }
                }, folder);
            }
        }
Пример #2
0
        /// <summary>
        /// 异步加载子节点
        /// </summary>
        protected override void LoadChildrenAsync()
        {
            base.LoadChildrenAsync();

            Helper.Remote.Invoke <SunRizServer.ControlWindowFolder[]>("GetControlWindowFolders", (ret, err) =>
            {
                if (err != null)
                {
                    MessageBox.Show(MainWindow.Instance, err);
                }
                else
                {
                    this.Nodes.Clear();
                    //加载子节点
                    foreach (var folder in ret)
                    {
                        var newNode = new ControlWindowContainerNode(_controlUnitId, folder);
                        this.Nodes.Add(newNode);
                    }

                    //加载监控画面
                    loadWindows();
                }
            }, _controlUnitId, _folderId);
        }
Пример #3
0
        /// <summary>
        /// 初始化子节点
        /// </summary>
        public override void InitChildren()
        {
            base.InitChildren();

            var authorizeNode = new SolutionNode()
            {
                Text = "授权管理",
                Icon = "/Images/solution/key.png"
            };

            this.Nodes.Add(authorizeNode);

            var userNode = new SolutionNode()
            {
                Text = "用户权限管理",
                Icon = "/Images/solution/users.png",
                DoublicClickHandler = (s, e) => {
                    MainWindow.Instance.ShowUserMgrWindow();
                },
            };

            this.Nodes.Add(userNode);

            var alarmNode = new SolutionNode()
            {
                Text = "报警查询",
                Icon = "/Images/solution/alarm.png",
                DoublicClickHandler = (s, e) => {
                    MainWindow.Instance.ShowAlarmWindow();
                },
            };

            this.Nodes.Add(alarmNode);

            var historyNode = new SolutionNode()
            {
                Text = "历史查询",
                Icon = "/Images/solution/history.png",
                DoublicClickHandler = (s, e) => {
                    MainWindow.Instance.ShowHistoryWindow();
                },
            };

            this.Nodes.Add(historyNode);


            var logNode = new SolutionNode()
            {
                Text = "系统日志查询",
                Icon = "/Images/solution/log.png",
                DoublicClickHandler = (s, e) => {
                    MainWindow.Instance.ShowSysLogWindow();
                },
            };

            this.Nodes.Add(logNode);

            var setttingNode = new SystemSettingNode()
            {
                Text = "系统配置",
                Icon = "/Images/solution/setting.png",
            };

            this.Nodes.Add(setttingNode);

            var drviersNode = new DriversNode()
            {
                Text = "通讯网关"
            };

            this.Nodes.Add(drviersNode);

            var videoWindowNode = new ControlWindowContainerNode(0, null)
            {
                Text = "监视画面"
            };

            this.Nodes.Add(videoWindowNode);

            var controlUnitNode = new ControlUnitParentNode();

            this.Nodes.Add(controlUnitNode);
        }