抽象我的类啊,在深夜

      我的日志 2007-3-29 0:44

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TEST
{
    public delegate bool processServ(string s1, ref string s2);  
    public class c1
    {
        public string  s = "1";
        public void test( string s1,ref string s2,processServ serv)
        {
           
            if (serv(s1,ref s2))
            {
                s = "2";
            }
        }
    }
    abstract public class c2:c1
    {
        public void query(string s1,ref string s2)
        {
            test(s1, ref s2, new processServ(service));
        }
        public abstract bool service(string s1, ref string s2);
      
    }
    public class c3:c2
    {

      
        public override bool service(string s1 , ref string s2)

        {
            return true;
        }

    }
  
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           string aa = "";
            new c3().query("aa",ref aa);
           
        }
       
      
    }
}

标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}