Пример #1
0
        public void Do(Document doc)
        {
            Console.WriteLine(string.Format("Updating.  oldName={0}  newName={1}  newValue={2}", oldName, newName, newValue));

            SpriteDocument   sprite  = (SpriteDocument)doc;
            StringDictionary scripts = sprite.Metadata;

            if (!scripts.ContainsKey(oldName))
            {
                oldName = null;
            }

            if (scripts.ContainsKey(newName))
            {
                oldName = newName;
            }

            if (oldName != null)
            {
                oldValue = scripts[oldName];
            }
            scripts[newName] = newValue;

            if (oldName != null && oldName != newName)
            {
                scripts.Remove(oldName);
            }
            sprite.FireChanged();
        }
Пример #2
0
        public void Undo(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            sprite.Frames.RemoveAt(position);
            sprite.FireChanged();
        }
Пример #3
0
        public void Undo(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            sprite.Frames[position] = oldFrame;
            sprite.FireChanged();
        }
Пример #4
0
        public void Undo(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            sprite.HotSpot = oldHotSpot;
            sprite.FireChanged();
        }
Пример #5
0
        public void Undo(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            sprite.Frames.Insert(position, oldFrame);
            sprite.FireChanged();
        }
Пример #6
0
        public void Do(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            oldHotSpot     = sprite.HotSpot;
            sprite.HotSpot = newHotSpot;
            sprite.FireChanged();
        }
Пример #7
0
        public void Do(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            oldFrame = (Bitmap)sprite.Frames[position];
            sprite.Frames[position] = newFrame;
            sprite.FireChanged();
        }
Пример #8
0
        public void Do(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            Console.WriteLine(sprite.Size);

            sprite.Frames.Insert(position, bitmap);
            sprite.FireChanged();
        }
Пример #9
0
        public void Undo(Document doc)
        {
            SpriteDocument   sprite  = (SpriteDocument)doc;
            StringDictionary scripts = sprite.Metadata;

            for (int i = 0; i < names.Length; i++)
            {
                scripts[names[i]] = oldValues[i];
            }
            sprite.FireChanged();
        }
Пример #10
0
        public void Undo(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            ImageArray frames = (ImageArray)sprite.Frames;

            frames.Clear();
            frames.Resize(oldSize.Width, oldSize.Height);
            frames.AddRange(oldFrames);
            sprite.FireChanged();
        }
Пример #11
0
        public void Do(Document doc)
        {
            SpriteDocument   sprite  = (SpriteDocument)doc;
            StringDictionary scripts = sprite.Metadata;

            for (int i = 0; i < names.Length; i++)
            {
                oldValues[i] = scripts[names[i]];
                scripts.Remove(names[i]);
            }
            sprite.FireChanged();
        }
Пример #12
0
        public void Undo(Document doc)
        {
            SpriteDocument   sprite  = (SpriteDocument)doc;
            StringDictionary scripts = sprite.Metadata;

            scripts.Remove(newName);
            if (oldName != null)
            {
                scripts[oldName] = oldValue;
            }
            sprite.FireChanged();
        }
Пример #13
0
        public void Do(Document doc)
        {
            SpriteDocument sprite = (SpriteDocument)doc;

            oldSize = sprite.Size;

            oldFrames = new Bitmap[sprite.Frames.Count];
            for (int i = 0; i < sprite.Frames.Count; i++)
            {
                Bitmap frame = (Bitmap)sprite.Frames[i];
                oldFrames[i] = new Bitmap(frame);
            }

            sprite.Frames.Resize(newSize.Width, newSize.Height);
            sprite.FireChanged();
        }