本文整理汇总了C#中Class2类的典型用法代码示例。如果您正苦于以下问题:C# Class2类的具体用法?C# Class2怎么用?C# Class2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Class2类属于命名空间,在下文中一共展示了Class2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Class2 c2 = new Class2();
MyDelegate d = c2.neuDelegate();
Class3 c3 = new Class3();
c3.callDelegate(d, "calling the delegate");
}
示例2: DataTemplate_Should_Match_Data_Of_Derived_Type
public void DataTemplate_Should_Match_Data_Of_Derived_Type()
{
var target = new DataTemplate { DataType = typeof(Class1) };
var data = new Class2();
Assert.True(target.Match(data));
}
示例3: Attached_Property_Should_Be_Validated
public void Attached_Property_Should_Be_Validated()
{
var target = new Class2();
target.SetValue(Class1.AttachedProperty, 15);
Assert.Equal(10, target.GetValue(Class1.AttachedProperty));
}
示例4: Func2
public void Func2()
{
object[] myObjects = new object[6];
myObjects[0] = new Class1();
myObjects[1] = new Class2();
myObjects[2] = "hello";
myObjects[3] = 123;
myObjects[4] = 123.4;
myObjects[5] = null;
for (int i = 0; i < myObjects.Length; ++i)
{
try
{
string s = (string)myObjects[i];
if (s != null)
{
// 1. conter
// dfaf
// dfafa
//afdfs
// 1.fafddaf
}
else
{
}
}
catch
{
}
}
}
示例5: displayMessage
public void displayMessage()
{
Class2 c = new Class2();
string message1 = c.message;
Bitmap image = new Bitmap(@"C:\Users\VARUN\Desktop\Capture.png");
MessageBox.Show(message1, "Sample");
}
示例6: test2
public void test2()
{
var class2 = new Class2();
var duplicate = class2.Duplicate();
AssertNotNull(duplicate);
}
示例7: Dump
internal static void Dump(AssistantDumper assistant, Class2 value, bool withSeparator = false)
{
assistant.IncrementDepth();
if (assistant.MaximumDepthExceeded())
return;
assistant.AddStartObject();
assistant.AddType("Dogen.TestModels.CSharpModel.Package1.Class2", true/*withSeparator*/);
if (value == null)
{
assistant.Add("data", "<null>");
assistant.AddEndObject();
return;
}
assistant.AddKey("data");
assistant.AddPairSeparator();
assistant.AddStartObject();
assistant.Add("Prop0", value.Prop0);
assistant.AddEndObject(); // data
assistant.AddEndObject(); // main object
assistant.HandleMemberSeparator(withSeparator);
assistant.DecrementDepth();
}
示例8: Pop_Ok
public void Pop_Ok()
{
var obj = new BootstrapContext(viewContext, null, null, null);
var obj1 = new Class1();
var obj2 = new Class2();
var obj3 = new Class1();
obj.Push(obj1);
obj.Push(obj2);
obj.Push(obj3);
// this throws error
try
{
obj.PopIfEqual(obj2);
Assert.True(false, "Should not got there :(");
} catch (ArgumentException)
{
// It,s Ok
}
// obj3 is still at last positon
obj.PopIfEqual(obj3);
// and now can POP obj2
obj.PopIfEqual(obj2);
// and obj1 is last one
obj.PopIfEqual(obj1);
// nothing more
Assert.Null(obj.PeekNearest<object>());
}
示例9: Main
static void Main(string[] args)
{
Class2 instance = new Class2();
Sample sample = new Sample(instance.method);
int result = sample(2 , 3);
Console.WriteLine(result);
}
示例10: Invoke
// https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2013/201303/20130319-dictionary
public Class2 Invoke(Class2 Class2)
{
this.Class2 = Class2;
Class2 = this.Class2;
return Class2;
}
示例11: Class1
public Class1()
{
if (true)
{
var foo = new Class2();
var task = Task.Run(() => {});
}
}
示例12: Main
static void Main()
{
Class1 a = new Class1();
a.Test();
Class2 b = new Class2();
b.Test();
}
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Class2 ad = new Class2();
DataSet abc = ad.GetAll();
GridView1.DataSource = abc;
GridView1.DataBind();
}
示例14: Button2_Click
protected void Button2_Click(object sender, EventArgs e)
{
Class2 ad = new Class2();
DataSet abc = ad.GetAll();
GridView1.DataSource = abc;
GridView1.DataBind();
}
示例15: GetValue_Returns_Inherited_Value
public void GetValue_Returns_Inherited_Value()
{
Class1 parent = new Class1();
Class2 child = new Class2 { Parent = parent };
parent.SetValue(Class1.BazProperty, "changed");
Assert.Equal("changed", child.GetValue(Class1.BazProperty));
}