本文整理汇总了C#中SimpleStruct.DisplayX方法的典型用法代码示例。如果您正苦于以下问题:C# SimpleStruct.DisplayX方法的具体用法?C# SimpleStruct.DisplayX怎么用?C# SimpleStruct.DisplayX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleStruct
的用法示例。
在下文中一共展示了SimpleStruct.DisplayX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
SimpleStruct ss = new SimpleStruct();
ss.X = 5;
ss.DisplayX();
SS si = (SS) ss;
si.X = 90;
si.DisplayX();
ss = (SimpleStruct) si ;
ss.X = 5;
ss.DisplayX();
SimpleClass ss1 = new SimpleClass();
ss1.X = 5;
ss1.DisplayX();
try {
ss1 = (SimpleClass) si ;
ss1.X = 5;
ss1.DisplayX();
}
catch(Exception)
{
Console.WriteLine("Failed to cast");
}
}
示例2: Start
// Use this for initialization
void Start()
{
feeding_rate = power / defence;
SimpleStruct ss = new SimpleStruct();
ss.X = 500;
ss.DisplayX();
}
示例3: Main
public static void Main()
{
Console.WriteLine("instaniante a ss structure object");
SimpleStruct ss = new SimpleStruct();
Console.WriteLine("Set the integer to 5 in the ss structure object");
ss.X = 5;
Console.WriteLine("Call the Displayx function in the ss structure object");
ss.DisplayX();
}
示例4: Main
public static void Main()
{
SimpleStruct ss = new SimpleStruct();
ss.X = 5;
ss.DisplayX();
}