Ejemplo n.º 1
0
        private String typeName; // "" if not set

        #endregion Fields

        #region Constructors

        public EntityEditorView(MainViewBase root,IntPtr inst, uint i, String name, EntityEditTargetType type)
        {
            InitializeComponent();

            hasType = false;

            instance = inst;

            rootView = root;

            targetId = i;
            targetType = type;

            Text = "Entity Editor - " + name + "[" + targetId + "]";

            this.name = name;
            nameBox.Text = name;

            //Fix right click on the treeview
            componentTreeView.MouseDown += (sender, args) => componentTreeView.SelectedNode = componentTreeView.GetNodeAt(args.X, args.Y);
        }
Ejemplo n.º 2
0
        //Only removes the typeEditor, used when the window has been closed.
        public void removeTypeEditor(uint targetid, EntityEditTargetType targetType)
        {
            for (int i = 0; i < entityEditorInstanceList.Count; ++i)
            {
                if(entityEditorInstanceList[i].view.getId() == targetid && entityEditorInstanceList[i].view.getTargetType() == targetType)
                {
                    entityEditorInstanceList.RemoveAt(i);

                    return;
                }
            }

            //These can happen on delete that is not related to typeeditor, cannot check for errors here.
        }
Ejemplo n.º 3
0
        //Closes the typeeditor window "removeTypeEditor" is called by the view "close" method.
        public void closeTypeEditor(uint targetid, EntityEditTargetType targetType)
        {
            for (int i = 0; i < entityEditorInstanceList.Count; ++i)
            {
                if(entityEditorInstanceList[i].view.getId() == targetid && entityEditorInstanceList[i].view.getTargetType() == targetType)
                {
                    entityEditorInstanceList[i].view.Invoke((MethodInvoker)(() => entityEditorInstanceList[i].view.Close()));

                    return;
                }
            }

            //These can happen on delete that is not related to typeeditor, cannot check for errors here.
        }