Esempio n. 1
0
        public override void Modified(XElement source, XElement target)
        {
            // hack - there could be changes that we're not monitoring (e.g. attributes properties)
            var output = Output;

            State.Output = new StringWriter();

            ccomparer.Compare(source, target);
            icomparer.Compare(source, target);
            fcomparer.Compare(source, target);
            pcomparer.Compare(source, target);
            ecomparer.Compare(source, target);
            mcomparer.Compare(source, target);

            var si = source.Element("classes");

            if (si != null)
            {
                var ti = target.Element("classes");
                kcomparer = new NestedClassComparer();
                kcomparer.Compare(si.Elements("class"), ti == null ? null : ti.Elements("class"));
            }

            var s = (Output as StringWriter).ToString();

            State.Output = output;
            if (s.Length > 0)
            {
                Output.WriteLine("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName(target));
                Output.WriteLine(s);
            }
        }
Esempio n. 2
0
        public override void Modified(XElement source, XElement target, ApiChanges diff)
        {
            // hack - there could be changes that we're not monitoring (e.g. attributes properties)
            var output = Output;

            State.Output = new StringWriter();

            var sb = source.GetAttribute("base");
            var tb = target.GetAttribute("base");
            var rm = $"{State.Namespace}.{State.Type}: Modified base type: '{sb}' to '{tb}'";

            State.LogDebugMessage($"Possible -r value: {rm}");
            if (sb != tb &&
                !State.IgnoreRemoved.Any(re => re.IsMatch(rm)) &&
                !(State.IgnoreNonbreaking && IsBaseChangeCompatible(sb, tb)))
            {
                Formatter.BeginMemberModification(Output, "Modified base type");
                var apichange = new ApiChange($"{State.Namespace}.{State.Type}").AppendModified(sb, tb, true);
                Formatter.Diff(Output, apichange);
                Formatter.EndMemberModification(Output);
            }

            ccomparer.Compare(source, target);
            icomparer.Compare(source, target);
            fcomparer.Compare(source, target);
            pcomparer.Compare(source, target);
            ecomparer.Compare(source, target);
            mcomparer.Compare(source, target);

            var si = source.Element("classes");

            if (si != null)
            {
                var ti = target.Element("classes");
                kcomparer    = new NestedClassComparer();
                State.Parent = State.Type;
                kcomparer.Compare(si.Elements("class"), ti == null ? null : ti.Elements("class"));
                State.Type = State.Parent;
            }

            var s = (Output as StringWriter).ToString();

            State.Output = output;
            if (s.Length > 0)
            {
                SetContext(target);
                Formatter.BeginTypeModification(Output);
                Output.WriteLine(s);
                Formatter.EndTypeModification(Output);
            }
        }
        public override void Modified(XElement source, XElement target, ApiChanges diff)
        {
            // hack - there could be changes that we're not monitoring (e.g. attributes properties)
            var output = Output;

            State.Output = new StringWriter();

            var sb = source.GetAttribute("base");
            var tb = target.GetAttribute("base");
            var rm = $"{State.Namespace}.{State.Type}: Modified base type: '{sb}' to '{tb}'";

            State.LogDebugMessage($"Possible -r value: {rm}");
            if (sb != tb &&
                !State.IgnoreRemoved.Any(re => re.IsMatch(rm)) &&
                !(State.IgnoreNonbreaking && IsBaseChangeCompatible(sb, tb)))
            {
                Output.Write("Modified base type: ");
                Output.WriteLine(new ApiChange($"{State.Namespace}.{State.Type}").AppendModified(sb, tb, true).Member.ToString());
            }

            ccomparer.Compare(source, target);
            icomparer.Compare(source, target);
            fcomparer.Compare(source, target);
            pcomparer.Compare(source, target);
            ecomparer.Compare(source, target);
            mcomparer.Compare(source, target);

            var si = source.Element("classes");

            if (si != null)
            {
                var ti = target.Element("classes");
                kcomparer = new NestedClassComparer();
                kcomparer.Compare(si.Elements("class"), ti == null ? null : ti.Elements("class"));
            }

            var s = (Output as StringWriter).ToString();

            State.Output = output;
            if (s.Length > 0)
            {
                var tn = GetTypeName(target);
                Output.WriteLine("<!-- start type {0} --> <div>", tn);
                Output.WriteLine("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName(target));
                Output.WriteLine(s);
                Output.WriteLine("</div> <!-- end type {0} -->", tn);
            }
        }
Esempio n. 4
0
        public override void Modified(XElement source, XElement target, ApiChanges diff)
        {
            // hack - there could be changes that we're not monitoring (e.g. attributes properties)
            var output = Output;

            State.Output = new StringWriter();

            var sb = source.GetAttribute("base");
            var tb = target.GetAttribute("base");

            if (sb != tb)
            {
                Output.Write("Modified base type: ");
                Output.WriteLine(new ApiChange().AppendModified(sb, tb, true).Member.ToString());
            }

            ccomparer.Compare(source, target);
            icomparer.Compare(source, target);
            fcomparer.Compare(source, target);
            pcomparer.Compare(source, target);
            ecomparer.Compare(source, target);
            mcomparer.Compare(source, target);

            var si = source.Element("classes");

            if (si != null)
            {
                var ti = target.Element("classes");
                kcomparer = new NestedClassComparer();
                kcomparer.Compare(si.Elements("class"), ti == null ? null : ti.Elements("class"));
            }

            var s = (Output as StringWriter).ToString();

            State.Output = output;
            if (s.Length > 0)
            {
                var tn = GetTypeName(target);
                Output.WriteLine("<!-- start type {0} --> <div>", tn);
                Output.WriteLine("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName(target));
                Output.WriteLine(s);
                Output.WriteLine("</div> <!-- end type {0} -->", tn);
            }
        }