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


C# IController.ViewProAttributeUpdate方法代码示例

本文整理汇总了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"))
开发者ID:wshanshan,项目名称:DDD,代码行数:67,代码来源:GUIController.cs


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