private void AddBottomRow()
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node("");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell         cell   = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.ButtonItem button = new DevComponents.DotNetBar.ButtonItem();
                button.Text        = "Delete";
                button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                button.Image       = imageList1.Images[IMAGE_DELETE];
                superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Delete", "", "Delete this entity - it will be totally deleted from the model and also from this inheritance hierarchy.", imageListLarge.Images[IMAGE_DELETE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
                cell.HostedItem = button;
                button.Click   += new EventHandler(DeleteButton_Click);
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);

            //node = new DevComponents.AdvTree.Node("");

            //for (int i = 0; i < MappedEntities.Count; i++)
            //{
            //    DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
            //    DevComponents.DotNetBar.ButtonItem button = new DevComponents.DotNetBar.ButtonItem();
            //    button.Text = "Remove";
            //    button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
            //    button.Image = imageList1.Images[IMAGE_REMOVE];
            //    superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Remove", "", "Remove this entity from this inheritance hierarchy.", imageListLarge.Images[IMAGE_REMOVE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
            //    cell.HostedItem = button;
            //    button.Click += new EventHandler(RemoveButton_Click);
            //    node.Cells.Add(cell);
            //}
            //advTree1.Nodes.Add(node);
        }
        private void AddTopRow()
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node("Name");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.Controls.TextBoxX tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                tb.Text            = MappedEntities[i].Name;
                cell.HostedControl = tb;
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
            node = new DevComponents.AdvTree.Node("Is Base?");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell           cell     = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.CheckBoxItem checkbox = new DevComponents.DotNetBar.CheckBoxItem();
                cell.HostedItem          = checkbox;
                checkbox.CheckedChanged += new DevComponents.DotNetBar.CheckBoxChangeEventHandler(IsBaseCheckbox_CheckedChanged);
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
            node = new DevComponents.AdvTree.Node("Discriminator Value");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.Controls.TextBoxX tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                cell.HostedControl = tb;
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
        }
Beispiel #3
0
        //添加树图节点列
        private DevComponents.AdvTree.Cell CreateAdvTreeCell(DevComponents.AdvTree.Node aNode, string strText, Image pImage)
        {
            DevComponents.AdvTree.Cell aCell = new DevComponents.AdvTree.Cell(strText);
            aCell.Images.Image = pImage;
            aNode.Cells.Add(aCell);

            return(aCell);
        }
Beispiel #4
0
        //初始化二维图层列表
        private void InitLst()
        {
            this.LayerTree.Nodes.Clear();

            if (m_pMap == null)
            {
                return;
            }

            for (int i = 0; i < m_pMap.LayerCount; i++)
            {
                ILayer pLyr = m_pMap.get_Layer(i) as ILayer;
                //创建树节点
                DevComponents.AdvTree.Node rootnode = new DevComponents.AdvTree.Node();
                rootnode.Text  = pLyr.Name;
                rootnode.Name  = pLyr.Name;
                rootnode.Image = this.ImageList.Images["Layer"];
                rootnode.Tag   = pLyr;//直接用tag存储图层
                //创建选择框节点
                DevComponents.AdvTree.Cell rootcell = new DevComponents.AdvTree.Cell();
                rootcell.CheckBoxVisible = true;
                rootcell.Checked         = false;
                rootnode.Cells.Add(rootcell);
                rootnode.Expanded = true;
                LayerTree.Nodes.Add(rootnode);
                //如果节点是图层组,则展开,添加子节点
                if (m_pMap.get_Layer(i) is IGroupLayer)
                {
                    rootnode.Image = this.ImageList.Images["DataDIR"];
                    ICompositeLayer comlayer = pLyr as ICompositeLayer;
                    //遍历图层组中的图层
                    for (int j = 0; j < comlayer.Count; j++)
                    {
                        ILayer pTmpLayer = comlayer.get_Layer(j);
                        DevComponents.AdvTree.Node aNode = new DevComponents.AdvTree.Node();
                        aNode.Text  = pTmpLayer.Name;
                        aNode.Name  = pTmpLayer.Name;
                        aNode.Image = this.ImageList.Images["Layer"];
                        aNode.Tag   = pTmpLayer;//直接用tag存储图层
                        DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                        cell.CheckBoxVisible = true;
                        cell.Checked         = false;
                        aNode.Cells.Add(cell);
                        aNode.Expanded = true;
                        rootnode.Nodes.Add(aNode);
                    }
                }
            }
        }
        private void AddRow(ArchAngel.Providers.EntityModel.Model.DatabaseLayer.IColumn column)
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node(column.Name);

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                cell.CheckBoxAlignment  = DevComponents.AdvTree.eCellPartAlignment.Default;
                cell.CheckBoxVisible    = true;
                cell.CheckBoxStyle      = DevComponents.DotNetBar.eCheckBoxStyle.CheckBox;
                cell.CheckBoxThreeState = false;
                cell.Checked            = MappedEntities[i].ConcreteProperties.Count(p => p.MappedColumn() == column) > 0;
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
        }
Beispiel #6
0
 private void GetValue()
 {
     if (m_OriginObject is DevComponents.AdvTree.Cell)
     {
         DevComponents.AdvTree.Cell cell = m_OriginObject as DevComponents.AdvTree.Cell;
         integerInput.Value = (int)cell.Tag;
         cell.Tag           = cell.Text.Split('-')[0];
     }
     else if (m_OriginObject is System.Windows.Forms.ListViewItem.ListViewSubItem)
     {
         System.Windows.Forms.ListViewItem.ListViewSubItem subItem =
             m_OriginObject as System.Windows.Forms.ListViewItem.ListViewSubItem;
         integerInput.Value = (int)subItem.Tag;
         subItem.Tag        = subItem.Text.Split('-')[0];
     }
 }
Beispiel #7
0
 private void SetValue()
 {
     if (m_OriginObject is DevComponents.AdvTree.Cell)
     {
         DevComponents.AdvTree.Cell cell = m_OriginObject as DevComponents.AdvTree.Cell;
         cell.Text          = cell.Tag.ToString() + "-" + integerInput.Value.ToString();
         cell.Tag           = integerInput.Value;
         cell.HostedControl = null;
     }
     else if (m_OriginObject is System.Windows.Forms.ListViewItem.ListViewSubItem)
     {
         System.Windows.Forms.ListViewItem.ListViewSubItem subItem =
             m_OriginObject as System.Windows.Forms.ListViewItem.ListViewSubItem;
         subItem.Text = subItem.Tag.ToString() + "-" + integerInput.Value.ToString();
         subItem.Tag  = integerInput.Value;
     }
 }
        //删除
        private void toolStripMenuItem_Del_Click(object sender, EventArgs e)
        {
            if (node != null)
            {
                DevComponents.AdvTree.Cell cell  = node.Cells[1];
                DevComponents.AdvTree.Cell cell1 = node.Cells[2];
                string SERVICETYPE = cell1.Tag.ToString();
                var    commands    = from c in ExecCommandList.LC where c.STCD == node.Tag.ToString() && c.CommandID == cell.Tag.ToString() && c.SERVICETYPE == SERVICETYPE select c;
                if (commands.Count() > 0)
                {
                    //删除服务器端列表中的召测命令     --cmd|tcp|0012345679|02
                    if (TcpControl.Connected)
                    {
                        TcpControl.SendUItoServiceCommand("--cmd|" + commands.First().SERVICETYPE + "|" + commands.First().STCD + "|" + commands.First().CommandID);
                    }
                    //删除本地列表和控件中的命令
                    DevComponents.AdvTree.Node Nd = null;
                    foreach (var item in advTree1.Nodes)
                    {
                        if (item.Equals(node))
                        {
                            Nd = item as DevComponents.AdvTree.Node;
                            break;
                        }
                    }
                    if (Nd != null)
                    {
                        advTree1.Nodes.Remove(Nd);
                    }

                    lock (ExecCommandList.LC)
                    {
                        List <Command> cmds = new List <Command>(commands);
                        foreach (var item in cmds)
                        {
                            ExecCommandList.LC.Remove(item);
                        }
                    }
                }
                node = null;
            }
        }
Beispiel #9
0
        //创建树图节点
        private DevComponents.AdvTree.Node CreateAdvTreeNode(DevComponents.AdvTree.NodeCollection nodeCol, string strText, string strName, Image pImage, bool bExpand)
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node();
            node.Text  = strText;
            node.Image = pImage;
            if (strName != null)
            {
                node.Name = strName;
            }

            if (bExpand == true)
            {
                node.Expand();
            }
            //添加树图列节点
            DevComponents.AdvTree.Cell aCell = new DevComponents.AdvTree.Cell();
            aCell.Images.Image = null;
            node.Cells.Add(aCell);
            nodeCol.Add(node);
            return(node);
        }
Beispiel #10
0
        private void frmProjectUpdates_Load(object sender, EventArgs e)
        {
            // wBrowser.DocumentText = dtProjectUpdates.Rows[0]["DESCRIPTION_HTML"].ToString();
            foreach (DataRow drProjectUpdates in dtProjectUpdates.Rows)
            {
                DevComponents.AdvTree.Node nNode = new DevComponents.AdvTree.Node();
                nNode.Name       = drProjectUpdates["ID"].ToString();
                nNode.NodeClick += new EventHandler(Node_NodeClick);
                DevComponents.AdvTree.Cell cellSubject = new DevComponents.AdvTree.Cell();
                DevComponents.AdvTree.Cell cellDate    = new DevComponents.AdvTree.Cell();
                cellSubject.Text = drProjectUpdates["SUBJECT"].ToString();
                cellDate.Text    = GM.TimeAgo(Convert.ToDateTime(drProjectUpdates["CREATED_DATE"]));
                nNode.Text       = GM.ProperCase(drProjectUpdates["CREATED_BY"].ToString());
                nNode.Cells.Add(cellSubject);
                nNode.Cells.Add(cellDate);
                if (drProjectUpdates["ACTIVE"].ToString().ToUpper() == "N")
                {
                }
                else if (drProjectUpdates["ACTIVE"].ToString().ToUpper() == "Y")
                {
                    if (drProjectUpdates["REQUIRE_ACKNOWLEDGEMENT"].ToString() == "Y" && drProjectUpdates["USER_ACKNOWLEDGEMENT"].ToString().ToUpper().Contains("|" + GV.sEmployeeNo.ToUpper() + "~"))
                    {
                    }
                    else
                    {
                        if (drProjectUpdates["REQUIRE_ACKNOWLEDGEMENT"].ToString() != "Y" && drProjectUpdates["USER_READ"].ToString().ToUpper().Contains("|" + GV.sEmployeeNo.ToUpper() + "~"))
                        {
                        }
                        else
                        {
                            nNode.Style = BoldStyle;//Unread
                        }
                    }
                }

                lstNodes.Add(nNode);

                switch (drProjectUpdates["INSTRUCTION_TYPE"].ToString().ToUpper())
                {
                case "PR_INFO":
                    nodeProjectInfo.Nodes.Add(nNode);
                    break;

                case "PR_UPDATE":
                    nodeProjectUpdate.Nodes.Add(nNode);
                    break;

                case "PR_NOTIFICATION":
                    nodeProjectNotification.Nodes.Add(nNode);
                    break;

                case "CM_RELEASE":
                    nodeCMRelease.Nodes.Add(nNode);
                    break;

                case "CM_BUGFIX":
                    nodeCMBugFixes.Nodes.Add(nNode);
                    break;

                case "CM_NOTIFICATION":
                    nodeCMNotification.Nodes.Add(nNode);
                    break;
                }
            }
        }
		/// <summary>
		/// Initializes new instance of CellEditEventArgs class.
		/// </summary>
		/// <param name="cell">Reference to Cell this event is raised for.</param>
		/// <param name="action">Indicates the action that caused the event.</param>
		/// <param name="newText">Indicates new text of the cell if it applies to given event.</param>
		public CellEditEventArgs(Cell cell, eTreeAction action, string newText)
		{
			this.Action=action;
			this.Cell=cell;
			this.NewText=newText;
		}
Beispiel #12
0
        /// <summary>
        /// Fills the debug parameters grid with values.
        /// </summary>
        private void PopulateDebugParameters()
        {
            treeDebugParams.Nodes.Clear();
            ParametersToPass = new object[CurrentFunction.Parameters.Count];
            bool parametersMatch = false;
            List<object> parameterObjects = null;
            ValuesThatHaveBeenSet = new bool[CurrentFunction.Parameters.Count];

            if (FunctionRunner.CachedParameters.ContainsKey(CurrentFunction))
            {
                parameterObjects = FunctionRunner.CachedParameters[CurrentFunction];
                parametersMatch = CurrentFunction.Parameters.Count == parameterObjects.Count;

                if (parametersMatch)
                {
                    for (int i = 0; i < CurrentFunction.Parameters.Count; i++)
                    {
                        if (parameterObjects[i] == null || !CurrentFunction.Parameters[i].DataType.IsInstanceOfType(parameterObjects[i]))
                        {
                            parametersMatch = false;
                        }
                    }
                }
            }
            for (int i = 0; i < CurrentFunction.Parameters.Count; i++)
            {
                if (parametersMatch)
                {
                    ParametersToPass[i] = parameterObjects[i];
                    ValuesThatHaveBeenSet[i] = true;
                }
            }
            for (int i = 0; i < CurrentFunction.Parameters.Count; i++)
            {
                ParamInfo param = CurrentFunction.Parameters[i];
                string displayName = param.Name;
                //string displayName = string.Format("{2}. {0} ({1}):", param.Name, param.DataType, i + 1);
                string displayValue = "";
                DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node();
                node.Cells[0].StyleNormal = treeDebugParams.Styles["elementStyle1"];
                node.Tag = param;
                Control editControl = null;
                object existingParamObject = null;
                bool isBasicType = true;

                switch (param.DataType.Name.ToLower())
                {
                    case "bool":
                    case "boolean":
                        editControl = new DevComponents.DotNetBar.Controls.CheckBoxX();
                        ((DevComponents.DotNetBar.Controls.CheckBoxX)editControl).Checked = ValuesThatHaveBeenSet[i] ? (bool)ParametersToPass[i] : false;
                        ((DevComponents.DotNetBar.Controls.CheckBoxX)editControl).CheckedChangedEx += DebugParamChanged_CheckboxX;
                        break;
                    case "int":
                    case "int32":
                        editControl = new DevComponents.Editors.IntegerInput();
                        ((DevComponents.Editors.IntegerInput)editControl).Value = ValuesThatHaveBeenSet[i] ? (int)ParametersToPass[i] : 0;
                        ((DevComponents.Editors.IntegerInput)editControl).ValueChanged += DebugParamChanged_IntegerInput;
                        break;
                    case "double":
                        editControl = new DevComponents.Editors.DoubleInput();
                        ((DevComponents.Editors.DoubleInput)editControl).Value = ValuesThatHaveBeenSet[i] ? (double)ParametersToPass[i] : 0;
                        ((DevComponents.Editors.DoubleInput)editControl).ValueChanged += DebugParamChanged_DoubleInput;
                        break;
                    case "string":
                        editControl = new DevComponents.DotNetBar.Controls.TextBoxX();
                        editControl.Text = ValuesThatHaveBeenSet[i] ? (string)ParametersToPass[i] : "";
                        editControl.TextChanged += DebugParamChanged_TextBoxX;
                        break;
                    default:
                        //MessageBox.Show(string.Format("Parameter-type not handled yet: {0}.\n\nPlease contact [email protected]", param.DataType.Name), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //return;
                        isBasicType = false;
                        break;
                }
                if (isBasicType)
                {
                    node.Text = string.Format("{0} ({1})", param.Name, param.DataType);
                }
                //if (param.DataType.GetInterface("ArchAngel.Interfaces.IScriptBaseObject") != null)
                if (!isBasicType)
                {
                    if (ParametersToPass[i] != null)
                    {
                        displayValue = ProviderInfo.GetDisplayName(ParametersToPass[i]);
                    }
                    else
                    {
                        // Let's check whether another function has previously set a value for this kind of object...
                        foreach (List<object> paramList in FunctionRunner.CachedParameters.Values)
                        {
                            foreach (object existingParam in paramList)
                            {
                                if (param.DataType.IsInstanceOfType(existingParam))
                                {
                                    existingParamObject = existingParam;
                                    ValuesThatHaveBeenSet[i] = true;
                                    ParametersToPass[i] = existingParamObject;
                                    displayValue = ProviderInfo.GetDisplayName(existingParam);
                                }
                            }
                        }
                        if (existingParamObject == null)
                        {
                            //node.Cells[0].StyleNormal = treeDebugParams.Styles["elementStyleMissing"];
                            node.ImageIndex = 1;
                            displayValue = "Click to set";
                        }
                    }
                    //editControl = new DevComponents.DotNetBar.Controls.ComboTree();
                    editControl = new ButtonX();
                    editControl.Text = editControl.Text = ValuesThatHaveBeenSet[i] ? displayValue : "Click to set";
                    editControl.Text = string.Format("<u>{0}</u>", editControl.Text);
                    editControl.Tag = existingParamObject;
                    ((ButtonX)editControl).ColorTable = eButtonColor.Flat;
                    ((ButtonX)editControl).Style = eDotNetBarStyle.OfficeXP;
                    ((ButtonX)editControl).FocusCuesEnabled = false;
                    editControl.Cursor = Cursors.Hand;
                    editControl.Click += DebugParamChanged_ButtonX;

                    //string[] prevSelections = new string[] { "red", "blue", "green"};

                    //foreach (string prevSelection in prevSelections)
                    //{
                    //    DevComponents.AdvTree.Node prevSelNode = new DevComponents.AdvTree.Node();
                    //    prevSelNode.Text = prevSelection;
                    //    //((DevComponents.DotNetBar.Controls.ComboTree)editControl).Nodes.Add(prevSelNode);
                    //    //((ComboBox)editControl).Items.Add(prevSelection);
                    //    //((DevComponents.DotNetBar.Controls.ComboTree)editControl).Dock = DockStyle.Fill;
                    //    //((DevComponents.DotNetBar.Controls.ComboTree)editControl).SelectedIndex = 0;
                    //}
                    node.Text = displayName;
                    //node.he
                }
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                cell.HostedControl = editControl;
                cell.StyleNormal = treeDebugParams.Styles["elementStyle1"];
                node.Cells.Add(cell);
                treeDebugParams.Nodes.Add(node);
            }
            SetCachedParameters();
        }
Beispiel #13
0
        private DevComponents.AdvTree.Node AddTaskTreeNode(TaskInfoV3_1 item)
        {
            DevComponents.AdvTree.Node n = new DevComponents.AdvTree.Node(item.TaskId.ToString());
            DevComponents.AdvTree.Cell c = new DevComponents.AdvTree.Cell();
            //c.Images.Image = global::IVX.Live.MainForm.Properties.Resources.bkjpg;
            c.Images.ImageIndex = 0;

            c.Text = item.TaskName;
            uint   totalprogress   = 0;
            uint   totalstatus     = 0;
            string totalalaysetype = "";
            uint   totaltime       = 0;

            foreach (var s in item.StatusList)
            {
                if (s.AlgthmType != E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE)
                {
                    DevComponents.AdvTree.Node sn = new DevComponents.AdvTree.Node();
                    sn.Cells.Add(new DevComponents.AdvTree.Cell());
                    sn.Cells.Add(new DevComponents.AdvTree.Cell());

                    int progress = m_viewModel.CalcProgress(s.Status, (int)s.Progress, false);
                    DevComponents.DotNetBar.ProgressBarItem sprogressBarItem = new DevComponents.DotNetBar.ProgressBarItem();
                    sprogressBarItem.BackStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
                    sprogressBarItem.ChunkGradientAngle   = 0F;
                    sprogressBarItem.MenuVisibility       = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
                    sprogressBarItem.RecentlyUsed         = false;
                    sprogressBarItem.Maximum     = 1000;
                    sprogressBarItem.TextVisible = true;
                    sprogressBarItem.Value       = progress;
                    if (sprogressBarItem.Value < sprogressBarItem.Maximum)
                    {
                        sprogressBarItem.Text = (item.Order > 0 || s.Status == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED) ? "" : string.Format("剩余时间:{0}", TimeSpan.FromSeconds(s.LeftTime));
                    }
                    else
                    {
                        sprogressBarItem.Text = "";
                    }
                    DevComponents.AdvTree.Cell sc2 = new DevComponents.AdvTree.Cell();
                    sc2.HostedItem = sprogressBarItem;

                    sn.Cells.Add(sc2);
                    string status = DataModel.Constant.TaskStatusInfos.Single(it => it.Status == s.Status).Name;
                    if (s.Status == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FINISH)
                    {
                        status = "<font color=\"#5555ff\" >" + status + "</font>";
                    }
                    if (s.Status == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED)
                    {
                        status = "<font color=\"#ff0000\" >" + status + "</font>";
                    }
                    sn.Cells.Add(new DevComponents.AdvTree.Cell(status));
                    sn.Cells.Add(new DevComponents.AdvTree.Cell(DataModel.Constant.VideoAnalyzeTypeInfo.Single(it => it.Type == s.AlgthmType).Name));

                    //DevComponents.DotNetBar.ButtonItem sbuttonItem = new DevComponents.DotNetBar.ButtonItem();
                    //sbuttonItem.Text = "删除";
                    //sbuttonItem.Click += buttonItem_Click;
                    //sbuttonItem.Tag = new Tuple<uint, E_VIDEO_ANALYZE_TYPE>(item.TaskId, s.AlgthmType);
                    DevComponents.AdvTree.Cell sc1 = new DevComponents.AdvTree.Cell();
                    //sc1.HostedItem = sbuttonItem;
                    sc1.Text = m_viewModel.GetActionURL(s.Status, s.AlgthmType, item.TaskType);// +"<a href=\"del\">删除算法</a>";
                    sn.Cells.Add(sc1);
                    DevComponents.DotNetBar.ButtonItem sbuttonItem2 = new DevComponents.DotNetBar.ButtonItem();
                    sbuttonItem2.Text   = "";
                    sbuttonItem2.Click += buttonItem_Click;
                    //sbuttonItem2.Image = Properties.Resources.remove_analyse_24;
                    sbuttonItem2.Symbol  = "";//"/uf056";
                    sbuttonItem2.Tooltip = "删除算法";
                    //buttonItem.Tag = new Tuple<uint, E_VIDEO_ANALYZE_TYPE>(item.TaskId, E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE);
                    DevComponents.AdvTree.Cell sc3 = new DevComponents.AdvTree.Cell();
                    sc3.HostedItem = sbuttonItem2;
                    sn.Cells.Add(sc3);
                    sn.Tag = new Tuple <uint, StatusInfoV3_1>(item.TaskId, s);
                    n.Nodes.Add(sn);
                }
                totalprogress += (uint)m_viewModel.CalcProgress(s.Status, (int)s.Progress);
                if (totalstatus == 0)
                {
                    totalstatus = (uint)s.Status;
                }
                else
                {
                    if (totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_WAIT ||
                        s.Status == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_WAIT)
                    {
                        if (totalstatus + (uint)s.Status == 10)
                        {
                            totalstatus = 5;
                        }
                        else if (totalstatus + (uint)s.Status == 11)
                        {
                            totalstatus = 6;
                        }
                        else if (totalstatus + (uint)s.Status == 12)
                        {
                            totalstatus = 5;
                        }
                        else if (totalstatus + (uint)s.Status == 13)
                        {
                            totalstatus = 5;
                        }
                        else
                        if (s.Status > 0)
                        {
                            totalstatus = Math.Min(totalstatus, (uint)s.Status);
                        }
                    }
                    else if (totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED ||
                             s.Status == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED)
                    {
                        if (totalstatus + (uint)s.Status >= 15)
                        {
                            totalstatus = 8;
                        }
                        else
                        if (s.Status > 0)
                        {
                            totalstatus = Math.Min(totalstatus, (uint)s.Status);
                        }
                    }
                    else
                    if (s.Status > 0)
                    {
                        totalstatus = Math.Min(totalstatus, (uint)s.Status);
                    }
                }
                totalalaysetype += DataModel.Constant.VideoAnalyzeTypeInfo.Single(it => it.Type == s.AlgthmType).Name + " ";
                totaltime        = Math.Max(totaltime, s.LeftTime);
            }

            if (item.StatusList.Count > 0)
            {
                totalprogress /= (uint)item.StatusList.Count;
            }
            else
            {
                totalprogress = 1000;
                totalstatus   = (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FINISH;
            }
            n.Cells.Add(c);
            n.Cells.Add(new DevComponents.AdvTree.Cell(item.StartTime.ToString()));

            DevComponents.DotNetBar.ProgressBarItem progressBarItem = new DevComponents.DotNetBar.ProgressBarItem();
            progressBarItem.BackStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            progressBarItem.ChunkGradientAngle   = 0F;
            progressBarItem.MenuVisibility       = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
            progressBarItem.RecentlyUsed         = false;
            progressBarItem.Maximum     = 1000;
            progressBarItem.TextVisible = true;
            progressBarItem.Value       = (int)totalprogress;
            if (totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED || totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_IMPORT_FAILED)
            {
                progressBarItem.Text = "";
            }
            else
            {
                if (progressBarItem.Value < progressBarItem.Maximum)
                {
                    progressBarItem.Text = (item.Order > 0) ? string.Format("等待排序号:{0}", item.Order) : string.Format("剩余时间:{0}", TimeSpan.FromSeconds(totaltime));
                }
                else
                {
                    progressBarItem.Text = "";
                }
            }
            DevComponents.AdvTree.Cell c2 = new DevComponents.AdvTree.Cell();
            c2.HostedItem = progressBarItem;

            n.Cells.Add(c2);
            string statusstr = DataModel.Constant.TaskStatusInfos.Single(it => it.NStatus == totalstatus).Name;

            if (totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FINISH)
            {
                statusstr = "<font color=\"#5555ff\" ><b>" + statusstr + "</b></font>";
            }
            if (totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED || totalstatus == (uint)E_VDA_TASK_STATUS.E_TASK_STATUS_IMPORT_FAILED)
            {
                statusstr = "<font color=\"#ff0000\" ><b>" + statusstr + "</b></font>";
            }
            DevComponents.AdvTree.Cell cellstatus = new DevComponents.AdvTree.Cell(statusstr);
            cellstatus.TagString = DataModel.Constant.TaskStatusInfos.Single(it => it.NStatus == totalstatus).Name;
            n.Cells.Add(cellstatus);
            n.Cells.Add(new DevComponents.AdvTree.Cell(totalalaysetype.Trim()));
            DevComponents.AdvTree.Cell c1 = new DevComponents.AdvTree.Cell();
            string url = "<a href=\"E_TASK_ACTION_TYPE_INFO\">查看信息</a> ";

            if ((E_VDA_TASK_STATUS)totalstatus >= E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_WAIT)
            {
                url += "<a href=\"E_TASK_ACTION_TYPE_PLAYBACK\">视频回放</a> ";
            }
            //url += "<a href=\"E_TASK_ACTION_TYPE_DELETE\">删除任务</a>";
            c1.Text = url;
            n.Cells.Add(c1);

            DevComponents.DotNetBar.ButtonItem buttonItem = new DevComponents.DotNetBar.ButtonItem();
            buttonItem.Text   = "";
            buttonItem.Click += buttonItem_Click;
            //buttonItem.Image = Properties.Resources._305_Close_24x24_72;
            buttonItem.Symbol  = "";// "/uf014";
            buttonItem.Tooltip = "删除任务";
            //buttonItem.Tag = new Tuple<uint, E_VIDEO_ANALYZE_TYPE>(item.TaskId, E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE);
            DevComponents.AdvTree.Cell c3 = new DevComponents.AdvTree.Cell();
            c3.HostedItem = buttonItem;
            n.Cells.Add(c3);
            n.Tag = item;
            return(n);
        }
Beispiel #14
0
        private DevComponents.AdvTree.Node AddTaskTreeNode(TaskInfoV3_1 item)
        {
            DevComponents.AdvTree.Node n = new DevComponents.AdvTree.Node(item.TaskId.ToString());
            DevComponents.AdvTree.Cell c = new DevComponents.AdvTree.Cell();
            //c.Images.Image = global::IVX.Live.MainForm.Properties.Resources.bkjpg;
            c.Images.ImageIndex = 0;

            c.Text = item.ToString();
            E_VDA_TASK_STATUS    totalstatus     = 0;
            E_VIDEO_ANALYZE_TYPE totalalaysetype = 0;

            foreach (var s in item.StatusList)
            {
                totalstatus     = s.Status;
                totalalaysetype = s.AlgthmType;
            }

            n.Cells.Add(c);

            string anaurl = DataModel.Constant.TaskStatusInfos.Single(it => it.Status == totalstatus).Name;

            if (totalstatus == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_EXECUTING)
            {
                anaurl += " <a href=\"E_TASK_ACTION_TYPE_SUNPEND\">暂停分析</a> ";
            }

            if (totalstatus == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_SUSPEND)
            {
                anaurl += " <a href=\"E_TASK_ACTION_TYPE_CONTINUE\">继续分析</a> ";
            }

            if (totalstatus == E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_FAILED || totalstatus == E_VDA_TASK_STATUS.E_TASK_STATUS_IMPORT_FAILED)
            {
                anaurl = "<font color=\"#ff0000\" ><b>" + anaurl + "</b></font>";
            }

            DevComponents.AdvTree.Cell cellana = new DevComponents.AdvTree.Cell(anaurl);
            cellana.TagString = DataModel.Constant.TaskStatusInfos.Single(it => it.Status == totalstatus).Name;
            n.Cells.Add(cellana);
            n.Cells.Add(new DevComponents.AdvTree.Cell(DataModel.Constant.VideoAnalyzeTypeInfo.Single(it => it.Type == totalalaysetype).Name));


            DevComponents.AdvTree.Cell c1 = new DevComponents.AdvTree.Cell();
            string url = "<a href=\"E_TASK_ACTION_TYPE_INFO\">查看信息</a> ";

            if ((E_VDA_TASK_STATUS)totalstatus >= E_VDA_TASK_STATUS.E_TASK_STATUS_ANALYSE_WAIT)
            {
                url += "<a href=\"E_TASK_ACTION_TYPE_PLAYBACK\">视频播放</a> ";
            }
            url += m_viewModel.GetActionURL(totalstatus, totalalaysetype, item.TaskType);
            //url += "<a href=\"E_TASK_ACTION_TYPE_DELETE\">删除任务</a>";
            c1.Text = url;
            n.Cells.Add(c1);

            DevComponents.DotNetBar.ButtonItem sbuttonItem = new DevComponents.DotNetBar.ButtonItem();
            sbuttonItem.Text   = "";// "删除任务";
            sbuttonItem.Click += sbuttonItem_Click;
            //sbuttonItem.Image = Properties.Resources._305_Close_24x24_72;
            sbuttonItem.Symbol  = "";// "/uf014";
            sbuttonItem.Tooltip = "删除任务";
            //sbuttonItem.Tag = new Tuple<uint, E_VIDEO_ANALYZE_TYPE>(item.TaskId, totalalaysetype);

            DevComponents.AdvTree.Cell c2 = new DevComponents.AdvTree.Cell();
            c2.HostedItem = sbuttonItem;
            n.Cells.Add(c2);
            n.Tag = item;
            return(n);
        }
Beispiel #15
0
        public override void InitRendererObject(IFeatureRenderer _Renderer, esriSymbologyStyleClass _SymbologyStyleClass)
        {
            m_SymbologyStyleClass = _SymbologyStyleClass;

            ISimpleRenderer _SimpleRenderer = null;

            if ((_Renderer is ISimpleRenderer) == false)
            {
                _SimpleRenderer             = new SimpleRendererClass();
                _SimpleRenderer.Label       = "";
                _SimpleRenderer.Description = "";
                _SimpleRenderer.Symbol      = ModuleCommon.CreateSymbol(_SymbologyStyleClass);
            }
            else
            {
                _SimpleRenderer = _Renderer as ISimpleRenderer;
            }

            #region RendererName

            m_RendererName               = new StringValue();
            m_RendererName.ControlName   = "RendererName";
            m_RendererName.Caption       = "Ãû³Æ";
            m_RendererName.ControlWidth  = 100;
            m_RendererName.ControlHeight = 23;
            m_RendererName.DataValue     = _SimpleRenderer.Label;

            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node();
            node.Text = m_RendererName.Caption;
            node.Name = "node" + m_RendererName.ControlName;
            DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetTextBox(m_RendererName);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);

            #endregion

            #region RendererDesc

            m_RendererDesc               = new StringValue();
            m_RendererDesc.ControlName   = "RendererDesc";
            m_RendererDesc.Caption       = "ÃèÊö";
            m_RendererDesc.ControlWidth  = 100;
            m_RendererDesc.ControlHeight = 23;
            m_RendererDesc.DataValue     = _SimpleRenderer.Description;

            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_RendererDesc.Caption;
            node.Name          = "node" + m_RendererDesc.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetTextBox(m_RendererDesc);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);

            #endregion

            #region ForeSymbol

            m_ForeSymbol               = new SymbolValue();
            m_ForeSymbol.ControlName   = "SimpleSymbol";
            m_ForeSymbol.Caption       = "·ûºÅ";
            m_ForeSymbol.ControlWidth  = 100;
            m_ForeSymbol.ControlHeight = 50;
            m_ForeSymbol.DataValue     = _SimpleRenderer.Symbol;

            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_ForeSymbol.Caption;
            node.Name          = "node" + m_ForeSymbol.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetSymbolButton(m_ForeSymbol);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);

            #endregion
        }
        private void AddEntityToGrid(Entity entity)
        {
            //advTree1.BeginUpdate();

            try
            {
                // Add a new column for the entity
                DevComponents.AdvTree.ColumnHeader columnHeader = new DevComponents.AdvTree.ColumnHeader(entity.Name) { Tag = entity };
                advTree1.Columns.Add(columnHeader);
                //advTree1.Columns.Insert(advTree1.Columns.Count - 1, columnHeader);
                advTree1.Columns[advTree1.Columns.Count - 1].Width.Absolute = 150;

                // Add top row (Name textbox)
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.Controls.TextBoxX tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                tb.Text = entity.Name;
                cell.HostedControl = tb;
                advTree1.Nodes[0].Cells.Add(cell);

                // Add second row (is base)
                cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.CheckBoxItem checkbox = new DevComponents.DotNetBar.CheckBoxItem();
                cell.HostedItem = checkbox;
                checkbox.CheckedChanged += new DevComponents.DotNetBar.CheckBoxChangeEventHandler(IsBaseCheckbox_CheckedChanged);
                advTree1.Nodes[1].Cells.Add(cell);

                // Add third row (discriminator-value textbox)
                cell = new DevComponents.AdvTree.Cell();
                tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                tb.Text = entity.DiscriminatorValue;
                cell.HostedControl = tb;
                advTree1.Nodes[2].Cells.Add(cell);

                // Add row for all table columns (checkboxes)
                for (int i = 3; i < advTree1.Nodes.Count - 1; i++)
                {
                    cell = new DevComponents.AdvTree.Cell();
                    cell.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.Default;
                    cell.CheckBoxVisible = true;
                    cell.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.CheckBox;
                    cell.CheckBoxThreeState = false;
                    cell.Checked = false;
                    advTree1.Nodes[i].Cells.Add(cell);
                }

                // Add bottom row (delete button)
                cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.ButtonItem button = new DevComponents.DotNetBar.ButtonItem();
                button.Text = "Delete";
                button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                button.Image = imageList1.Images[IMAGE_DELETE];
                superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Delete", "", "Delete this entity - it will be totally deleted from the model and also from this inheritance hierarchy.", imageListLarge.Images[IMAGE_DELETE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
                cell.HostedItem = button;
                button.Click += new EventHandler(DeleteButton_Click);
                advTree1.Nodes[advTree1.Nodes.Count - 1].Cells.Add(cell);

                //// Add bottom row (remove button)
                //cell = new DevComponents.AdvTree.Cell();
                //button = new DevComponents.DotNetBar.ButtonItem();
                //button.Text = "Remove";
                //button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                //button.Image = imageList1.Images[IMAGE_REMOVE];
                //superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Remove", "", "Remove this entity from this inheritance hierarchy.", imageListLarge.Images[IMAGE_REMOVE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
                //cell.HostedItem = button;
                //button.Click += new EventHandler(RemoveButton_Click);
                //advTree1.Nodes[advTree1.Nodes.Count - 1].Cells.Add(cell);

                //if (advTree1.HScrollBarVisible && advTree1.HScrollBar != null)
                //{
                //    //advTree1.HorizontalScroll.Value = advTree1.HorizontalScroll.Maximum;

                //    //advTree1.HScrollBar.Value = advTree1.HScrollBar.Maximum;
                //    if (advTree1.HScrollBar.Maximum > advTree1.Width)
                //    {
                //        advTree1.AutoScroll = false;
                //        int v = advTree1.HScrollBar.Maximum - advTree1.Width;
                //        advTree1.HScrollBar.Value = v - 1;
                //        advTree1.Refresh();
                //        advTree1.HScrollBar.Value = v;
                //        advTree1.Refresh();
                //        advTree1.AutoScroll = true;
                //    }
                //    //double t = (double)((double)advTree1.HScrollBar.Value / advTree1.HScrollBar.Maximum) * advTree1.HorizontalScroll.Maximum;
                //    //advTree1.HorizontalScroll.Value = (int)Math.Floor(t);

                //}
            }
            finally
            {
                //advTree1.EndUpdate();
            }
            //this.Refresh();
        }
        private void AddBottomRow()
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node("");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.ButtonItem button = new DevComponents.DotNetBar.ButtonItem();
                button.Text = "Delete";
                button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                button.Image = imageList1.Images[IMAGE_DELETE];
                superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Delete", "", "Delete this entity - it will be totally deleted from the model and also from this inheritance hierarchy.", imageListLarge.Images[IMAGE_DELETE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
                cell.HostedItem = button;
                button.Click += new EventHandler(DeleteButton_Click);
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);

            //node = new DevComponents.AdvTree.Node("");

            //for (int i = 0; i < MappedEntities.Count; i++)
            //{
            //    DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
            //    DevComponents.DotNetBar.ButtonItem button = new DevComponents.DotNetBar.ButtonItem();
            //    button.Text = "Remove";
            //    button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
            //    button.Image = imageList1.Images[IMAGE_REMOVE];
            //    superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Remove", "", "Remove this entity from this inheritance hierarchy.", imageListLarge.Images[IMAGE_REMOVE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
            //    cell.HostedItem = button;
            //    button.Click += new EventHandler(RemoveButton_Click);
            //    node.Cells.Add(cell);
            //}
            //advTree1.Nodes.Add(node);
        }
        private void AddTopRow()
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node("Name");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.Controls.TextBoxX tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                tb.Text = MappedEntities[i].Name;
                cell.HostedControl = tb;
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
            node = new DevComponents.AdvTree.Node("Is Base?");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.CheckBoxItem checkbox = new DevComponents.DotNetBar.CheckBoxItem();
                cell.HostedItem = checkbox;
                checkbox.CheckedChanged += new DevComponents.DotNetBar.CheckBoxChangeEventHandler(IsBaseCheckbox_CheckedChanged);
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
            node = new DevComponents.AdvTree.Node("Discriminator Value");

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.Controls.TextBoxX tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                cell.HostedControl = tb;
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
        }
        private void AddRow(ArchAngel.Providers.EntityModel.Model.DatabaseLayer.IColumn column)
        {
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node(column.Name);

            for (int i = 0; i < MappedEntities.Count; i++)
            {
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                cell.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.Default;
                cell.CheckBoxVisible = true;
                cell.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.CheckBox;
                cell.CheckBoxThreeState = false;
                cell.Checked = MappedEntities[i].ConcreteProperties.Count(p => p.MappedColumn() == column) > 0;
                node.Cells.Add(cell);
            }
            advTree1.Nodes.Add(node);
        }
Beispiel #20
0
        private void MakeTree(MongoDB.Bson.BsonDocument bd, DevComponents.AdvTree.AdvTree avt,int i)
        {
            //throw new NotImplementedException();
            DevComponents.AdvTree.Node nd =new DevComponents.AdvTree.Node();
            nd.Text = "(" + i.ToString() + "){.}";
            nd.Cells.Add(new DevComponents.AdvTree.Cell());
            DevComponents.AdvTree.Cell c = new DevComponents.AdvTree.Cell();
            c.Text = bd.BsonType.ToString();
            nd.Cells.Add(c);
            avt.Nodes.Add(nd);

            foreach (MongoDB.Bson.BsonElement be in bd.Elements)
            {
                if (be.Value.IsBsonDocument)
                {
                    DevComponents.AdvTree.Node nddd = new DevComponents.AdvTree.Node(be.Name);
                    nddd.Cells.Add(new DevComponents.AdvTree.Cell());
                    nddd.Cells.Add(new DevComponents.AdvTree.Cell(be.Value.BsonType.ToString()));
                    nd.Nodes.Add(nddd);
                    TreeTree((MongoDB.Bson.BsonDocument)be.Value, nddd);
                }
                else
                {
                    DevComponents.AdvTree.Node ndd = new DevComponents.AdvTree.Node();
                    ndd.Text = be.Name;
                    DevComponents.AdvTree.Cell cc = new DevComponents.AdvTree.Cell();
                    cc.Text = be.Value.ToString();
                    ndd.Cells.Add(cc);
                    DevComponents.AdvTree.Cell ccc =  new DevComponents.AdvTree.Cell();
                    ccc.Text = be.Value.BsonType.ToString();
                    ndd.Cells.Add(ccc);
                    nd.Nodes.Add(ndd);
                }
            }
        }
        private void adTree_Right_Init()
        {
            DevComponents.AdvTree.Node node;
            if (ExecCommandList.LC != null)
            {
                RemoveLC();
                foreach (var cmd in ExecCommandList.LC)
                {
                    bool b = false;
                    foreach (DevComponents.AdvTree.Node Node in advTree1.Nodes)
                    {
                        if (Node.Tag.ToString() == cmd.STCD && Node.Cells[1].Tag.ToString() == cmd.CommandID && Node.Cells[2].Tag.ToString() == cmd.SERVICETYPE)
                        {
                            //图片更新
                            if (cmd.STATE == 0)
                            {
                                Node.ImageIndex = 0;
                            }
                            else if (cmd.STATE > 0 && cmd.STATE <= 3)
                            {
                                Node.ImageIndex = 1;
                            }
                            else if (cmd.STATE == -1)
                            {
                                Node.ImageIndex = 2;
                            }
                            else
                            {
                                Node.ImageIndex = 3;
                            }

                            Node.Cells[2].Text = cmd.DATETIME.ToString("MM月dd日 HH时mm分ss秒");
                            b = true;
                        }
                    }

                    if (!b)
                    {
                        node = new DevComponents.AdvTree.Node();
                        foreach (var item in ExecRTUList.Lrdm)
                        {
                            if (item.STCD == cmd.STCD)
                            {
                                node.Tag  = cmd.STCD;
                                node.Text = item.NAME;
                                break;
                            }
                        }


                        foreach (var item in ExecCommandList.Commands)
                        {
                            if (item.CommandID == cmd.CommandID)
                            {
                                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                                cell.Tag            = item.CommandID;
                                cell.Text           = item.Remark;
                                cell.ImageAlignment = DevComponents.AdvTree.eCellPartAlignment.Default;
                                node.Cells.Add(cell);
                                break;
                            }
                        }


                        if (cmd.STATE == 0)
                        {
                            node.ImageIndex = 0;
                        }
                        else if (cmd.STATE > 0 && cmd.STATE <= 3)
                        {
                            node.ImageIndex = 1;
                        }
                        else if (cmd.STATE == -1)
                        {
                            node.ImageIndex = 2;
                        }
                        else
                        {
                            node.ImageIndex = 3;
                        }

                        DevComponents.AdvTree.Cell cell1 = new DevComponents.AdvTree.Cell();
                        cell1.Text = cmd.DATETIME.ToString("MM月dd日 HH时mm分ss秒");
                        cell1.Tag  = cmd.SERVICETYPE;
                        node.Cells.Add(cell1);
                        node.Cells.Add(new DevComponents.AdvTree.Cell());

                        node.Tooltip = @"测站:" + node.Cells[0].Text + "\n" +
                                       "站号:" + cmd.STCD + "\n" +
                                       "命令码:" + cmd.CommandID + "\n" +
                                       "命令:" + node.Cells[1].Text + "\n" +
                                       "服务类型:" + cmd.SERVICETYPE + "\n" +
                                       "时间:" + node.Cells[2].Text;

                        advTree1.Nodes.Add(node);
                        node.ExpandVisibility = DevComponents.AdvTree.eNodeExpandVisibility.Hidden;
                    }
                }
            }
        }
Beispiel #22
0
        public void Init()
        {
            var all = Constant.VideoAnalyzeTypeInfo.Where
                      (
                item => item.Type != E_VIDEO_ANALYZE_TYPE.E_ANALYZE_CROSSROAD &&
                item.Type != E_VIDEO_ANALYZE_TYPE.E_ANALYZE_CROWD &&
                item.Type != E_VIDEO_ANALYZE_TYPE.E_ANALYZE_BEHAVIOR_ALARM &&
                item.Type != E_VIDEO_ANALYZE_TYPE.E_ANALYZE_PERSON_COUNT
                      ).Select(it => it.Type).ToList();

            //textBoxAnlyse.Text = "DataModel.Constant.VideoAnalyzeTypeInfo.Single(item => item.Type == m_viewModel.CurrentTask.AlgthmType).Name";
            textBoxFilePath.Text = m_viewModel.CurrentTask.OriFilePath;
            textBoxFileSize.Text = DataModel.Common.GetByteSizeInUnit(m_viewModel.CurrentTask.FileSize);
            textBoxFileType.Text = DataModel.Constant.TaskFileTypeInfos.Single(item => item.Status == m_viewModel.CurrentTask.FileType).Name;
            textBoxTaskId.Text   = m_viewModel.CurrentTask.TaskId.ToString();
            textBoxTaskName.Text = m_viewModel.CurrentTask.TaskName;
            //textBoxTaskStatus.Text = "DataModel.Constant.TaskStatusInfos.Single(item => item.Status == m_viewModel.CurrentTask.Status).Name";
            textBoxTaskType.Text           = DataModel.Constant.TaskTypeInfos.Single(item => item.Status == m_viewModel.CurrentTask.TaskType).Name;
            comboBoxPriority.SelectedIndex = (int)(m_viewModel.CurrentTask.Priority - 1);
            dateTimeEnd.Value   = m_viewModel.CurrentTask.EndTime;
            dateTimeStart.Value = m_viewModel.CurrentTask.StartTime;
            //progressBarTaskProgress.Value = m_viewModel.CurrentProgress;
            TitleText = string.Format("[{0}] {1}", m_viewModel.CurrentTask.TaskId, m_viewModel.CurrentTask.TaskName);
            isInited  = true;
            advTree1.Nodes.Clear();
            foreach (var item in m_viewModel.CurrentTask.StatusList)
            {
                if (item.AlgthmType == E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE)
                {
                    continue;
                }

                all.Remove(item.AlgthmType);
                DevComponents.AdvTree.Node         sn          = new DevComponents.AdvTree.Node();
                DevComponents.DotNetBar.ButtonItem buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
                buttonItem1.Text   = "";
                buttonItem1.Click += buttonItem1_Click;
                buttonItem1.Image  = Properties.Resources.remove_analyse_24;
                buttonItem1.Tag    = item;
                sn.HostedItem      = buttonItem1;
                sn.Cells.Add(new DevComponents.AdvTree.Cell(DataModel.Constant.VideoAnalyzeTypeInfo.Single(it => it.Type == item.AlgthmType).Name));
                sn.Cells.Add(new DevComponents.AdvTree.Cell(DataModel.Constant.TaskStatusInfos.Single(it => it.Status == item.Status).Name));

                int progress = m_viewModel.CalcProgress(item.Status, (int)item.Progress);
                DevComponents.DotNetBar.ProgressBarItem sprogressBarItem = new DevComponents.DotNetBar.ProgressBarItem();
                sprogressBarItem.BackStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
                sprogressBarItem.ChunkGradientAngle   = 0F;
                sprogressBarItem.MenuVisibility       = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
                sprogressBarItem.RecentlyUsed         = false;
                sprogressBarItem.Maximum     = 1000;
                sprogressBarItem.TextVisible = true;
                sprogressBarItem.Value       = progress;
                if (sprogressBarItem.Value < sprogressBarItem.Maximum)
                {
                    sprogressBarItem.Text = (m_viewModel.CurrentTask.Order > 0) ? "" : string.Format("剩余时间:{0}", TimeSpan.FromSeconds(item.LeftTime));
                }
                else
                {
                    sprogressBarItem.Text = "";
                }
                DevComponents.AdvTree.Cell sc2 = new DevComponents.AdvTree.Cell();
                sc2.HostedItem = sprogressBarItem;

                sn.Cells.Add(sc2);

                DevComponents.DotNetBar.ButtonItem buttonItem2 = new DevComponents.DotNetBar.ButtonItem();
                buttonItem2.Text = "选择切分方式";
                DevComponents.DotNetBar.ButtonItem sbuttonItem0 = new DevComponents.DotNetBar.ButtonItem();
                sbuttonItem0.Text   = "按默认切分";
                sbuttonItem0.Click += buttonItem2_Click;
                sbuttonItem0.Tag    = new Tuple <E_VIDEO_ANALYZE_TYPE, uint>(item.AlgthmType, 0);
                buttonItem2.SubItems.Add(sbuttonItem0);
                DevComponents.DotNetBar.ButtonItem sbuttonItem1 = new DevComponents.DotNetBar.ButtonItem();
                sbuttonItem1.Text   = "按5分钟切分";
                sbuttonItem1.Click += buttonItem2_Click;
                sbuttonItem1.Tag    = new Tuple <E_VIDEO_ANALYZE_TYPE, uint>(item.AlgthmType, 300);
                buttonItem2.SubItems.Add(sbuttonItem1);
                DevComponents.DotNetBar.ButtonItem sbuttonItem2 = new DevComponents.DotNetBar.ButtonItem();
                sbuttonItem2.Text   = "按10分钟切分";
                sbuttonItem2.Click += buttonItem2_Click;
                sbuttonItem2.Tag    = new Tuple <E_VIDEO_ANALYZE_TYPE, uint>(item.AlgthmType, 600);
                buttonItem2.SubItems.Add(sbuttonItem2);
                DevComponents.DotNetBar.ButtonItem sbuttonItem3 = new DevComponents.DotNetBar.ButtonItem();
                sbuttonItem3.Text   = "按20分钟切分";
                sbuttonItem3.Click += buttonItem2_Click;
                sbuttonItem3.Tag    = new Tuple <E_VIDEO_ANALYZE_TYPE, uint>(item.AlgthmType, 1200);
                buttonItem2.SubItems.Add(sbuttonItem3);
                DevComponents.DotNetBar.ButtonItem sbuttonItem4 = new DevComponents.DotNetBar.ButtonItem();
                sbuttonItem4.Text   = "按30分钟切分";
                sbuttonItem4.Click += buttonItem2_Click;
                sbuttonItem4.Tag    = new Tuple <E_VIDEO_ANALYZE_TYPE, uint>(item.AlgthmType, 1800);
                buttonItem2.SubItems.Add(sbuttonItem4);
                DevComponents.DotNetBar.ButtonItem sbuttonItem5 = new DevComponents.DotNetBar.ButtonItem();
                sbuttonItem5.Text   = "不切分";
                sbuttonItem5.Click += buttonItem2_Click;
                sbuttonItem5.Tag    = new Tuple <E_VIDEO_ANALYZE_TYPE, uint>(item.AlgthmType, int.MaxValue);
                buttonItem2.SubItems.Add(sbuttonItem5);

                buttonItem2.AutoExpandOnClick = true;
                buttonItem2.ShowSubItems      = false;
                buttonItem2.ExpandChange     += buttonItem_ExpandChange;
                DevComponents.AdvTree.Cell sc3 = new DevComponents.AdvTree.Cell();
                sc3.HostedItem = buttonItem2;
                sn.Cells.Add(sc3);

                DevComponents.DotNetBar.ButtonItem buttonItem3 = new DevComponents.DotNetBar.ButtonItem();
                buttonItem3.Text   = "重新分析";
                buttonItem3.Click += buttonItem3_Click;
                buttonItem3.Tag    = item;
                if (item.AlgthmType != E_VIDEO_ANALYZE_TYPE.E_ANALYZE_BRIEAF)
                {
                    DevComponents.DotNetBar.ButtonItem sbuttonItem6 = new DevComponents.DotNetBar.ButtonItem();
                    sbuttonItem6.Text   = "设置分析参数并重新分析...";
                    sbuttonItem6.Click += sbuttonItem6_Click;
                    sbuttonItem6.Tag    = item;
                    buttonItem3.SubItems.Add(sbuttonItem6);
                }
                buttonItem3.AutoExpandOnClick = false;
                buttonItem3.ExpandChange     += buttonItem_ExpandChange;
                DevComponents.AdvTree.Cell sc4 = new DevComponents.AdvTree.Cell();
                sc4.HostedItem = buttonItem3;
                sn.Cells.Add(sc4);

                sn.Tag = item;
                advTree1.Nodes.Add(sn);
            }

            DevComponents.AdvTree.Node         n          = new DevComponents.AdvTree.Node();
            DevComponents.DotNetBar.ButtonItem buttonItem = new DevComponents.DotNetBar.ButtonItem();
            buttonItem.Text  = "";
            buttonItem.Image = Properties.Resources.add__analyse_24;
            foreach (var item in all)
            {
                if (item == E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE)
                {
                    continue;
                }
                DevComponents.DotNetBar.ButtonItem buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
                buttonItem1.Text   = "添加 " + DataModel.Constant.VideoAnalyzeTypeInfo.Single(it => it.Type == item).Name + " 算法";
                buttonItem1.Click += buttonItem_Click;
                buttonItem1.Tag    = item;
                buttonItem.SubItems.Add(buttonItem1);
            }
            buttonItem.AutoExpandOnClick = true;
            buttonItem.ShowSubItems      = false;
            buttonItem.ExpandChange     += buttonItem_ExpandChange;
            n.Visible = (buttonItem.SubItems.Count > 0);

            //buttonItem.Tag = new Tuple<uint, E_VIDEO_ANALYZE_TYPE>(item.TaskId, E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE);
            n.HostedItem = buttonItem;
            n.Cells.Add(new DevComponents.AdvTree.Cell());
            n.Cells.Add(new DevComponents.AdvTree.Cell());
            n.Cells.Add(new DevComponents.AdvTree.Cell());
            n.Cells.Add(new DevComponents.AdvTree.Cell());
            n.Cells.Add(new DevComponents.AdvTree.Cell());

            advTree1.Nodes.Add(n);
        }
Beispiel #23
0
        public override void InitRendererObject(IFeatureRenderer _Renderer, esriSymbologyStyleClass _SymbologyStyleClass)
        {
            m_SymbologyStyleClass = _SymbologyStyleClass;
            InitUI();

            #region InitObject

            IClassBreaksRenderer _BreakRenderer = null;
            if ((_Renderer is IClassBreaksRenderer) == false)
            {
                _BreakRenderer = new ClassBreaksRendererClass();
                if (m_SymbologyStyleClass == esriSymbologyStyleClass.esriStyleClassFillSymbols)
                {
                    _BreakRenderer.BackgroundSymbol = ModuleCommon.CreateSymbol(esriSymbologyStyleClass.esriStyleClassFillSymbols) as IFillSymbol;
                }
                else
                {
                    _BreakRenderer.BackgroundSymbol = null;
                }
                _BreakRenderer.MinimumBreak = 0;
                _BreakRenderer.Field        = "";

                m_Field.DataValue     = "<NONE>";
                m_SizeLevel.DataValue = 3;
                m_MinSize.DataValue   = 1;
                m_MaxSize.DataValue   = 6;
                m_MinValue.DataValue  = 0;
                m_MaxValue.DataValue  = 100;
                switch (m_SymbologyStyleClass)
                {
                case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                    m_ForeSymbol.DataValue = ModuleCommon.CreateSymbol(m_SymbologyStyleClass);
                    m_BackSymbol           = null;
                    break;

                case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                    m_ForeSymbol.DataValue     = ModuleCommon.CreateSymbol(esriSymbologyStyleClass.esriStyleClassMarkerSymbols);
                    m_BackSymbol               = new SymbolValue();
                    m_BackSymbol.ControlName   = "BackSymbol";
                    m_BackSymbol.Caption       = "±³¾°·ûºÅ";
                    m_BackSymbol.ControlWidth  = 100;
                    m_BackSymbol.ControlHeight = 40;
                    m_BackSymbol.DataValue     = ModuleCommon.CreateSymbol(esriSymbologyStyleClass.esriStyleClassFillSymbols);
                    break;
                }
            }
            else
            {
                _BreakRenderer = _Renderer as IClassBreaksRenderer;

                m_SizeLevel.DataValue = _BreakRenderer.BreakCount;
                if (_BreakRenderer.BreakCount > 0)
                {
                    m_MinValue.DataValue = _BreakRenderer.MinimumBreak;
                    m_MaxValue.DataValue = _BreakRenderer.get_Break(m_SizeLevel.DataValue - 1);

                    m_MinSize.DataValue = ModuleCommon.GetSymbolSize(_BreakRenderer.get_Symbol(0));
                    m_MaxSize.DataValue = ModuleCommon.GetSymbolSize(_BreakRenderer.get_Symbol(m_SizeLevel.DataValue - 1));

                    m_ForeSymbol.DataValue = _BreakRenderer.get_Symbol(0);
                }
                else
                {
                    m_MinValue.DataValue   = 0;
                    m_MaxValue.DataValue   = 100;
                    m_MinSize.DataValue    = 1;
                    m_MaxSize.DataValue    = 6;
                    m_ForeSymbol.DataValue = ModuleCommon.CreateSymbol(m_SymbologyStyleClass);
                }

                if (_BreakRenderer.BackgroundSymbol == null)
                {
                    m_BackSymbol = null;
                }
                else
                {
                    m_BackSymbol               = new SymbolValue();
                    m_BackSymbol.ControlName   = "BackSymbol";
                    m_BackSymbol.Caption       = "±³¾°·ûºÅ";
                    m_BackSymbol.ControlWidth  = 100;
                    m_BackSymbol.ControlHeight = 40;
                    m_BackSymbol.DataValue     = _BreakRenderer.BackgroundSymbol as ISymbol;
                }

                if (_BreakRenderer.Field == "")
                {
                    m_Field.DataValue = "<NONE>";
                }
                else
                {
                    m_Field.DataValue = _BreakRenderer.Field;
                }
            }

            #endregion

            #region InitListView

            m_ListValueItem.SmallImageList.Images.Clear();
            for (int i = 0; i < _BreakRenderer.BreakCount; i++)
            {
                ISymbol pSymbol = _BreakRenderer.get_Symbol(i);
                m_ListValueItem.SmallImageList.Images.Add("Symbol" + i.ToString(), ModuleCommon.Symbol2Picture(pSymbol, 80, 40));
                string label = _BreakRenderer.get_Label(i);
                double range = _BreakRenderer.get_Break(i);


                System.Windows.Forms.ListViewItem item = new System.Windows.Forms.ListViewItem();
                item.Name     = "Item" + i.ToString();
                item.Text     = "";
                item.ImageKey = "Symbol" + i.ToString();
                item.Tag      = pSymbol;

                string strMinValue = "0";
                if (i == 0)
                {
                    strMinValue = _BreakRenderer.MinimumBreak == 0 ? "0" : _BreakRenderer.MinimumBreak.ToString(".####");
                }
                else
                {
                    double sMinValue = (double)m_ListValueItem.Items[i - 1].SubItems[1].Tag;
                    strMinValue = sMinValue == 0 ? "0" : sMinValue.ToString(".####");
                }
                System.Windows.Forms.ListViewItem.ListViewSubItem subItem = new System.Windows.Forms.ListViewItem.ListViewSubItem();
                subItem.Name = "Range" + i.ToString();
                subItem.Text = strMinValue + "-" + (range == 0 ? "0" : range.ToString(".####"));
                subItem.Tag  = range;
                item.SubItems.Add(subItem);

                System.Windows.Forms.ListViewItem.ListViewSubItem subItem1 = new System.Windows.Forms.ListViewItem.ListViewSubItem();
                subItem1.Name = "Label" + i.ToString();
                subItem1.Text = label;
                item.SubItems.Add(subItem1);

                m_ListValueItem.Items.Add(item);
            }

            #endregion

            #region InitTree

            #region Field
            DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node();
            node.Text = m_Field.Caption;
            node.Name = "node" + m_Field.ControlName;
            DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetComboBox(m_Field);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region SizeLevel
            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_SizeLevel.Caption;
            node.Name          = "node" + m_SizeLevel.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetIntegerInput(m_SizeLevel);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region MinSize
            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_MinSize.Caption;
            node.Name          = "node" + m_MinSize.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetDoubleInput(m_MinSize);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region MaxSize
            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_MaxSize.Caption;
            node.Name          = "node" + m_MaxSize.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetDoubleInput(m_MaxSize);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region MinValue
            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_MinValue.Caption;
            node.Name          = "node" + m_MinValue.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetDoubleInput(m_MinValue);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region MaxValue
            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_MaxValue.Caption;
            node.Name          = "node" + m_MaxValue.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetDoubleInput(m_MaxValue);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region ForeSymbol
            node               = new DevComponents.AdvTree.Node();
            node.Text          = m_ForeSymbol.Caption;
            node.Name          = "node" + m_ForeSymbol.ControlName;
            cell               = new DevComponents.AdvTree.Cell();
            cell.HostedControl = GetSymbolButton(m_ForeSymbol);
            node.Cells.Add(cell);
            m_TreeProperty.Nodes.Add(node);
            #endregion

            #region BackSymbol
            if (m_BackSymbol != null)
            {
                node               = new DevComponents.AdvTree.Node();
                node.Text          = m_BackSymbol.Caption;
                node.Name          = "node" + m_BackSymbol.ControlName;
                cell               = new DevComponents.AdvTree.Cell();
                cell.HostedControl = GetSymbolButton(m_BackSymbol);
                node.Cells.Add(cell);
                m_TreeProperty.Nodes.Add(node);
            }
            #endregion

            #endregion
        }
Beispiel #24
0
        private DevComponents.AdvTree.Node AddNode(DevComponents.AdvTree.Node parentNode, string tag, string name, string description, InputTypes inputType, object value, bool selected, SetOptionValue setOptionValue)
        {
            DevComponents.DotNetBar.SuperTooltipInfo tooltip = new DevComponents.DotNetBar.SuperTooltipInfo(name, null, description, null, null, DevComponents.DotNetBar.eTooltipColor.Gray);

            DevComponents.DotNetBar.Controls.CheckBoxX checkBoxSelect = new DevComponents.DotNetBar.Controls.CheckBoxX()
            {
                Checked          = selected,
                Style            = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled,
                BackColor        = Color.Transparent,
                CheckBoxPosition = DevComponents.DotNetBar.eCheckBoxPosition.Right
            };
            DevComponents.AdvTree.Node newNode = new DevComponents.AdvTree.Node()
            {
                HostedControl = checkBoxSelect,
                Name          = tag
            };
            DevComponents.AdvTree.Cell nameCell = new DevComponents.AdvTree.Cell()
            {
                Text = name
            };
            DevComponents.AdvTree.Cell valueCell = new DevComponents.AdvTree.Cell()
            {
                EditorType = DevComponents.AdvTree.eCellEditorType.Custom,
                Editable   = true
            };
            switch (inputType)
            {
            case InputTypes.Double:
                double?doubleValue = (double?)value;
                DevComponents.Editors.DoubleInput doubleInput = new DevComponents.Editors.DoubleInput()
                {
                    Value = doubleValue.HasValue ? doubleValue.Value : 0
                };
                valueCell.HostedControl   = doubleInput;
                doubleInput.ValueChanged += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, doubleInput, setOptionValue); };
                break;

            case InputTypes.Integer:
                int?intValue = (int?)value;
                DevComponents.Editors.IntegerInput integerInput = new DevComponents.Editors.IntegerInput()
                {
                    Value = intValue.HasValue ? intValue.Value : 0
                };
                valueCell.HostedControl    = integerInput;
                integerInput.ValueChanged += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, integerInput, setOptionValue); };
                break;

            case InputTypes.String:
                TextBox textBox = new TextBox()
                {
                    Text = (string)value
                };
                valueCell.HostedControl = textBox;
                textBox.TextChanged    += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, textBox, setOptionValue); };
                break;

            case InputTypes.Boolean:
                bool?boolValue = (bool?)value;

                DevComponents.DotNetBar.Controls.CheckBoxX checkBox = new DevComponents.DotNetBar.Controls.CheckBoxX()
                {
                    Checked   = boolValue.HasValue ? boolValue.Value : false,
                    Style     = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled,
                    BackColor = Color.Transparent,
                };
                checkBox.CheckedChanged += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, checkBox, setOptionValue); };
                valueCell.HostedControl  = checkBox;
                break;

            default:
                throw new NotImplementedException("InputType not handled yet: " + inputType.ToString());
            }
            newNode.Cells.Add(nameCell);
            newNode.Cells.Add(valueCell);

            nameCell.Enabled  = checkBoxSelect.Checked;
            valueCell.Enabled = checkBoxSelect.Checked;
            valueCell.HostedControl.Enabled = checkBoxSelect.Checked;

            superTooltip1.SetSuperTooltip(newNode, tooltip);
            superTooltip1.SetSuperTooltip(checkBoxSelect, tooltip);
            superTooltip1.SetSuperTooltip(valueCell.HostedControl, tooltip);

            checkBoxSelect.CheckedChanged += delegate
            {
                nameCell.Enabled  = checkBoxSelect.Checked;
                valueCell.Enabled = checkBoxSelect.Checked;
                valueCell.HostedControl.Enabled = checkBoxSelect.Checked;

                if (checkBoxSelect.Checked)
                {
                    valueCell.HostedControl.Focus();
                }
            };
            if (parentNode == null)
            {
                advTree1.Nodes.Add(newNode);
            }
            else
            {
                parentNode.Nodes.Add(newNode);
            }

            return(newNode);
        }
        private void AddEntityToGrid(Entity entity)
        {
            //advTree1.BeginUpdate();

            try
            {
                // Add a new column for the entity
                DevComponents.AdvTree.ColumnHeader columnHeader = new DevComponents.AdvTree.ColumnHeader(entity.Name)
                {
                    Tag = entity
                };
                advTree1.Columns.Add(columnHeader);
                //advTree1.Columns.Insert(advTree1.Columns.Count - 1, columnHeader);
                advTree1.Columns[advTree1.Columns.Count - 1].Width.Absolute = 150;

                // Add top row (Name textbox)
                DevComponents.AdvTree.Cell cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.Controls.TextBoxX tb = new DevComponents.DotNetBar.Controls.TextBoxX();
                tb.Text            = entity.Name;
                cell.HostedControl = tb;
                advTree1.Nodes[0].Cells.Add(cell);

                // Add second row (is base)
                cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.CheckBoxItem checkbox = new DevComponents.DotNetBar.CheckBoxItem();
                cell.HostedItem          = checkbox;
                checkbox.CheckedChanged += new DevComponents.DotNetBar.CheckBoxChangeEventHandler(IsBaseCheckbox_CheckedChanged);
                advTree1.Nodes[1].Cells.Add(cell);

                // Add third row (discriminator-value textbox)
                cell               = new DevComponents.AdvTree.Cell();
                tb                 = new DevComponents.DotNetBar.Controls.TextBoxX();
                tb.Text            = entity.DiscriminatorValue;
                cell.HostedControl = tb;
                advTree1.Nodes[2].Cells.Add(cell);

                // Add row for all table columns (checkboxes)
                for (int i = 3; i < advTree1.Nodes.Count - 1; i++)
                {
                    cell = new DevComponents.AdvTree.Cell();
                    cell.CheckBoxAlignment  = DevComponents.AdvTree.eCellPartAlignment.Default;
                    cell.CheckBoxVisible    = true;
                    cell.CheckBoxStyle      = DevComponents.DotNetBar.eCheckBoxStyle.CheckBox;
                    cell.CheckBoxThreeState = false;
                    cell.Checked            = false;
                    advTree1.Nodes[i].Cells.Add(cell);
                }

                // Add bottom row (delete button)
                cell = new DevComponents.AdvTree.Cell();
                DevComponents.DotNetBar.ButtonItem button = new DevComponents.DotNetBar.ButtonItem();
                button.Text        = "Delete";
                button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                button.Image       = imageList1.Images[IMAGE_DELETE];
                superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Delete", "", "Delete this entity - it will be totally deleted from the model and also from this inheritance hierarchy.", imageListLarge.Images[IMAGE_DELETE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
                cell.HostedItem = button;
                button.Click   += new EventHandler(DeleteButton_Click);
                advTree1.Nodes[advTree1.Nodes.Count - 1].Cells.Add(cell);

                //// Add bottom row (remove button)
                //cell = new DevComponents.AdvTree.Cell();
                //button = new DevComponents.DotNetBar.ButtonItem();
                //button.Text = "Remove";
                //button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
                //button.Image = imageList1.Images[IMAGE_REMOVE];
                //superTooltip1.SetSuperTooltip(button, new DevComponents.DotNetBar.SuperTooltipInfo("Remove", "", "Remove this entity from this inheritance hierarchy.", imageListLarge.Images[IMAGE_REMOVE], null, DevComponents.DotNetBar.eTooltipColor.Silver));
                //cell.HostedItem = button;
                //button.Click += new EventHandler(RemoveButton_Click);
                //advTree1.Nodes[advTree1.Nodes.Count - 1].Cells.Add(cell);

                //if (advTree1.HScrollBarVisible && advTree1.HScrollBar != null)
                //{
                //    //advTree1.HorizontalScroll.Value = advTree1.HorizontalScroll.Maximum;

                //    //advTree1.HScrollBar.Value = advTree1.HScrollBar.Maximum;
                //    if (advTree1.HScrollBar.Maximum > advTree1.Width)
                //    {
                //        advTree1.AutoScroll = false;
                //        int v = advTree1.HScrollBar.Maximum - advTree1.Width;
                //        advTree1.HScrollBar.Value = v - 1;
                //        advTree1.Refresh();
                //        advTree1.HScrollBar.Value = v;
                //        advTree1.Refresh();
                //        advTree1.AutoScroll = true;
                //    }
                //    //double t = (double)((double)advTree1.HScrollBar.Value / advTree1.HScrollBar.Maximum) * advTree1.HorizontalScroll.Maximum;
                //    //advTree1.HorizontalScroll.Value = (int)Math.Floor(t);

                //}
            }
            finally
            {
                //advTree1.EndUpdate();
            }
            //this.Refresh();
        }
        private DevComponents.AdvTree.Node AddNode(DevComponents.AdvTree.Node parentNode, string tag, string name, string description, InputTypes inputType, object value, bool selected, SetOptionValue setOptionValue)
        {
            DevComponents.DotNetBar.SuperTooltipInfo tooltip = new DevComponents.DotNetBar.SuperTooltipInfo(name, null, description, null, null, DevComponents.DotNetBar.eTooltipColor.Gray);

            DevComponents.DotNetBar.Controls.CheckBoxX checkBoxSelect = new DevComponents.DotNetBar.Controls.CheckBoxX()
            {
                Checked = selected,
                Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled,
                BackColor = Color.Transparent,
                CheckBoxPosition = DevComponents.DotNetBar.eCheckBoxPosition.Right
            };
            DevComponents.AdvTree.Node newNode = new DevComponents.AdvTree.Node()
            {
                HostedControl = checkBoxSelect,
                Name = tag
            };
            DevComponents.AdvTree.Cell nameCell = new DevComponents.AdvTree.Cell()
            {
                Text = name
            };
            DevComponents.AdvTree.Cell valueCell = new DevComponents.AdvTree.Cell()
            {
                EditorType = DevComponents.AdvTree.eCellEditorType.Custom,
                Editable = true
            };
            switch (inputType)
            {
                case InputTypes.Double:
                    double? doubleValue = (double?)value;
                    DevComponents.Editors.DoubleInput doubleInput = new DevComponents.Editors.DoubleInput()
                    {
                        Value = doubleValue.HasValue ? doubleValue.Value : 0
                    };
                    valueCell.HostedControl = doubleInput;
                    doubleInput.ValueChanged += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, doubleInput, setOptionValue); };
                    break;
                case InputTypes.Integer:
                    int? intValue = (int?)value;
                    DevComponents.Editors.IntegerInput integerInput = new DevComponents.Editors.IntegerInput()
                    {
                        Value = intValue.HasValue ? intValue.Value : 0
                    };
                    valueCell.HostedControl = integerInput;
                    integerInput.ValueChanged += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, integerInput, setOptionValue); };
                    break;
                case InputTypes.String:
                    TextBox textBox = new TextBox()
                    {
                        Text = (string)value
                    };
                    valueCell.HostedControl = textBox;
                    textBox.TextChanged += delegate(object sender, EventArgs e) { ValueChanged(checkBoxSelect, textBox, setOptionValue); };
                    break;
                case InputTypes.Boolean:
                    bool? boolValue = (bool?)value;

                    DevComponents.DotNetBar.Controls.CheckBoxX checkBox = new DevComponents.DotNetBar.Controls.CheckBoxX()
                    {
                        Checked = boolValue.HasValue ? boolValue.Value : false,
                        Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled,
                        BackColor = Color.Transparent,
                    };
                    checkBox.CheckedChanged += delegate (object sender, EventArgs e) { ValueChanged(checkBoxSelect, checkBox, setOptionValue); };
                    valueCell.HostedControl = checkBox;
                    break;
                default:
                    throw new NotImplementedException("InputType not handled yet: " + inputType.ToString());
            }
            newNode.Cells.Add(nameCell);
            newNode.Cells.Add(valueCell);

            nameCell.Enabled = checkBoxSelect.Checked;
            valueCell.Enabled = checkBoxSelect.Checked;
            valueCell.HostedControl.Enabled = checkBoxSelect.Checked;

            superTooltip1.SetSuperTooltip(newNode, tooltip);
            superTooltip1.SetSuperTooltip(checkBoxSelect, tooltip);
            superTooltip1.SetSuperTooltip(valueCell.HostedControl, tooltip);

            checkBoxSelect.CheckedChanged += delegate
            {
                nameCell.Enabled = checkBoxSelect.Checked;
                valueCell.Enabled = checkBoxSelect.Checked;
                valueCell.HostedControl.Enabled = checkBoxSelect.Checked;

                if (checkBoxSelect.Checked)
                    valueCell.HostedControl.Focus();
            };
            if (parentNode == null)
                advTree1.Nodes.Add(newNode);
            else
                parentNode.Nodes.Add(newNode);

            return newNode;
        }