Пример #1
0
        public void NotifyUpdate(bool entitiesNeedUpdate = true)
        {
            UpdateWindowTitle();

            if (entitiesNeedUpdate)
            {
                EntitiesForm.UpdateData();
            }
        }
Пример #2
0
        private void ContentForm_CanvasMouseDown(object sender, EventArgs e)
        {
            if (EntityTypeSelected != null)
            {
                EntityType entityType = EntityTypeSelected;
                ClearEntityTypeSelected();
                Log.Info("创建实体类: {0}", entityType);

                Entity   entity     = EntityWorld.Instance.CreateEntity(entityType);
                TreeNode parentNode = EntitiesForm.GetCurrentNodeLayer();
                EntitiesForm.CreateEntityNode(entity, parentNode);

                contentForm.SetContentLabel("实体创建: {0}", entity);
            }
        }
Пример #3
0
 void propertiesForm_PropertyValueChanged(object obj, GridItem gridItem, object obj2)
 {
     if (!this.Bjc)
     {
         List <object> list = this.ListGridItemValues(gridItem);
         if (list.Count != 0 && gridItem.Tag != null)
         {
             object[] array = (object[])gridItem.Tag;
             List <UndoObjectsPropertyChangeAction.Item> undoItems = new List <UndoObjectsPropertyChangeAction.Item>(list.Count);
             for (int i = 0; i < list.Count; i++)
             {
                 object       obj3     = list[i];
                 object       obj4     = array[i];
                 PropertyInfo property = list[i].GetType().GetProperty(gridItem.PropertyDescriptor.Name, gridItem.PropertyDescriptor.PropertyType);
                 if (property != null)
                 {
                     object value = property.GetValue(obj3, null);
                     if (!object.Equals(value, obj4))
                     {
                         undoItems.Add(new UndoObjectsPropertyChangeAction.Item(obj3, property, obj4));
                     }
                     if (obj3 is MapObject)
                     {
                         PropertyInfo property2 = obj3.GetType().GetProperty("AutoVerticalAlignment");
                         if (property2 == property)
                         {
                             PropertyInfo property3 = typeof(MapObject).GetProperty("Position");
                             PropertyInfo property4 = typeof(MapObject).GetProperty("Rotation");
                             MapObject    mapObject = (MapObject)obj3;
                         }
                     }
                     if (obj3 is MapObject)
                     {
                         MapObject    mapObject           = obj3 as MapObject;
                         string       editorLayerName     = ReflectionUtil.GetMemberName(() => mapObject.EditorLayer);
                         PropertyInfo propertyEditorLayer = obj3.GetType().GetProperty(editorLayerName);
                         if (propertyEditorLayer == property)
                         {
                             foreach (Entity current in EntityWorld.Instance.SelectedEntities)
                             {
                                 MapObject mapObject2 = current as MapObject;
                                 if (mapObject2 != null)
                                 {
                                     EntitiesForm.UpdateMapObjectLayer(mapObject2);
                                 }
                             }
                         }
                     }
                 }
             }
             if (undoItems.Count != 0)
             {
                 UndoObjectsPropertyChangeAction action = new UndoObjectsPropertyChangeAction(undoItems.ToArray());
                 UndoSystem.Instance.CommitAction(action);
                 MapWorld.Instance.Modified = true;
             }
             this.a(gridItem);
         }
     }
     else
     {
         this.Bjc = false;
     }
 }