本文整理汇总了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 ()) {
}
}
示例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());
};
}