当前位置: 首页>>代码示例>>C#>>正文


C# Class2类代码示例

本文整理汇总了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");
 }
开发者ID:amigodornot666,项目名称:mono-cs,代码行数:7,代码来源:delegate1.cs

示例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));
        }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:7,代码来源:DataTemplateTests.cs

示例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));
        }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:7,代码来源:AvaloniaObjectTests_Validation.cs

示例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
                {
                }

            }
        }
开发者ID:hanoKim,项目名称:Effective,代码行数:34,代码来源:1_Cast.cs

示例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");
 }
开发者ID:salmangadit,项目名称:project-pinnacle,代码行数:7,代码来源:Class1.cs

示例6: test2

        public void test2()
        {
            var class2 = new Class2();
            var duplicate = class2.Duplicate();

            AssertNotNull(duplicate);
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:7,代码来源:TestMemberwiseClone.cs

示例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();
        }
开发者ID:DomainDrivenConsulting,项目名称:dogen,代码行数:25,代码来源:Class2Dumper.cs

示例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>());
        }
开发者ID:andyshao,项目名称:BootstrapMvc,代码行数:33,代码来源:BootstrapContextTests.cs

示例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);
 }
开发者ID:basyura,项目名称:cs_sample,代码行数:7,代码来源:sample025.cs

示例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;
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:9,代码来源:Class1.cs

示例11: Class1

 public Class1()
 {
     if (true)
     {
         var foo = new Class2();
         var task = Task.Run(() => {});
     }
 }
开发者ID:pgrefviau,项目名称:SourceMaster,代码行数:8,代码来源:Class1.cs

示例12: Main

static void Main()
{
Class1 a = new Class1();
a.Test();
Class2 b = new Class2();
b.Test();

}
开发者ID:EdiCarlos,项目名称:MyPractices,代码行数:8,代码来源:usekey.cs

示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Class2 ad = new Class2();
        DataSet abc = ad.GetAll();

        GridView1.DataSource = abc;
        GridView1.DataBind();
    }
开发者ID:Soniaxia,项目名称:learngit,代码行数:8,代码来源:revise.aspx.cs

示例14: Button2_Click

    protected void Button2_Click(object sender, EventArgs e)
    {
        Class2 ad = new Class2();
        DataSet abc = ad.GetAll();

        GridView1.DataSource = abc;
        GridView1.DataBind();
    }
开发者ID:Soniaxia,项目名称:learngit,代码行数:8,代码来源:increase.aspx.cs

示例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));
        }
开发者ID:KvanTTT,项目名称:Perspex,代码行数:9,代码来源:PerspexObjectTests_GetValue.cs


注:本文中的Class2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。