本文整理汇总了C#中IController.ViewProAttributeUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# IController.ViewProAttributeUpdate方法的具体用法?C# IController.ViewProAttributeUpdate怎么用?C# IController.ViewProAttributeUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IController
的用法示例。
在下文中一共展示了IController.ViewProAttributeUpdate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScenarioControllerLoop
//.........这里部分代码省略.........
}
}
catch (Exception e)
{
throw new ControllerException(Fmt_ErrorMsg("ViewProInitializeObject", e.Message + e.StackTrace));
}
break;
case "ViewProActiveRegionUpdate":
try
{
string ObjectId = ((StringValue)vpEvent.parameters["ObjectID"]).value;
if (ObjectId != null)
{
int color = ((IntegerValue)vpEvent.parameters["DisplayColor"]).value;
bool visible = ((BooleanValue)vpEvent.parameters["IsVisible"]).value;
List<PolygonValue.PolygonPoint> points = ((PolygonValue)vpEvent.parameters["Shape"]).points;
List<CustomVertex.TransformedColored> pointlist = new List<CustomVertex.TransformedColored>();
foreach (PolygonValue.PolygonPoint point in points)
{
pointlist.Add(new CustomVertex.TransformedColored(UTM_Mapping.HorizontalMetersToPixels((float)point.X), UTM_Mapping.VerticalMetersToPixels((float)point.Y), 1f, 1, color));
}
receiver.ActiveRegionUpdate(ObjectId, visible, color, pointlist);
}
}
catch (Exception e)
{
throw new ControllerException(Fmt_ErrorMsg("ViewProActiveRegionUpdate", e.Message + e.StackTrace));
}
break;
case "ViewProAttributeUpdate":
if (receiver is DDD_MainWinFormInterface)
{
while (((DDD_MainWinFormInterface)receiver).IsCanvasReady() == false)
{
Console.WriteLine("Canvas not ready...");
System.Threading.Thread.Sleep(300);
}
}
else
{
Console.WriteLine("receiver isn't win form interface.");
}
try
{
if (((StringValue)vpEvent.parameters["ObjectID"]).value != null)
{
_viewpro_attr_update.ObjectId = ((StringValue)vpEvent.parameters["ObjectID"]).value;
_viewpro_attr_update.PlayerId = ((StringValue)vpEvent.parameters["TargetPlayer"]).value;
_viewpro_attr_update.CapabilityAndWeapons = null;
if (vpEvent.parameters.ContainsKey("Attributes"))
{
if (((AttributeCollectionValue)vpEvent.parameters["Attributes"]).attributes.ContainsKey("State"))
{
_viewpro_attr_update.State = ((StringValue)((AttributeCollectionValue)vpEvent.parameters["Attributes"]).attributes["State"]).value;
}
else
{
_viewpro_attr_update.State = string.Empty;
}
if (((AttributeCollectionValue)vpEvent.parameters["Attributes"]).attributes.ContainsKey("Throttle"))