CSSScript.SEItem.ToString C# (CSharp) Метод

ToString() публичный Метод

public ToString ( ) : string
Результат string
        public override string ToString()
        {
            if (isSeparator)
                return "------------------------";
            else
            {
                string[] parts = path.Split(Path.DirectorySeparatorChar);
                return parts[parts.Length - 1].Substring(3).Replace(".c.cmd", "").Replace(".cmd", "").Replace(".disabled", "");
            }
        }
        public string GetLogicalFileName()

Usage Example

Пример #1
0
        private void treeView1_DrawNode(object sender, DrawTreeNodeEventArgs e)
        {
            SEItem item = (SEItem)e.Node.Tag;

            Brush b = Brushes.Black;

            if (item.isConsole)
            {
                b = Brushes.Blue;
            }

            if (!item.Enabled)
            {
                b = Brushes.Gray;
            }
            else
            {
                TreeNode parent = e.Node.Parent;
                while (parent != null)
                {
                    if (!parent.Checked)
                    {
                        b = Brushes.Gray;
                        break;
                    }
                    parent = parent.Parent;
                }
            }

            Rectangle frame = e.Bounds;

            if ((e.State & TreeNodeStates.Selected) != 0)
            {
                frame.Width = (int)e.Graphics.MeasureString(item.ToString(), treeView1.Font).Width;
                e.Graphics.FillRectangle(TreeViewBackBrush, frame);
                frame.Inflate(-1, -1);
                e.Graphics.DrawRectangle(Pens.Red, frame);
            }

            if (item.isSeparator)
            {
                e.Graphics.DrawLine(Pens.Black, frame.Left + 4, frame.Top + frame.Height / 2, frame.Right - 4, frame.Top + frame.Height / 2);
            }
            else
            {
                e.Graphics.DrawString(item.ToString(), treeView1.Font, b, e.Bounds.Left, e.Bounds.Top + 2);
            }
        }
All Usage Examples Of CSSScript.SEItem::ToString