RemoveDataModifiedHandler() public method

public RemoveDataModifiedHandler ( System.Action handler ) : void
handler System.Action
return void
Example #1
0
        void SetObjectData(ObjectData data)
        {
            activeData = data;

            Action handler = delegate() {
                if (RoomEditor != null)
                {
                    RoomEditor.OnObjectsModified();
                }

                UpdateDocumentation();
            };

            foreach (Gtk.Widget widget in objectDataContainer.Children)
            {
                objectDataContainer.Remove(widget);
                widget.Destroy();
            }
            if (ObjectDataEditor != null)
            {
                ObjectDataEditor.RemoveDataModifiedHandler(handler);
                ObjectDataEditor = null;
            }

            if (RoomEditor != null)
            {
                RoomEditor.OnObjectsModified();
            }

            if (data == null)
            {
                frameLabel.Text = "";
                return;
            }
            frameLabel.Text = ObjectNames[(int)activeData.GetObjectType()];

            ObjectDataEditor = new ValueReferenceEditor(Project, data);
            ObjectDataEditor.AddDataModifiedHandler(handler);

            if (SubEditor != null)
            {
                SubEditor.RoomEditor = RoomEditor;
            }

            objectDataContainer.Add(ObjectDataEditor);
            objectDataContainer.ShowAll();

            UpdateDocumentation();
        }
Example #2
0
        void SetObject(ObjectDefinition obj)
        {
            if (activeObject == obj)
            {
                return;
            }
            activeObject = obj;

            foreach (Gtk.Widget widget in objectDataContainer.Children)
            {
                objectDataContainer.Remove(widget);
                widget.Dispose();
            }
            if (ObjectDataEditor != null)
            {
                ObjectDataEditor.RemoveDataModifiedHandler(OnObjectDataModified);
                ObjectDataEditor = null;
            }

            if (RoomEditor != null)
            {
                RoomEditor.OnObjectSelected();
            }

            if (obj == null)
            {
                frameLabel.Text = "";
                return;
            }
            frameLabel.Text = ObjectNames[(int)activeObject.GetObjectType()];

            ObjectDataEditor = new ValueReferenceEditor(Project, obj);
            ObjectDataEditor.AddDataModifiedHandler(OnObjectDataModified);

            objectDataContainer.Add(ObjectDataEditor);
            objectDataContainer.ShowAll();

            UpdateDocumentation();
        }