代码高亮测试

[cce_cs]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyDemo.@this
{
    /// <summary>
    /// 公司类
    /// </summary>
    public class Comparv
    {
        private string ceo;
        public string CEO
        {
            get { return ceo; }
            set { ceo = value; }
        }
        private string cio;
        public string CIO
        {
            get { return cio; }
            set { cio = value; }
        }

        private string cfo;
        public string CFO
        {
            get { return cfo; }
            set { cfo = value; }
        }

        public string this[string pos]
        {
            get
            {
                string name = String.Empty;
                switch (pos)
                {
                    case "ceo":
                        name = this.ceo;
                        break;

                    case "cio":
                        name = this.cio;
                        break;

                    case "cfo":
                        name = this.cfo;
                        break;
                    default:
                        break;
                }
                return name;
            }
            set
            {
                string name = String.Empty;
                switch (pos)
                {
                    case "ceo":
                        this.ceo = value;
                        break;

                    case "cio":
                        this.cio = value;
                        break;

                    case "cfo":
                        this.cfo = value;
                        break;
                    default:
                        break;
                }
            }
        }

        class Program
        {
            static void Main(string[] args)
            {
                Comparv com = new Comparv();
                com["ceo"] = "Bill Gatec";
                com["cfo"] = "Jim";
                com["cio"] = "scott";

                Console.WriteLine("ceo:{0},cfo:{1},cio:{2}", com["ceo"], com["cfo"], com["cio"]);
            }
        }
    }
}

[/cce_cs]

7 Replies to “代码高亮测试”

  1. Pingback: CodeColorer代码高亮插件 | 笨笨.Blog
  2. Pingback: CodeColorer代码高亮插件 | 笨笨.Blog

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据