protected override HistoryMemento OnUndo()
 {
     HistoryMemento ha = new LayerPropertyHistoryMemento(Name, Image, this.historyWorkspace, this.layerIndex);
     Layer layer = (Layer)this.historyWorkspace.Document.Layers[layerIndex];
     layer.LoadProperties(properties, true);
     layer.PerformPropertyChanged();
     return ha;
 }
        protected override HistoryMemento OnUndo()
        {
            HistoryMemento ha    = new LayerPropertyHistoryMemento(Name, Image, this.historyWorkspace, this.layerIndex);
            Layer          layer = (Layer)this.historyWorkspace.Document.Layers[layerIndex];

            layer.LoadProperties(properties, true);
            layer.PerformPropertyChanged();
            return(ha);
        }
        protected override HistoryMemento OnUndo(ProgressEventHandler progressCallback)
        {
            HistoryMemento memento = new LayerPropertyHistoryMemento(base.Name, base.Image, this.historyWorkspace, this.layerIndex);
            Layer          layer   = (Layer)this.historyWorkspace.Document.Layers[this.layerIndex];

            layer.LoadProperties(this.properties, true);
            layer.PerformPropertyChanged();
            return(memento);
        }
        private void LayerPropertyChangingHandler(object sender, PropertyEventArgs e)
        {
            string nameFormat = PdnResources.GetString("LayerPropertyChanging.HistoryMementoNameFormat");
            string haName = string.Format(nameFormat, e.PropertyName);

            LayerPropertyHistoryMemento lpha = new LayerPropertyHistoryMemento(
                haName,
                PdnResources.GetImageResource("Icons.MenuLayersLayerPropertiesIcon.png"),
                this,
                this.Document.Layers.IndexOf(sender));

            this.History.PushNewMemento(lpha);
        }