Ejemplo n.º 1
0
        public override void Dispose()
        {
            /*
             * Gizmo.Instance.CommitModify -= new Gizmo.ChangeMofidyStateDelegate(this.d);
             * Gizmo.Instance.CloneAndSelectObjects -= new Gizmo.CloneAndSelectObjectsDelegate(this.e);
             * Gizmo.Instance.Objects.Clear();
             * //*/

            this.a();
            //MapHelper.DestroyMap();
            base.Dispose();
            EntityTypeResourceEditor.currentEditor = null;
        }
Ejemplo n.º 2
0
        public override void Create(ResourceType resourceType, string fileName)
        {
            base.Create(resourceType, fileName);
            currentEditor          = this;
            base.AllowEditMode     = true;
            this.currentEntityType = EntityTypes.Instance.FindByFilePath(fileName);
            if (this.currentEntityType != null)
            {
                try
                {
                    EntityTypes.Instance.DestroyType(this.currentEntityType);
                    EntityType entityType = EntityTypes.Instance.LoadTypeFromFile(fileName);
                    if (entityType == null)
                    {
                        throw new Exception(string.Format(this.Translate("Unable to load type \"{0}\"."), fileName));
                    }
                    EntityTypes.Instance.ChangeAllReferencesToType(this.currentEntityType, entityType);
                    this.currentEntityType = entityType;
                }
                catch (Exception ex)
                {
                    MainForm.Instance.NewMessage(ex.Message);
                    Log.Warning(ex.Message);
                    this.currentEntityType = null;
                }
            }
            if (this.currentEntityType != null)
            {
                this.SetSelectObject(this.currentEntityType, true, true);
            }
            else
            {
                MainForm.Instance.PropertiesForm.SelectObjects(null);
            }


            if (this.currentEntityType != null)
            {
                MainForm.Instance.PropertiesForm.CreateExtendedFunctionalityDescriptor(typeof(EntityTypeExtendedFunctionalityDescriptor), this);
            }
            else
            {
                MainForm.Instance.PropertiesForm.DestroyExtendedFunctionalityDescriptor();
            }

            /*
             * if (this.F())
             * {
             *  MapHelper.CreateMap();
             *  this.A();
             *  MapObject mapObject = this.awq as MapObject;
             *  if (mapObject != null)
             *  {
             *      base.SetCameraByBounds(mapObject.MapBounds);
             *  }
             *  else
             *  {
             *      base.SetCameraByBounds(new Bounds(new Vec3(-3f, -3f, -3f), new Vec3(3f, 3f, 3f)));
             *  }
             * }
             * else
             * {
             *  base.SetCameraByBounds(new Bounds(new Vec3(-10000f, -10000f, -10000f), new Vec3(-10001f, -10001f, -10001f)));
             * }
             * Gizmo.Instance.CommitModify += new Gizmo.ChangeMofidyStateDelegate(this.d);
             * Gizmo.Instance.CloneAndSelectObjects += new Gizmo.CloneAndSelectObjectsDelegate(this.e);
             * //*/
        }