Browse Source

Code now ensures that the Forms Designer UndoEngine has been created before checking that the undo/redo menu options should be enabled.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@792 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
3d377315d4
  1. 20
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs

20
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs

@ -147,9 +147,7 @@ namespace ICSharpCode.FormDesigner @@ -147,9 +147,7 @@ namespace ICSharpCode.FormDesigner
generator.Attach(this);
LoggingService.Debug("Creating UndoEngine.");
undoEngine = new FormDesignerUndoEngine(Host);
LoggingService.Debug("UndoEngine created.");
IComponentChangeService componentChangeService = (IComponentChangeService)designSurface.GetService(typeof(IComponentChangeService));
componentChangeService.ComponentChanged += delegate { viewContent.IsDirty = true; };
@ -338,22 +336,32 @@ namespace ICSharpCode.FormDesigner @@ -338,22 +336,32 @@ namespace ICSharpCode.FormDesigner
#region IUndoHandler implementation
public bool EnableUndo {
get {
return undoEngine.EnableUndo;
if (undoEngine != null) {
return undoEngine.EnableUndo;
}
return false;
}
}
public bool EnableRedo {
get {
return undoEngine.EnableRedo;
if (undoEngine != null) {
return undoEngine.EnableRedo;
}
return false;
}
}
public virtual void Undo()
{
undoEngine.Undo();
if (undoEngine != null) {
undoEngine.Undo();
}
}
public virtual void Redo()
{
undoEngine.Redo();
if (undoEngine != null) {
undoEngine.Redo();
}
}
#endregion

Loading…
Cancel
Save