日期:2014-05-17 浏览次数:21124 次
static class MyExtensionMethods
{
internal static void Print(this Class1 c)
{
}
}
public artial static void MethodName()
{
//todo
}
using System;
using System.Collections.Generic;
using System.Text;
namespace 拓展方法
{
class Program
{
static void Main(string[] args)
{
Class1 class1 = new Class1();
class1.Add("");
}
}
public class Class1
{
private string str;
public string Str { get; set; }
public Class1()
{ }
}
public static class ClassAdd
{
public static void Add(this Class1 class1, string str)
{
class1.Str += str;
}
}
}