Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            MethodOccurance other = obj as MethodOccurance;

            if (other != null)
            {
                return(this.Namespace == other.Namespace && this.Class == other.Class && this.Method == other.Method);
            }
            return(false);
        }
Exemplo n.º 2
0
        public static IEnumerable <XmlData> Read(XmlReader rdr)
        {
            try
            {
                Dictionary <MethodOccurance, MethodOccurance> members = new Dictionary <MethodOccurance, MethodOccurance>();
                XmlData instance = new XmlData(rdr);

                while (rdr.Read())
                {
                    string locName = rdr.LocalName;
                    if (StringComparer.Ordinal.Equals(locName, "coverage"))
                    {
                        instance.File.Read(instance);
                    }
                    else if (StringComparer.Ordinal.Equals(locName, "module"))
                    {
                        instance.Module.Read(instance);
                    }
                    else if (StringComparer.Ordinal.Equals(locName, "method"))
                    {
                        instance.Method.Read(instance);
                        MethodOccurance foundmo, mo = new MethodOccurance(instance.Method.Namespace, instance.Method.Class, instance.Method.name);
                        if (members.TryGetValue(mo, out foundmo))
                        {
                            instance.Method.name = instance.Name(
                                String.Format("{0}(overload {1})", instance.Method.name, ++foundmo.Counter)
                                );
                        }
                        else
                        {
                            members.Add(mo, mo);
                        }
                    }
                    else if (StringComparer.Ordinal.Equals(locName, "seqpnt"))
                    {
                        instance.Seqpnt.Read(instance);
                        yield return(instance);
                    }
                }
            }
            finally
            {
            }
        }
Exemplo n.º 3
0
		public static IEnumerable<XmlData> Read(XmlReader rdr)
		{
			try
			{
				Dictionary<MethodOccurance, MethodOccurance> members = new Dictionary<MethodOccurance, MethodOccurance>();
				XmlData instance = new XmlData(rdr);

				while (rdr.Read())
				{
					string locName = rdr.LocalName;
					if (StringComparer.Ordinal.Equals(locName, "coverage"))
						instance.File.Read(instance);
					else if (StringComparer.Ordinal.Equals(locName, "module"))
						instance.Module.Read(instance);
					else if (StringComparer.Ordinal.Equals(locName, "method"))
					{
						instance.Method.Read(instance);
						MethodOccurance foundmo, mo = new MethodOccurance(instance.Method.Namespace, instance.Method.Class, instance.Method.name);
						if (members.TryGetValue(mo, out foundmo))
						{
							instance.Method.name = instance.Name(
								String.Format("{0}(overload {1})", instance.Method.name, ++foundmo.Counter)
							);
						}
						else
							members.Add(mo, mo);
					}
					else if (StringComparer.Ordinal.Equals(locName, "seqpnt"))
					{
						instance.Seqpnt.Read(instance);
						yield return instance;
					}
				}
			}
			finally
			{
			}
		}