// Authors
// Sebastien Pouliot <sebastien@xamarin.com>
//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml.Linq;
return sb.ToString ();
}
- public override void BeforeAdding ()
+ public override void BeforeAdding (IEnumerable<XElement> list)
{
if (State.BaseType == "System.Enum")
- Output.WriteLine ("<p>Added values:</p><pre>");
+ Output.WriteLine ("<p>Added value{0}:</p><pre>", list.Count () > 1 ? "s" : String.Empty);
else
- base.BeforeAdding ();
+ base.BeforeAdding (list);
}
- public override void BeforeRemoving ()
+ public override void BeforeRemoving (IEnumerable<XElement> list)
{
if (State.BaseType == "System.Enum")
- Output.WriteLine ("<p>Removed values:</p><pre>");
+ Output.WriteLine ("<p>Removed value{0}:</p><pre>", list.Count () > 1 ? "s" : String.Empty);
else
- base.BeforeRemoving ();
+ base.BeforeRemoving (list);
}
}
}
\ No newline at end of file
// Authors
// Sebastien Pouliot <sebastien@xamarin.com>
//
-// Copyright 2013 Xamarin Inc. http://www.xamarin.com
+// Copyright 2013-2014 Xamarin Inc. http://www.xamarin.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
return;
if (s == null) {
- BeforeAdding ();
- foreach (var item in t.Elements (ElementName))
+ var items = t.Elements (ElementName);
+ BeforeAdding (items);
+ foreach (var item in items)
Added (item);
AfterAdding ();
} else if (t == null) {
- BeforeRemoving ();
- foreach (var item in s.Elements (ElementName))
+ var items = s.Elements (ElementName);
+ BeforeRemoving (items);
+ foreach (var item in items)
Removed (item);
AfterRemoving ();
} else {
foreach (var item in removed) {
SetContext (item);
if (!r) {
- BeforeRemoving ();
+ BeforeRemoving (removed);
r = true;
}
Removed (item);
if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
continue;
if (!a) {
- BeforeAdding ();
+ BeforeAdding (target);
a = true;
}
Added (item);
if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
continue;
if (!o) {
- BeforeObsoleting ();
+ BeforeObsoleting (obsoleted);
o = true;
}
Obsoleted (item);
if (o != null) {
sb.Append ("[Obsolete");
if (o.Length > 0)
- sb.Append (" \"").Append (o).Append ("\")");
+ sb.Append (" (\"").Append (o).Append ("\")");
sb.AppendLine ("]");
for (int i = 0; i < State.Indent + 1; i++)
sb.Append ('\t');
return (s.Length == 0 && t.Length > 0);
}
- public virtual void BeforeAdding ()
+ public virtual void BeforeAdding (IEnumerable<XElement> list)
{
- Output.WriteLine ("<p>Added {0}:</p><pre>", GroupName);
+ Output.WriteLine ("<p>Added {0}:</p><pre>", list.Count () > 1 ? GroupName : ElementName);
}
public override void Added (XElement target)
Output.WriteLine ("</pre>");
}
- public virtual void BeforeObsoleting ()
+ public virtual void BeforeObsoleting (IEnumerable<XElement> list)
{
- Output.WriteLine ("<p>Obsoleted {0}:</p><pre>", GroupName);
+ Output.WriteLine ("<p>Obsoleted {0}:</p><pre>", list.Count () > 1 ? GroupName : ElementName);
}
public void Obsoleted (XElement target)
{
}
- public virtual void BeforeRemoving ()
+ public virtual void BeforeRemoving (IEnumerable<XElement> list)
{
- Output.WriteLine ("<p>Removed {0}:</p><pre>", GroupName);
+ Output.WriteLine ("<p>Removed {0}:</p><pre>", list.Count () > 1 ? GroupName : ElementName);
}
public override void Removed (XElement source)