Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ public bool IsGroupAction
}

public UndoRedoState State { get; set; }
public bool FillColorChanged { get; set; }


protected override void OnPropertyChanged(string name)
{
Expand Down Expand Up @@ -297,7 +299,23 @@ protected override void OnPropertyChanged(string name)
this.HistoryManager.LogData(this, data);
}


if (node.FillColor != (SolidColorBrush)new BrushConverter().ConvertFromString("White"))
{
FillColorChanged = true;
}
node.FillColor = selectedFillBrush;
if (FillColorChanged)
{
HistoryEntry historyEntry = new HistoryEntry();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.GroupId = Guid.NewGuid();
historyEntry.UndoElements.Add(selectedFillBrush);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
FillColorChanged = false;
}
}

if (canLogData && !isGroupAction)
Expand Down Expand Up @@ -362,13 +380,52 @@ private void UpdateFormatingProperties(bool updateFontFamily = false, bool updat
}

if (updateFontFamily)
annotation.FontFamily = selectedFontFamily;
{
if (annotation.FontFamily == null || !annotation.FontFamily.Equals(selectedFontFamily))
{
annotation.FontFamily = selectedFontFamily;
HistoryEntry historyEntry = new HistoryEntry();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.GroupId = Guid.NewGuid();
historyEntry.UndoElements.Add(annotation.FontFamily);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
}

}

if (updateFontSize)
annotation.FontSize = selectedFontSize;
{
if (!annotation.FontSize.Equals(selectedFontSize))
{
annotation.FontSize = selectedFontSize;
HistoryEntry historyEntry = new HistoryEntry();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.GroupId = Guid.NewGuid();
historyEntry.UndoElements.Add(annotation.FontSize);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
}
}

if (updateFontColor)
annotation.Foreground = selectedFontBrush;
{

if (annotation.Foreground == null || !annotation.Foreground.Equals(selectedFontBrush))
{
annotation.Foreground = selectedFontBrush;
HistoryEntry historyEntry = new HistoryEntry();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.GroupId = Guid.NewGuid();
historyEntry.UndoElements.Add(annotation.Foreground);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
;
}
}
}
}
}
Expand All @@ -386,13 +443,52 @@ private void UpdateFormatingProperties(bool updateFontFamily = false, bool updat
}

if (updateFontFamily)
annotation.FontFamily = selectedFontFamily;
{
if (annotation.FontFamily == null || !annotation.FontFamily.Equals(selectedFontFamily))
{
annotation.FontFamily = selectedFontFamily;
HistoryEntry historyEntry = new HistoryEntry();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.GroupId = Guid.NewGuid();
historyEntry.UndoElements.Add(annotation.FontFamily);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
}
}

if (updateFontSize)
annotation.FontSize = selectedFontSize;
{
if (!annotation.FontSize.Equals(selectedFontSize))
{
annotation.FontSize = selectedFontSize;

HistoryEntry historyEntry = new HistoryEntry();
historyEntry.GroupId = Guid.NewGuid();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.UndoElements.Add(annotation.FontSize);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
}


}

if (updateFontColor)
annotation.Foreground = selectedFontBrush;
{
if (annotation.Foreground == null || !annotation.Foreground.Equals(selectedFontBrush))
{
annotation.Foreground = selectedFontBrush;
HistoryEntry historyEntry = new HistoryEntry();
historyEntry.Mode = EntryMode.External;
historyEntry.Action = HistoryAction.CustomAction;
historyEntry.GroupId = Guid.NewGuid();
historyEntry.UndoElements.Add(annotation.Foreground);
HistoryManager.UndoStack.Push(historyEntry);
OnHistoryChanged(obj);
}
}
}
}
}
Expand All @@ -402,6 +498,7 @@ private void UpdateFormatingProperties(bool updateFontFamily = false, bool updat
}

private bool canLogData = true;
private object obj;
private void OnItemSelected(object obj)
{
canLogData = false;
Expand Down