Пример #1
0
		public Annotation(CodeFile file, Similarity sim, IEnumerable<Annotation> existingAnnotations)
		{
			Func<Annotation, bool> func = null;
			Left = 0.0;
			//base..ctor();
			CodeFile = file;
			Similarity = sim;
			Height = (double)sim.MyRange.Length * Annotation.TextHeight;
			Top = (double)sim.MyRange.Start * Annotation.TextHeight;
			double3 = Top + Height;

			if (file == sim.OtherFile)
			{
				Brush = Annotation.brush2;
			}
			else
			{
				Brush = Annotation.brush1;
			}

			if (func == null)
			{
				func = new Func<Annotation, bool>(method0);
			}

			List<Annotation> list = existingAnnotations.Where(func).ToList<Annotation>();

			if (list.Count == 0)
			{
				Left = Annotation.double2 + 2.0;
			}
			else
			{
				IEnumerable<Annotation> annotations = list;

				if (Annotation.func0 == null)
				{
					Annotation.func0 = new Func<Annotation, double>(Annotation.smethod0);
				}

				double num = annotations.Max(Annotation.func0);
				Left = num + Annotation.double2 + Annotation.double1;
			}

			Margin = new Thickness(Left, Top, 0.0, 0.0);
		}
Пример #2
0
		private static CodeFile GetOtherFile(Similarity similarity)
		{
			return similarity.OtherFile;
		}
Пример #3
0
		private static int GetMyRangeLength(Similarity similarity)
		{
			return similarity.MyRange.Length;
		}
Пример #4
0
		public Annotation(CodeFile file, Similarity sim, IEnumerable<Annotation> existingAnnotations)
		{
			Func<Annotation, bool> func = null;
			this.double_5 = 0.0;
			base..ctor();
			this.codeFile_0 = file;
			this.similarity_0 = sim;
			this.double_3 = (double)sim.MyRange.Length * Annotation.TextHeight;
			this.double_4 = (double)sim.MyRange.Start * Annotation.TextHeight;
			this.double_2 = this.double_4 + this.double_3;
			if (file == sim.OtherFile)
			{
				this.brush_2 = Annotation.brush_1;
			}
			else
			{
				this.brush_2 = Annotation.brush_0;
			}
			if (func == null)
			{
				func = new Func<Annotation, bool>(this.method_0);
			}
			List<Annotation> list = existingAnnotations.Where(func).ToList<Annotation>();
			if (list.Count == 0)
			{
				this.double_5 = Annotation.double_1 + 2.0;
			}
			else
			{
				IEnumerable<Annotation> arg_EE_0 = list;
				if (Annotation.func_0 == null)
				{
					Annotation.func_0 = new Func<Annotation, double>(Annotation.smethod_0);
				}
				double num = arg_EE_0.Max(Annotation.func_0);
				this.double_5 = num + Annotation.double_1 + Annotation.double_0;
			}
			this.thickness_0 = new Thickness(this.double_5, this.double_4, 0.0, 0.0);
		}
Пример #5
0
 private static int smethod_3(Similarity similarity_1)
 {
     return(similarity_1.MyHashIndexRange.Length);
 }
Пример #6
0
		private static CodeFile smethod_11(Similarity similarity_0)
		{
			return similarity_0.OtherFile;
		}
Пример #7
0
		private static int smethod_9(Similarity similarity_0)
		{
			return similarity_0.MyHashIndexRange.Length;
		}
Пример #8
0
		private static void smethod4(CodeFile myFile, CodeFile otherFile, Sequence sequence)
		{
			Similarity similarity = new Similarity();
			similarity.MyFile = myFile;
			similarity.OtherFile = otherFile;
			similarity.MyHashIndexRange = new HashIndexRange
			{
				Start = sequence.FirstCoord.I,
				End = sequence.LastCoord.I + 1
			};
			similarity.OtherHashIndexRange = new HashIndexRange
			{
				Start = sequence.FirstCoord.J,
				End = sequence.LastCoord.J + 1
			};
			similarity.SetLineRanges();
			similarity.UniqueId = Analysis.int1;
			myFile.Similarities.Add(similarity);
			Similarity similarity2 = new Similarity();
			similarity2.MyFile = otherFile;
			similarity2.OtherFile = myFile;
			similarity2.OtherHashIndexRange = new HashIndexRange
			{
				Start = sequence.FirstCoord.I,
				End = sequence.LastCoord.I + 1
			};
			similarity2.MyHashIndexRange = new HashIndexRange
			{
				Start = sequence.FirstCoord.J,
				End = sequence.LastCoord.J + 1
			};
			similarity2.SetLineRanges();
			similarity.UniqueId = Analysis.int1;
			otherFile.Similarities.Add(similarity2);
			similarity.CorrespondingSimilarity = similarity2;
			similarity2.CorrespondingSimilarity = similarity;
			Analysis.int1++;
		}
Пример #9
0
		private static void smethod_4(CodeFile codeFile_0, CodeFile codeFile_1, Sequence sequence_0)
		{
			Similarity similarity = new Similarity();
			similarity.MyFile = codeFile_0;
			similarity.OtherFile = codeFile_1;
			similarity.MyHashIndexRange = new HashIndexRange
			{
				Start = sequence_0.FirstCoord.I,
				End = sequence_0.LastCoord.I + 1
			};
			similarity.OtherHashIndexRange = new HashIndexRange
			{
				Start = sequence_0.FirstCoord.J,
				End = sequence_0.LastCoord.J + 1
			};
			similarity.SetLineRanges();
			similarity.UniqueId = Analysis.int_1;
			codeFile_0.Similarities.Add(similarity);
			Similarity similarity2 = new Similarity();
			similarity2.MyFile = codeFile_1;
			similarity2.OtherFile = codeFile_0;
			similarity2.OtherHashIndexRange = new HashIndexRange
			{
				Start = sequence_0.FirstCoord.I,
				End = sequence_0.LastCoord.I + 1
			};
			similarity2.MyHashIndexRange = new HashIndexRange
			{
				Start = sequence_0.FirstCoord.J,
				End = sequence_0.LastCoord.J + 1
			};
			similarity2.SetLineRanges();
			similarity.UniqueId = Analysis.int_1;
			codeFile_1.Similarities.Add(similarity2);
			similarity.CorrespondingSimilarity = similarity2;
			similarity2.CorrespondingSimilarity = similarity;
			Analysis.int_1++;
		}
Пример #10
0
		private static void smethod_3(CodeFile codeFile_0, CodeFile codeFile_1, int int_2, List<int> sequenceBuilder, int int_3, int int_4, int[,] int_5)
		{
			if (sequenceBuilder.Count > int_2)
			{
				int arg_17_0 = sequenceBuilder.Count;
				int start = int_3 - int_5[int_3, int_4] + 1;
				int start2 = int_4 - int_5[int_3, int_4] + 1;
				Similarity similarity = new Similarity();
				similarity.MyFile = codeFile_0;
				similarity.OtherFile = codeFile_1;
				similarity.MyHashIndexRange = new HashIndexRange
				{
					Start = start,
					End = int_3
				};
				similarity.OtherHashIndexRange = new HashIndexRange
				{
					Start = start2,
					End = int_4
				};
				similarity.SetLineRanges();
				codeFile_0.Similarities.Add(similarity);
				if (codeFile_0 != codeFile_1)
				{
					Similarity similarity2 = new Similarity();
					similarity2.MyFile = codeFile_1;
					similarity2.OtherFile = codeFile_0;
					similarity2.OtherHashIndexRange = new HashIndexRange
					{
						Start = start,
						End = int_3
					};
					similarity2.MyHashIndexRange = new HashIndexRange
					{
						Start = start2,
						End = int_4
					};
					similarity2.SetLineRanges();
					codeFile_1.Similarities.Add(similarity2);
				}
			}
		}
Пример #11
0
		private static int smethod_0(Similarity similarity_0, Similarity similarity_1)
		{
			return similarity_0.MyRange.Start.CompareTo(similarity_1.MyRange.Start);
		}
Пример #12
0
 private static CodeFile GetOtherFile(Similarity similarity)
 {
     return(similarity.OtherFile);
 }
Пример #13
0
 private static int GetMyRangeLength(Similarity similarity)
 {
     return(similarity.MyRange.Length);
 }
Пример #14
0
 private static int CompareSimilarities(Similarity similarity1, Similarity similarity2)
 {
     return(similarity1.MyRange.Start.CompareTo(similarity2.MyRange.Start));
 }
Пример #15
0
		private static int smethod_1(Similarity similarity_1)
		{
			return similarity_1.MyRange.Length;
		}
Пример #16
0
		private static void smethod3(CodeFile myFile, CodeFile otherFile, int int2, List<int> sequenceBuilder, int myEnd, int otherEnd, int[,] int5)
		{
			if (sequenceBuilder.Count > int2)
			{
				int sequencesCount = sequenceBuilder.Count;
				int start = myEnd - int5[myEnd, otherEnd] + 1;
				int start2 = otherEnd - int5[myEnd, otherEnd] + 1;
				Similarity similarity = new Similarity();
				similarity.MyFile = myFile;
				similarity.OtherFile = otherFile;
				similarity.MyHashIndexRange = new HashIndexRange
				{
					Start = start,
					End = myEnd
				};
				similarity.OtherHashIndexRange = new HashIndexRange
				{
					Start = start2,
					End = otherEnd
				};
				similarity.SetLineRanges();

				myFile.Similarities.Add(similarity);

				if (myFile != otherFile)
				{
					Similarity similarity2 = new Similarity();
					similarity2.MyFile = otherFile;
					similarity2.OtherFile = myFile;
					similarity2.OtherHashIndexRange = new HashIndexRange
					{
						Start = start,
						End = myEnd
					};
					similarity2.MyHashIndexRange = new HashIndexRange
					{
						Start = start2,
						End = otherEnd
					};
					similarity2.SetLineRanges();
					otherFile.Similarities.Add(similarity2);
				}
			}
		}
		protected virtual Similarity OnCoerceSimilarity(Similarity value)
		{
			if (value == null)
			{
				this.method_1(0);
			}
			else
			{
				this.method_1(value.MyRange.Start);
			}
			return value;
		}
Пример #18
0
		private static int CompareSimilarities(Similarity similarity1, Similarity similarity2)
		{
			return similarity1.MyRange.Start.CompareTo(similarity2.MyRange.Start);
		}
		private static object smethod2(DependencyObject dependencyObject, Similarity similarity)
		{
			AnnotatedTextBox annotatedTextBox = dependencyObject as AnnotatedTextBox;
			object result;

			if (annotatedTextBox != null)
			{
				result = annotatedTextBox.OnCoerceSimilarity((Similarity)similarity);
			}
			else
			{
				result = similarity;
			}

			return result;
		}
Пример #20
0
		private static int smethod_10(Similarity similarity_0)
		{
			return similarity_0.MyRange.Length;
		}
		protected virtual Similarity OnCoerceSimilarity(Similarity similarity)
		{
			if (similarity == null)
			{
				method1(0);
			}
			else
			{
				method1(similarity.MyRange.Start);
			}

			return similarity;
		}
		protected virtual void OnSimilarityChanged(Similarity oldValue, Similarity newValue)
		{
		}
Пример #23
0
 private static int smethod_1(Similarity similarity_1)
 {
     return(similarity_1.MyRange.Length);
 }