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


C# TestClass.ToString方法代码示例

本文整理汇总了C#中TestClass.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TestClass.ToString方法的具体用法?C# TestClass.ToString怎么用?C# TestClass.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestClass的用法示例。


在下文中一共展示了TestClass.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestToString

 public void TestToString()
 {
     TestClass testclass = new TestClass() { ID = 5, Decimal = 3.3M, Float = 3.23423F, String = "blah, \"asdff\"" };
     testclass.Class = new TestClass() { ID = 5, Decimal = 3.3M, Float = 3.23423F, String = "blah, \"asdff\"" };
     string actual = testclass.ToString(',');
     Assert.AreEqual("5,\"blah, \"\"asdff\"\"\",3.3,3.23423,\"5,\"blah, \"\"asdff\"\"\",3.3,3.23423\"", actual);
 }
开发者ID:nathanjuett,项目名称:com.ParttimeSoftware.HelpersThatShouldAlreadyBeThere,代码行数:7,代码来源:HelpersTest.cs

示例2: Main

	static void Main (string [] args)
	{
		string xsd = @"
			<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
				<xs:element name='TestClass'>
					<xs:complexType>
						<xs:sequence>
							<xs:element name='UnknownItemSerializer'
								type='UnknownItemSerializerType' />
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:complexType name='UnknownItemSerializerType'>
					<xs:sequence>
						<xs:element name='DerivedClass_1'>
							<xs:complexType>
								<xs:sequence>
									<xs:element name='value' type='xs:integer' />
								</xs:sequence>
							</xs:complexType>
						</xs:element>
					</xs:sequence>
					<xs:attribute name='type' type='xs:string' use='required' />
				</xs:complexType>
			</xs:schema>
			";

		TestClass a = new TestClass ();
		DerivedClass_1 d1 = new DerivedClass_1 ();

		a.Item = d1;
		String s = a.ToString ();

		XmlTextReader xtr = new XmlTextReader (new StringReader (s));

		XmlValidatingReader vr = new XmlValidatingReader (xtr);
		vr.Schemas.Add (XmlSchema.Read (new StringReader (xsd), null));
		vr.ValidationType = ValidationType.Schema;

		while (vr.Read ()) {
		}

	}
开发者ID:mono,项目名称:gert,代码行数:43,代码来源:test.cs

示例3: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			// Get our button from the layout resource,
			// and attach an event to it
			Button button = FindViewById<Button> (Resource.Id.myButton);
			button.Click += delegate {
				button.Text = string.Format ("{0} clicks!", count++);
				TestClass test = new TestClass ();
				test.ABoolean = count % 2 == 0;
				test.ADouble -= count;
				test.AFloat -= count;
				test.ALong -= count;
				test.AnInt += count;
				test.AString = button.Text;
				test.Toast (this, test.ToString());
			};

		}
开发者ID:wada811,项目名称:Xamarin.Android.Binding.Library,代码行数:23,代码来源:MainActivity.cs


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