本文整理汇总了C#中Point2D.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Point2D.ToString方法的具体用法?C# Point2D.ToString怎么用?C# Point2D.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2D
的用法示例。
在下文中一共展示了Point2D.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Point2D<int> dot2D = new Point2D<int>(10, 20);
dot2D.ToString();
Point3D dot3D = new Point3D(10, 20, 30);
dot3D.ToString();
}
示例2: ToStringTest
public void ToStringTest()
{
Point1D<int> point1 = new Point1D<int>(5);
Point2D<int> point2 = new Point2D<int>(10, 0);
Point3D<int> point3 = new Point3D<int>(15, 16, 17);
Assert.AreEqual(point1.ToString(),"X: 5\n");
Assert.AreEqual(point2.ToString(), "X: 10,Y: 0\n");
Assert.AreEqual(point3.ToString(), "X: 15,Y: 16,Z: 17\n");
}
示例3: OnResponse
public override void OnResponse(NetState sender, RelayInfo info)
{
Point2D toSet;
bool shouldSet, shouldSend;
switch ( info.ButtonID )
{
case 1: // Current location
{
toSet = new Point2D(this.m_Mobile.Location);
shouldSet = true;
shouldSend = true;
break;
}
case 2: // Pick location
{
this.m_Mobile.Target = new InternalTarget(this.m_Property, this.m_Mobile, this.m_Object, this.m_Stack, this.m_Page, this.m_List);
toSet = Point2D.Zero;
shouldSet = false;
shouldSend = false;
break;
}
case 3: // Use values
{
TextRelay x = info.GetTextEntry(0);
TextRelay y = info.GetTextEntry(1);
toSet = new Point2D(x == null ? 0 : Utility.ToInt32(x.Text), y == null ? 0 : Utility.ToInt32(y.Text));
shouldSet = true;
shouldSend = true;
break;
}
default:
{
toSet = Point2D.Zero;
shouldSet = false;
shouldSend = true;
break;
}
}
if (shouldSet)
{
try
{
CommandLogging.LogChangeProperty(this.m_Mobile, this.m_Object, this.m_Property.Name, toSet.ToString());
this.m_Property.SetValue(this.m_Object, toSet, null);
}
catch
{
this.m_Mobile.SendMessage("An exception was caught. The property may not have changed.");
}
}
if (shouldSend)
this.m_Mobile.SendGump(new XmlPropertiesGump(this.m_Mobile, this.m_Object, this.m_Stack, this.m_List, this.m_Page));
}