コード例 #1
0
        public void CanonicalSpline_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Point           position        = Mouse.GetPosition(canvas);
            CanonicalSpline canonicalSpline = (CanonicalSpline)sender;
            Similarity      similarity      = (Similarity)canonicalSpline.DataContext;
            double          num             = method4(canonicalSpline.Points[0], position);
            double          num2            = method4(canonicalSpline.Points[2], position);

            if (_eventHandler0 != null)
            {
                if (num < num2)
                {
                    _eventHandler0(this, new SimilaritySelectedEventArgs
                    {
                        Similarity = similarity
                    });
                }
                else
                {
                    _eventHandler0(this, new SimilaritySelectedEventArgs
                    {
                        Similarity = similarity.CorrespondingSimilarity
                    });
                }
            }
        }
コード例 #2
0
		internal void method_0()
		{
			this.double_0 = this.double_4 + (double)(this.wheelViewModel_0.DeepestDir + 1) * this.double_2;
			this.double_1 = this.double_0;
			base.Height = this.double_1 * 2.0;
			base.Width = this.double_0 * 2.0;
			this.canvas_0.Width = base.Width;
			this.canvas_0.Height = base.Height;
			Color.FromRgb(0, 102, 255);
			Color.FromRgb(255, 0, 0);
			Dictionary<CodeFile, PiePiece> dictionary = new Dictionary<CodeFile, PiePiece>();
			Dictionary<CodeDir, PiePiece> dictionary2 = new Dictionary<CodeDir, PiePiece>();
			Dictionary<PiePiece, double> dictionary3 = new Dictionary<PiePiece, double>();
			this.double_5 = this.double_4 + this.double_2;
			Ellipse element = new Ellipse
			{
				Height = base.Height * 2.0,
				Width = base.Width * 2.0,
				StrokeThickness = base.Width - this.double_4,
				Stroke = Brushes.Black
			};
			Canvas.SetTop(element, -1.0 * base.Height / 2.0);
			Canvas.SetLeft(element, -1.0 * base.Width / 2.0);
			Panel.SetZIndex(element, 5);
			this.canvas_0.Children.Add(element);
			double num = 0.0;
			double num2 = 360.0 / this.wheelViewModel_0.TotalLineSize;
			foreach (CodeFile current in this.wheelViewModel_0.CodeFiles)
			{
				PiePiece piePiece = new PiePiece();
				piePiece.Style = this.style_0;
				int num3 = this.wheelViewModel_0.DeepestDir - current.DirectParent.Depth;
				piePiece.method_11(this.double_0);
				piePiece.method_13(this.double_1);
				piePiece.method_1(this.double_5 + (double)num3 * this.double_2);
				piePiece.method_5(this.double_4);
				piePiece.method_9(num);
				piePiece.method_7(num2 * (double)current.ProcessedLines);
				num += piePiece.method_6();
				piePiece.DataContext = current;
				piePiece.Tag = current;
				piePiece.Stroke = Brushes.Black;
				piePiece.Fill = WheelView.smethod_0(piePiece);
				Panel.SetZIndex(piePiece, 10);
				piePiece.Cursor = Cursors.Hand;
				this.canvas_0.Children.Add(piePiece);
				dictionary.Add(current, piePiece);
				dictionary3.Add(piePiece, 0.0);
				this.method_1(piePiece, System.IO.Path.GetFileNameWithoutExtension(current.Name), 1.0);
			}
			double[] array = new double[this.wheelViewModel_0.DeepestDir + 1];
			foreach (CodeDir current2 in this.codeDir_0.GetAllDirectories())
			{
				int processedLines = current2.ProcessedLines;
				int num3 = this.wheelViewModel_0.DeepestDir - current2.Depth + 1;
				PiePiece piePiece = new PiePiece();
				piePiece.Style = this.style_1;
				piePiece.method_11(this.double_0);
				piePiece.method_13(this.double_1);
				piePiece.method_1(this.double_5 + (double)num3 * this.double_2);
				piePiece.method_5(this.double_4 + (double)num3 * this.double_2);
				CodeFile firstDeepestFile = current2.FirstDeepestFile;
				PiePiece piePiece2 = dictionary[firstDeepestFile];
				piePiece.method_9(piePiece2.method_8());
				piePiece.method_7(num2 * (double)processedLines);
				if (piePiece.method_6() >= 360.0)
				{
					piePiece.method_7(359.999);
				}
				array[num3] += piePiece.method_6();
				piePiece.DataContext = current2;
				piePiece.Tag = current2;
				piePiece.Stroke = Brushes.Black;
				piePiece.Fill = WheelView.smethod_0(piePiece);
				Panel.SetZIndex(piePiece, 10);
				piePiece.Cursor = Cursors.Hand;
				this.canvas_0.Children.Add(piePiece);
				dictionary2.Add(current2, piePiece);
				this.method_1(piePiece, System.IO.Path.GetFileName(current2.Name), 0.8);
			}
			IEnumerable<Similarity> enumerable = this.wheelViewModel_0.method_1();
			foreach (Similarity current3 in enumerable)
			{
				CanonicalSpline canonicalSpline = new CanonicalSpline();
				canonicalSpline.Tolerance = 1.5;
				canonicalSpline.DataContext = current3;
				canonicalSpline.Points = new PointCollection();
				canonicalSpline.Cursor = Cursors.Hand;
				Panel.SetZIndex(canonicalSpline, 0);
				canonicalSpline.StrokeThickness = (double)current3.MyHashIndexRange.Length * (num2 / 360.0 * this.double_4 * 2.0 * 3.14159);
				canonicalSpline.Stroke = (current3.SameFile ? WheelView.brush_1 : WheelView.brush_0);
				PiePiece piePiece3 = dictionary[current3.MyFile];
				PiePiece piePiece4 = dictionary[current3.OtherFile];
				double num4 = piePiece3.method_8() + dictionary3[piePiece3] + (double)current3.MyHashIndexRange.Length * num2 / 2.0;
				Point point = Utils.ComputeCartesianCoordinate(num4, this.double_4, this.double_0, this.double_1);
				Point value = Utils.ComputeCartesianCoordinate(num4, this.double_4 + this.double_4 / 3.0, this.double_0, this.double_1);
				Dictionary<PiePiece, double> dictionary4;
				PiePiece key;
				(dictionary4 = dictionary3)[key = piePiece3] = dictionary4[key] + (double)current3.MyHashIndexRange.Length * num2;
				double num5 = piePiece4.method_8() + dictionary3[piePiece4] + (double)current3.OtherHashIndexRange.Length * num2 / 2.0;
				Point point2 = Utils.ComputeCartesianCoordinate(num5, this.double_4, this.double_0, this.double_1);
				Point value2 = Utils.ComputeCartesianCoordinate(num5, this.double_4 + this.double_4 / 3.0, this.double_0, this.double_1);
				(dictionary4 = dictionary3)[key = piePiece4] = dictionary4[key] + (double)current3.OtherHashIndexRange.Length * num2;
				double num6 = this.method_3(num4, num5);
				double num7 = this.double_4 - num6 / 180.0 * this.double_4;
				if (num7 > this.double_4 / 1.2)
				{
					num7 = this.double_4 / 1.2;
				}
				double angle = this.method_2(num4, num5);
				Point value3 = Utils.ComputeCartesianCoordinate(angle, num7, this.double_0, this.double_1);
				canonicalSpline.Points.Add(value);
				canonicalSpline.Points.Add(point);
				canonicalSpline.Points.Add(value3);
				canonicalSpline.Points.Add(point2);
				canonicalSpline.Points.Add(value2);
				canonicalSpline.Stroke = new LinearGradientBrush(((SolidColorBrush)piePiece4.Fill).Color, ((SolidColorBrush)piePiece3.Fill).Color, point, point2)
				{
					MappingMode = BrushMappingMode.Absolute
				};
				this.canvas_0.Children.Add(canonicalSpline);
			}
		}
コード例 #3
0
        internal void WheelViewLoaded()
        {
            double0       = double4 + (double)(_wheelViewModel.DeepestDir + 1) * double2;
            double1       = double0;
            base.Height   = double1 * 2.0;
            base.Width    = double0 * 2.0;
            canvas.Width  = base.Width;
            canvas.Height = base.Height;
            Color.FromRgb(0, 102, 255);
            Color.FromRgb(255, 0, 0);
            Dictionary <CodeFile, PiePiece> dictionary  = new Dictionary <CodeFile, PiePiece>();
            Dictionary <CodeDir, PiePiece>  dictionary2 = new Dictionary <CodeDir, PiePiece>();
            Dictionary <PiePiece, double>   dictionary3 = new Dictionary <PiePiece, double>();

            double5 = double4 + double2;
            Ellipse element = new Ellipse
            {
                Height          = base.Height * 2.0,
                Width           = base.Width * 2.0,
                StrokeThickness = base.Width - double4,
                Stroke          = Brushes.Black
            };

            Canvas.SetTop(element, -1.0 * base.Height / 2.0);
            Canvas.SetLeft(element, -1.0 * base.Width / 2.0);
            Panel.SetZIndex(element, 5);
            canvas.Children.Add(element);
            double num  = 0.0;
            double num2 = 360.0 / _wheelViewModel.TotalLineSize;

            foreach (CodeFile current in _wheelViewModel.CodeFiles)
            {
                PiePiece piePiece = new PiePiece();
                piePiece.Style = _style0;
                int num3 = _wheelViewModel.DeepestDir - current.DirectParent.Depth;
                piePiece.method11(double0);
                piePiece.method13(double1);
                piePiece.method1(double5 + (double)num3 * double2);
                piePiece.method5(double4);
                piePiece.method9(num);
                piePiece.method7(num2 * (double)current.ProcessedLines);
                num += piePiece.method6();
                piePiece.DataContext = current;
                piePiece.Tag         = current;
                piePiece.Stroke      = Brushes.Black;
                piePiece.Fill        = WheelView.smethod0(piePiece);
                Panel.SetZIndex(piePiece, 10);
                piePiece.Cursor = Cursors.Hand;
                canvas.Children.Add(piePiece);
                dictionary.Add(current, piePiece);
                dictionary3.Add(piePiece, 0.0);
                method1(piePiece, System.IO.Path.GetFileNameWithoutExtension(current.Name), 1.0);
            }

            double[] array = new double[_wheelViewModel.DeepestDir + 1];

            foreach (CodeDir current2 in _codeDir.GetAllDirectories())
            {
                int      processedLines = current2.ProcessedLines;
                int      num3           = _wheelViewModel.DeepestDir - current2.Depth + 1;
                PiePiece piePiece       = new PiePiece();
                piePiece.Style = this._style1;
                piePiece.method11(double0);
                piePiece.method13(double1);
                piePiece.method1(double5 + (double)num3 * double2);
                piePiece.method5(double4 + (double)num3 * double2);
                CodeFile firstDeepestFile = current2.FirstDeepestFile;
                PiePiece piePiece2        = dictionary[firstDeepestFile];
                piePiece.method9(piePiece2.method8());
                piePiece.method7(num2 * (double)processedLines);

                if (piePiece.method6() >= 360.0)
                {
                    piePiece.method7(359.999);
                }

                array[num3]         += piePiece.method6();
                piePiece.DataContext = current2;
                piePiece.Tag         = current2;
                piePiece.Stroke      = Brushes.Black;
                piePiece.Fill        = WheelView.smethod0(piePiece);
                Panel.SetZIndex(piePiece, 10);
                piePiece.Cursor = Cursors.Hand;
                canvas.Children.Add(piePiece);
                dictionary2.Add(current2, piePiece);
                method1(piePiece, System.IO.Path.GetFileName(current2.Name), 0.8);
            }

            IEnumerable <Similarity> enumerable = _wheelViewModel.method1();

            foreach (Similarity current3 in enumerable)
            {
                CanonicalSpline canonicalSpline = new CanonicalSpline();
                canonicalSpline.Tolerance   = 1.5;
                canonicalSpline.DataContext = current3;
                canonicalSpline.Points      = new PointCollection();
                canonicalSpline.Cursor      = Cursors.Hand;
                Panel.SetZIndex(canonicalSpline, 0);
                canonicalSpline.StrokeThickness = (double)current3.MyHashIndexRange.Length * (num2 / 360.0 * double4 * 2.0 * 3.14159);
                canonicalSpline.Stroke          = (current3.SameFile ? WheelView._brush1 : WheelView._brush0);
                PiePiece piePiece3 = dictionary[current3.MyFile];
                PiePiece piePiece4 = dictionary[current3.OtherFile];
                double   num4      = piePiece3.method8() + dictionary3[piePiece3] + (double)current3.MyHashIndexRange.Length * num2 / 2.0;
                Point    point     = Utils.ComputeCartesianCoordinate(num4, double4, double0, double1);
                Point    value     = Utils.ComputeCartesianCoordinate(num4, double4 + double4 / 3.0, double0, double1);
                Dictionary <PiePiece, double> dictionary4;
                PiePiece key;
                (dictionary4 = dictionary3)[key = piePiece3] = dictionary4[key] + (double)current3.MyHashIndexRange.Length * num2;
                double num5   = piePiece4.method8() + dictionary3[piePiece4] + (double)current3.OtherHashIndexRange.Length * num2 / 2.0;
                Point  point2 = Utils.ComputeCartesianCoordinate(num5, double4, double0, double1);
                Point  value2 = Utils.ComputeCartesianCoordinate(num5, double4 + double4 / 3.0, double0, double1);
                (dictionary4 = dictionary3)[key = piePiece4] = dictionary4[key] + (double)current3.OtherHashIndexRange.Length * num2;
                double num6 = method3(num4, num5);
                double num7 = double4 - num6 / 180.0 * double4;

                if (num7 > double4 / 1.2)
                {
                    num7 = double4 / 1.2;
                }

                double angle  = method2(num4, num5);
                Point  value3 = Utils.ComputeCartesianCoordinate(angle, num7, double0, double1);
                canonicalSpline.Points.Add(value);
                canonicalSpline.Points.Add(point);
                canonicalSpline.Points.Add(value3);
                canonicalSpline.Points.Add(point2);
                canonicalSpline.Points.Add(value2);
                canonicalSpline.Stroke = new LinearGradientBrush(((SolidColorBrush)piePiece4.Fill).Color, ((SolidColorBrush)piePiece3.Fill).Color, point, point2)
                {
                    MappingMode = BrushMappingMode.Absolute
                };

                canvas.Children.Add(canonicalSpline);
            }
        }