Ejemplo n.º 1
0
    void SetTileset(Tileset tileset)
    {
        if (Project == null)
        {
            return;
        }
        if (tileset == tilesetViewer1.Tileset)
        {
            return;
        }

        eventGroup.Lock();

        tilesetViewer1.SetTileset(tileset);
        ActiveRoom.TilesetIndex = tileset.Index;

        if (tilesetModifiedEventWrapper == null)
        {
            tilesetModifiedEventWrapper = new WeakEventWrapper <ValueReferenceGroup>();
            tilesetModifiedEventWrapper.Bind <ValueModifiedEventArgs>("ModifiedEvent",
                                                                      (sender, args) => UpdateLayoutGroupWarning());
        }
        tilesetModifiedEventWrapper.ReplaceEventSource(tileset.GetValueReferenceGroup());

        eventGroup.Unlock();

        UpdateLayoutGroupWarning();
    }