Example #1
0
 private void trlUser_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (e.Node == trlUser.FocusedNode)
     {
         e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
     }
 }
Example #2
0
 private void trlPermission_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (e.Column == tlcFunctionName && e.Node == trlPermission.FocusedNode)
     {
         e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
     }
 }
Example #3
0
 void ModulesExplorer_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (e.Node == HotTrackNode)
     {
         e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Underline);
     }
 }
Example #4
0
 private void treeList1_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (e.Node.CheckState == CheckState.Unchecked)
     {
         //e.Appearance.Font = new Font(DevExpress.Utils.AppearanceObject.DefaultFont, FontStyle.Strikeout);
         e.Appearance.ForeColor = Color.Gray;
     }
 }
 private void treeList_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (e.Node.GetValue("PARENTID").ToString() == "000")
     {
         e.Appearance.BackColor = Color.Black;
         e.Appearance.ForeColor = Color.Yellow;
         e.Appearance.Font      = new Font("Times New Roman", 13, FontStyle.Bold ^ FontStyle.Italic);
     }
 }
Example #6
0
        /// <summary>
        /// TreeList的样式处理方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tlBoi_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
        {
            WBSLineNode boiNode = tlWBS.GetDataRecordByNode(e.Node) as WBSLineNode;

            if (boiNode != null && !String.IsNullOrEmpty(boiNode.WbsLineNo) && boiNode.StatId == 0)
            {
                e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Italic);
                e.Appearance.ForeColor = Color.Gray;
            }
        }
Example #7
0
 private void treeList1_NodeCellStyle_1(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (e.Node.HasChildren)
     {
         // --if (e.Node.Id % 2 == 0)
         e.Appearance.BackColor = Color.FromArgb(233, 255, 201); //Color.FromArgb(228, 250, 185);
     }
     else
     {
         e.Appearance.Font = new Font("Calibri", 18, FontStyle.Regular);
     }
     // else
     //    e.Appearance.BackColor = Color.FromArgb(228, 250, 185);
 }
Example #8
0
 /// <summary>
 /// 列配色优先
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 private bool RaiseColumnColor(DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     //if (!e.Column.AppearanceCell.BackColor.IsEmpty || e.Column.AppearanceCell.BackColor == Color.White) return ao;
     if (this.ColumnColor != null)
     {
         _CellStyle style = this.ColumnColor[this.ModelName][e.Column.FieldName];
         if (style != null)
         {
             e.Appearance.BackColor = style.BColor;
             return(true);
         }
     }
     return(false);
 }
Example #9
0
        /// <summary>
        /// TreeList的样式处理方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tlBoi_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
        {
            ContractBoiNode boiNode = tlDetail.GetDataRecordByNode(e.Node) as ContractBoiNode;

            if (boiNode != null && !String.IsNullOrEmpty(boiNode.ItemNo) && boiNode.StatId == 0)
            {
                e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Italic);
                e.Appearance.ForeColor = Color.Gray;
            }
            if (boiNode != null && boiNode.IsChanged && boiNode.Children.Count == 0)
            {
                e.Appearance.BackColor = Color.Yellow;
            }
            //if (viewModel.Editing)
            //{
            //   // if(boiNode.StatId==1)
            //}
        }
Example #10
0
 /// <summary>
 /// 其他项目 措施项目 汇总分析 树节点配色
 /// </summary>
 /// <param name="e"></param>
 private void RaiseGetCustomNodeCellStyleEx(DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     if (this.m_SchemeColor != null)
     {
         //类别颜色配置
         _SpecialStyleInfo style = null;
         string            str   = string.Format("一级[{0}]", this.ModelName);
         //string str =string.Format("T{0}",e.Node.Level);
         if (e.Node.Level == 0)
         {
             str = string.Format("一级[{0}]", this.ModelName);
         }
         if (e.Node.Level == 1)
         {
             str = string.Format("二级[{0}]", this.ModelName);
         }
         if (e.Node.Level == 2)
         {
             str = string.Format("三级[{0}]", this.ModelName);
         }
         if (e.Node.Level == 3)
         {
             str = string.Format("四级[{0}]", this.ModelName);
         }
         if (e.Node.Level == 4)
         {
             str = string.Format("五级[{0}]", this.ModelName);
         }
         style = this.m_SchemeColor.SpecialStyle.Get(str);
         if (style != null)
         {
             //e.Appearance.Font = new Font(e.Appearance.Font.FontFamily, e.Appearance.Font.Size, style.Font);
             //字体颜色
             e.Appearance.ForeColor = style.ForeColor;
             //背景颜色
             e.Appearance.BackColor = style.BColor;
             //扩展色
             //e.Appearance.BackColor2 = style.BColor2;
         }
         ///特殊配色时候自定义处理
         OnSetRowColor(this.GetDataRecordByNode(e.Node), this.m_SchemeColor, e.Appearance);
     }
     //
 }
Example #11
0
        /// <summary>
        /// 当默认配色执行完毕后调用特殊配色方案(各个模块调用特殊配色)
        /// </summary>
        /// <param name="e"></param>
        private void RaiseGetCustomNodeCellStyleEx(DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e, string p_FileName)
        {
            if (this.m_SchemeColor != null)
            {
                //类别颜色配置
                object obj = e.Node.GetValue(p_FileName);
                if (obj != null)
                {
                    string            str   = obj.ToString();
                    _SpecialStyleInfo style = null;
                    if (str == string.Empty)
                    {
                        style = this.m_SchemeColor.SpecialStyle.Get("单位工程");
                    }
                    else
                    {
                        //找不到按照层级处理
                        style = this.m_SchemeColor.SpecialStyle.Get(str);
                    }

                    if (style != null)
                    {
                        //e.Appearance.Font = new Font(e.Appearance.Font.FontFamily, e.Appearance.Font.Size, style.Font);
                        //字体颜色
                        e.Appearance.ForeColor = style.ForeColor;
                        //背景颜色
                        e.Appearance.BackColor = style.BColor;
                        //扩展色
                        //e.Appearance.BackColor2 = style.BColor2;
                    }

                    ///特殊配色时候自定义处理
                    OnSetRowColor(this.GetDataRecordByNode(e.Node), this.m_SchemeColor, e.Appearance);
                }
            }
            //
        }
Example #12
0
        protected override DevExpress.Utils.AppearanceObject RaiseGetCustomNodeCellStyle(DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
        {
            AppearanceObject ao = base.RaiseGetCustomNodeCellStyle(e);

            if (!e.Column.AppearanceCell.BackColor.IsEmpty)
            {
                if (e.Column.AppearanceCell.BackColor.ToArgb() != Color.White.ToArgb())
                {
                    return(ao);
                }
            }
            //if (!e.Column.AppearanceCell.BackColor.IsEmpty && e.Column.AppearanceCell.BackColor != Color.White) return ao;
            //如果当前行是焦点行或者是选中行直接返回
            if (this.FocusedNode == e.Node)
            {
                return(ao);
            }

            //如果找到列配色方案 直接返回ao
            //if (RaiseColumnColor(e)) return ao;

            //不同模块使用不同配色方式
            switch (this.ModelName)
            {
            case "分部分项":
                this.RaiseGetCustomNodeCellStyleEx(e, "LB");
                break;

            default:    //默认配色 按照Level配色
                this.RaiseGetCustomNodeCellStyleEx(e);
                break;
            }
            return(ao);
        }
Example #13
0
 private void treeList1_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
 }
Example #14
0
 private void treeList_menu_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     event_delegate_treeList_menu_NodeCellStyle(sender, e);
 }
        public static void TreeListNodeError(DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
        {
            return;

            TreeListNode treeListNode = e.Node;

            if (treeListNode.StateImageIndex == 0)
            {
                return;
            }

            if (ArchAngel.Providers.Database.BLL.Helper.GetBaseType(treeListNode.Tag) == typeof(ScriptBase))
            {
                ScriptBase scriptBase = (ScriptBase)treeListNode.Tag;
                if (scriptBase.Enabled)
                {
                    bool errorNode = false;
                    if (scriptBase.GetType() == typeof(ArchAngel.Providers.Database.Model.Table) ||
                        scriptBase.GetType() == typeof(ArchAngel.Providers.Database.Model.View) ||
                        scriptBase.GetType() == typeof(ArchAngel.Providers.Database.Model.StoredProcedure))
                    {
                        if (CountAlias(Controller.Instance.BllDatabase.EnabledScriptObjects, scriptBase.Alias) > 1)
                        {
                            errorNode = true;
                            //treeListNode.TreeList.SetColumnError(treeListNode.TreeList.Columns[0], "Duplicate alias: More than one item has the same alias. Right-click one of the duplicate nodes to change its name to be unique.");
                        }
                    }

                    if (scriptBase.GetType() == typeof(Column) ||
                        scriptBase.GetType() == typeof(MapColumn))
                    {
                        ScriptObject scriptObject = ((Column)scriptBase).Parent;
                        if (CountAlias(ScriptBLL.GetEnabledColumns(scriptObject.Columns), scriptBase.Alias) > 1)
                        {
                            errorNode = true;
                            //treeListNode.TreeList.SetColumnError(treeListNode.TreeList.Columns[0], "Duplicate alias: More than one column has the same alias. Right-click one of the duplicate columns to change its name to be unique.");
                        }
                    }

                    if (scriptBase.GetType() == typeof(Key))
                    {
                        ArchAngel.Providers.Database.Model.Table table = (ArchAngel.Providers.Database.Model.Table)((Key)scriptBase).Parent;
                        if (CountAlias(ScriptBLL.GetEnabledKeys(table.Keys), scriptBase.Alias) > 1)
                        {
                            errorNode = true;
                            //treeListNode.TreeList.SetColumnError(treeListNode.TreeList.Columns[0], "Duplicate alias: More than one key has the same alias. Right-click one of the duplicate keys to change its name to be unique.");
                        }
                    }

                    if (scriptBase.GetType() == typeof(Filter))
                    {
                        ScriptObject scriptObject = (ScriptObject)((Filter)scriptBase).Parent;
                        if (CountAlias(ScriptBLL.GetEnabledFilters(scriptObject.Filters), scriptBase.Alias) > 1)
                        {
                            errorNode = true;
                            //treeListNode.TreeList.SetColumnError(treeListNode.TreeList.Columns[0], "Duplicate alias: More than one filter has the same alias. Right-click one of the duplicate filters to change its name to be unique.");
                        }
                    }

                    if (scriptBase.GetType() == typeof(OneToOneRelationship) ||
                        scriptBase.GetType() == typeof(OneToManyRelationship) ||
                        scriptBase.GetType() == typeof(ManyToOneRelationship) ||
                        scriptBase.GetType() == typeof(ManyToManyRelationship))
                    {
                        ScriptObject scriptObject = (ScriptObject)((Relationship)scriptBase).Parent;
                        if (CountAlias(ScriptBLL.GetEnabledRelationships(scriptObject.Relationships), scriptBase.Alias) > 1)
                        {
                            errorNode = true;
                            //treeListNode.TreeList.SetColumnError(treeListNode.TreeList.Columns[0], "Duplicate alias: More than one relationship has the same alias. Right-click one of the duplicate relationships to change its name to be unique.");
                        }
                    }

                    if (errorNode)
                    {
                        e.Appearance.ForeColor = Color.Red;
                        // Parents are shown as red also

                        /*TreeListNode parentTreeListNode = treeListNode.ParentNode;
                         * while (parentTreeListNode != null)
                         * {
                         *  //parentTreeListNode.ForeColor = Color.Red;
                         *  parentTreeListNode = parentTreeListNode.ParentNode;
                         * }*/
                    }
                    else
                    {
                        //treeListNode.TreeList.ToolTipController.SetToolTip(treeListNode, "");
                    }
                }
            }

            /*foreach (TreeListNode childTreeListNode in treeListNode.Nodes)
             * {
             *  if (ArchAngel.Providers.Database.BLL.Helper.GetBaseType(childTreeListNode.Tag) == typeof(ScriptBase))
             *  {
             *      ScriptBase scriptBase = (ScriptBase)childTreeListNode.Tag;
             *      if (!scriptBase.Enabled)
             *      {
             *          continue;
             *      }
             *  }
             *
             *  TreeListNodeError(childTreeListNode);
             * }*/
        }
Example #16
0
 private void treeList1_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     //            var a = e.Node.GetValue(treeListColumnID);
 }
Example #17
0
 private void treeList1_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
 {
     /*DevExpress.Utils.AppearanceDefault def = new DevExpress.Utils.AppearanceDefault();
      * def.ForeColor = Color.Red;
      * e.Appearance.Assign(def);*/
 }