• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TreeList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TreeList的典型用法代码示例。如果您正苦于以下问题:C# TreeList类的具体用法?C# TreeList怎么用?C# TreeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TreeList类属于命名空间,在下文中一共展示了TreeList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MakeTables

        void MakeTables(TreeList<CellBase> result)
        {
            string leader = string.Empty;
            TreeList<CellBase> table = null;
            scanner.MoveNext();
            do {
                if (scanner.Current.Type == TokenType.Leader) {
                    leader = scanner.Current.Content;
                    scanner.MoveNext();
                }
                else if (scanner.Current.Type == TokenType.Word) {
                    table = new TreeList<CellBase>(new CellBase(string.Empty));
                    table.Value.SetAttribute(CellAttribute.StartTag, "<p>");
                    table.Value.SetAttribute(CellAttribute.EndTag, "</p>");
                    if (leader.Length > 0) {
                        table.Value.SetAttribute(CellAttribute.Leader, leader);
                        leader = string.Empty;
                    }
                    result.AddBranch(table);
                    MakeRows(table);
                    if (scanner.Current.Type == TokenType.Newline) scanner.MoveNext();
                }
                else {
                    scanner.MoveNext();
                }
            } while (scanner.Current.Type != TokenType.End);

            if (table != null && scanner.Current.Content.Length > 0) {
                 table.Value.SetAttribute(CellAttribute.Trailer, scanner.Current.Content);
            }
        }
开发者ID:abombss,项目名称:fitsharp,代码行数:31,代码来源:TextTables.cs


示例2: SetCellDisableTree

        public static void SetCellDisableTree(TreeList tree,string FieldName,string KeyField,long[]KeyValues)
        {
            tree.CustomDrawNodeCell += delegate(object sender, CustomDrawNodeCellEventArgs e) {
                if (e.Node == tree.FocusedNode) {
                    return;
                }

                if (e.Column.FieldName == FieldName)
                {
                    for (int vt = 0; vt <= KeyValues.Length - 1; vt++)
                    {
                        if (Convert.ToInt64(e.Node.GetValue(KeyField)) == KeyValues[vt])
                        {
                            e.Appearance.BackColor = Color.LightGray;
                        }
                    }
                }
            };
            tree.ShowingEditor += delegate(object sender, CancelEventArgs e) {
                TreeListNode note = tree.FocusedNode;
                if (note != null)
                {
                    for (int vt = 0; vt <= KeyValues.Length - 1; vt++)
                    {
                        if (Convert.ToInt64(note.GetValue(KeyField)) == KeyValues[vt]
                            && tree.FocusedColumn.FieldName == FieldName)
                        {
                            e.Cancel = true;
                        }
                    }
                }
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:33,代码来源:frmTreeUserManExtUpdate.cs


示例3: RepositoryPLGridSelect

        public RepositoryPLGridSelect(XtraForm frmDanhMuc, string columnField, string tableName, string ValueField, string[] visibleField, string[] caption, string getField, TreeList treeList)
        {
            init();
            plDanhMuc.TreeList = treeList;
            plDanhMuc._init(frmDanhMuc ,columnField, tableName , ValueField , visibleField , caption , getField);

            treeList.GotFocus += delegate(object sender , EventArgs e)
            {
                if (treeList.DataSource != null &&
                        !((DataTable)treeList.DataSource).Columns.Contains(columnField + getField))
                {
                    ((DataTable)treeList.DataSource).Columns.Add(new DataColumn(columnField + getField));
                }
            };
            treeList.CellValueChanged += delegate(object sender , CellValueChangedEventArgs e)
            {
                if (e.Column.FieldName.Equals(columnField+getField))
                {
                    DataRowView rowView = (DataRowView)treeList.GetDataRecordByNode(e.Node);
                    DataRow row = rowView.Row;
                    row[columnField] = _getId(e.Value);
                }
            };
            this.Popup += new EventHandler(RepositoryHuyDanhMuc_Popup);
            this.Leave += new EventHandler(RepositoryDanhMucAdv_Leave);
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:26,代码来源:RepositoryPLGridSelect.cs


示例4: GetImage

        public override System.Drawing.Image GetImage(object element, TreeList.Column column)
        {
            if (element.GetType() == typeof(WorkoutWrapper))
            {
                WorkoutWrapper wrapper = (WorkoutWrapper)element;

                if (((Workout)wrapper.Element).IsDirty)
                {
                    return global::GarminFitnessPlugin.Resources.Resources.WorkoutDirtyIcon;
                }
                else if (((Workout)wrapper.Element).ContainsFITOnlyFeatures)
                {
                    return global::GarminFitnessPlugin.Resources.Resources.FITWorkoutIcon;
                }

                return global::GarminFitnessPlugin.Resources.Resources.WorkoutIcon;
            }
            if (element.GetType() == typeof(WorkoutPartWrapper))
            {
                return global::GarminFitnessPlugin.Resources.Resources.WorkoutPartIcon;
            }
            else if (element.GetType() == typeof(ActivityCategoryWrapper))
            {
                return global::GarminFitnessPlugin.Resources.Resources.CategoryIcon;
            }

            return base.GetImage(element, column);
        }
开发者ID:Digresiv,项目名称:garminworkouts,代码行数:28,代码来源:WorkoutIconLabelProvider.cs


示例5: ExecuteImportAddsNamespace

 public void ExecuteImportAddsNamespace()
 {
     var executeImport = new ExecuteImport();
     var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("import").AddBranchValue("fitnesse.unitTest.slim");
     ExecuteOperation(executeImport, input, 2);
     Assert.IsTrue(processor.Create("SampleClass").Value is SampleClass);
 }
开发者ID:unclebob,项目名称:nslim,代码行数:7,代码来源:ExecuteOperatorsTest.cs


示例6: ExecuteDefaultReturnsException

 public void ExecuteDefaultReturnsException()
 {
     var executeDefault = new ExecuteDefault();
     var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("garbage");
     ExecuteOperation(executeDefault, input, 2);
     CheckForException("message<<MALFORMED_INSTRUCTION step,garbage>>");
 }
开发者ID:unclebob,项目名称:nslim,代码行数:7,代码来源:ExecuteOperatorsTest.cs


示例7: PaintCell

        public virtual void PaintCell(Graphics dc, 
            Rectangle cellRect,
            Node node,
            TreeListColumn column,
            TreeList.TextFormatting format,
            object data)
        {
            if (format.BackColor != Color.Transparent)
            {
                Rectangle r = cellRect;
                r.X = column.CalculatedRect.X;
                r.Width = column.CalculatedRect.Width;
                SolidBrush brush = new SolidBrush(format.BackColor);
                dc.FillRectangle(brush, r);
                brush.Dispose();
            }
            if (data != null)
            {
                cellRect = CommonTools.Util.AdjustRectangle(cellRect, format.Padding);
                //dc.DrawRectangle(Pens.Black, cellRect);

                Color color = format.ForeColor;
                if (m_owner.FocusedNode == node && Application.RenderWithVisualStyles  == false)
                    color = SystemColors.HighlightText;
                TextFormatFlags flags= TextFormatFlags.EndEllipsis | format.GetFormattingFlags();
                TextRenderer.DrawText(dc, data.ToString(), m_owner.Font, cellRect, color, flags);
            }
        }
开发者ID:Diullei,项目名称:Storm,代码行数:28,代码来源:TreeListPainter.cs


示例8: ExecuteMakeBadClassReturnsException

 public void ExecuteMakeBadClassReturnsException()
 {
     var executeMake = new ExecuteMake();
     var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("make").AddBranchValue("variable").AddBranchValue("garbage");
     ExecuteOperation(executeMake, input, 2);
     CheckForException("message<<NO_CLASS garbage>>");
 }
开发者ID:unclebob,项目名称:nslim,代码行数:7,代码来源:ExecuteOperatorsTest.cs


示例9: Parse

 public Tree<CellBase> Parse(string input)
 {
     scanner = new TextTableScanner(input);
     var result = new TreeList<CellBase>(new CellBase(string.Empty));
     MakeTables(result);
     return result;
 }
开发者ID:abombss,项目名称:fitsharp,代码行数:7,代码来源:TextTables.cs


示例10: AddTreeListNode

 public TreeListNode AddTreeListNode(TreeList treelist, TreeListNode node, Type type, string propertyName, string defaultFunction, string validationFunction)
 {
     TreeListNode newNode = treelist.AppendNode(new object[] { propertyName, defaultFunction, validationFunction }, node);
     //newNode.ImageIndex = newNode.SelectImageIndex = (int)image;
     newNode.Tag = type;
     return newNode;
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:ucUserOptions.cs


示例11: GetEnableMouseMulSelect

 public bool GetEnableMouseMulSelect(TreeList treeList)
 {
     if (list.ContainsKey(treeList))
     {
         return list[treeList].EnableMouseMulSelect;
     }
     return false;
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_MouseMulSelect.cs


示例12: GetShowLineNo

 public bool GetShowLineNo(TreeList treelist)
 {
     if (StyleList.ContainsKey(treelist))
     {
         return StyleList[treelist].EnableLineNo;
     }
     return true;
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_ShowLine.cs


示例13: GetLineNoFormatString

 public string GetLineNoFormatString(TreeList treelist)
 {
     if (StyleList.ContainsKey(treelist))
     {
         return StyleList[treelist].LineNoFormatString;
     }
     return "{0}";
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_ShowLine.cs


示例14: GetEnableCommonStyle

 public bool GetEnableCommonStyle(TreeList treelist)
 {
     if (this.list.ContainsKey(treelist))
     {
         return list[treelist].EnableCommonStyle;
     }
     return true;
 }
开发者ID:dishiyicijinqiu,项目名称:OneCardAccess,代码行数:8,代码来源:TreeListCommonStyle.cs


示例15: DashboardListPresenter

 public DashboardListPresenter(TreeList tree, DashboardsFilterPaneViewModel viewModel)
 {
     _viewModel = viewModel;
     _tree = tree;
     InitTree();
     PopulateTree();
     Messenger.Default.Register<DashboardMessage>(this, OnDashboardMessage);
 }
开发者ID:sethjuarez,项目名称:DevAV,代码行数:8,代码来源:DashboardListPresenter.cs


示例16: XtraTreeListPrintAdapter

        /// <summary>
        /// Initializes a new instance of the <see cref="XtraTreeListPrintAdapter"/> class.
        /// </summary>
        /// <param name="adaptee">The adaptee.</param>
        /// <param name="workItem">The work item.</param>
        public XtraTreeListPrintAdapter(TreeList adaptee, WorkItem workItem)
        {
            this.adaptee = adaptee;
            this.workItem = workItem;
            xtrapService = new XtraPrintService(adaptee, adaptee.Text);

            RegisterEvent();
        }
开发者ID:wuyingyou,项目名称:uniframework,代码行数:13,代码来源:XtraTreeListPrintAdapter.cs


示例17: NodeParameters

 static Tree<string> NodeParameters(XmlNode node) {
     var result = new TreeList<string>()
         .AddBranchValue(node.InnerText);
     foreach (XmlAttribute attribute in node.Attributes) {
         result.AddBranchValue(attribute.Value);
     }
     return result;
 }
开发者ID:GibSral,项目名称:fitsharp,代码行数:8,代码来源:SuiteConfiguration.cs


示例18: GetEnableHotTrack

 public bool GetEnableHotTrack(TreeList treeList)
 {
     if (List.ContainsKey(treeList))
     {
         return List[treeList].EnableHotTrack;
     }
     return false;
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_HotTrack.cs


示例19: GetHotTrackColor

 public Color GetHotTrackColor(TreeList treeList)
 {
     if (List.ContainsKey(treeList))
     {
         return List[treeList].HotTrackColor;
     }
     return Color.FromArgb(213, 232, 255);
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_HotTrack.cs


示例20: ExecuteCallBadMethodReturnsException

 public void ExecuteCallBadMethodReturnsException()
 {
     processor.Store(new SavedInstance("variable", new SampleClass()));
     var executeCall = new ExecuteCall();
     var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("call").AddBranchValue("variable").AddBranchValue("garbage");
     ExecuteOperation(executeCall, input, 2);
     CheckForException("message<<NO_METHOD_IN_CLASS garbage fitnesse.unitTest.slim.SampleClass>>");
 }
开发者ID:unclebob,项目名称:nslim,代码行数:8,代码来源:ExecuteOperatorsTest.cs



注:本文中的TreeList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TreeListColumn类代码示例发布时间:2022-05-24
下一篇:
C# TreeItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap