コード例 #1
0
        private void ResizeResultIndicators()
        {
            // re-size and re-position result indicators when size of window
            // and thereby possibly also size of canvas has changed.
            double diameter;

            diameter = GetCurrentDiameter();
            if (FoundProducts != null)
            {
                long fprows = FoundProducts.GetLength(0);
                long fpcols = FoundProducts.GetLength(1);
                for (long i = 0; i < fprows; i++)
                {
                    for (long j = 0; j < fpcols; j++)
                    {
                        if (FoundProducts[i, j] != null)
                        {
                            FoundProducts[i, j].Width  = diameter * (1 - 2 * smallmargfract);
                            FoundProducts[i, j].Height = diameter * (1 - 2 * smallmargfract);
                            Canvas.SetBottom(FoundProducts[i, j], (i * diameter) + (diameter * smallmargfract));
                            Canvas.SetLeft(FoundProducts[i, j], (j * diameter) + (diameter * smallmargfract));
                            if (FoundProducts[i, j].StrokeThickness > 0)
                            {
                                FoundProducts[i, j].StrokeThickness = diameter * smallmargfract;
                            }
                        }
                    }
                }
            }
            if (FoundFactors != null)
            {
                long ffrows = FoundFactors.GetLength(0);
                long ffcols = FoundFactors.GetLength(1);
                for (long i = 0; i < ffrows; i++)
                {
                    for (long j = 0; j < ffcols; j++)
                    {
                        if (FoundFactors[i, j] != null)
                        {
                            FoundFactors[i, j].Width  = diameter * (1 - 2 * bigmargfract);
                            FoundFactors[i, j].Height = diameter * (1 - 2 * bigmargfract);
                            Canvas.SetBottom(FoundFactors[i, j], (i * diameter) + (diameter * bigmargfract));
                            Canvas.SetLeft(FoundFactors[i, j], (j * diameter) + (diameter * bigmargfract));
                            if (FoundFactors[i, j].StrokeThickness > 0)
                            {
                                FoundFactors[i, j].StrokeThickness = diameter * smallmargfract;
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
 private void StandardToolTipFactors()
 {
     if (FoundFactors != null)
     {
         long ffrows = FoundFactors.GetLength(0);
         long ffcols = FoundFactors.GetLength(1);
         for (long i = 0; i < ffrows; i++)
         {
             for (long j = 0; j < ffcols; j++)
             {
                 if (FoundFactors[i, j] != null)
                 {
                     FoundFactors[i, j].ToolTip = null;;
                 }
             }
         }
     }
 }
コード例 #3
0
 private void StandardOutlineFactors()
 {
     if (FoundFactors != null)
     {
         long ffrows = FoundFactors.GetLength(0);
         long ffcols = FoundFactors.GetLength(1);
         for (long i = 0; i < ffrows; i++)
         {
             for (long j = 0; j < ffcols; j++)
             {
                 if (FoundFactors[i, j] != null)
                 {
                     SolidColorBrush LineBrush = new SolidColorBrush();
                     LineBrush.Color                    = Color.FromRgb(255, 255, 255);
                     FoundFactors[i, j].Stroke          = LineBrush;
                     FoundFactors[i, j].StrokeThickness = 0;
                 }
             }
         }
     }
 }
コード例 #4
0
 private void StandardColorFactors()
 {
     if (FoundFactors != null)
     {
         long ffrows = FoundFactors.GetLength(0);
         long ffcols = FoundFactors.GetLength(1);
         for (long i = 0; i < ffrows; i++)
         {
             for (long j = 0; j < ffcols; j++)
             {
                 if (FoundFactors[i, j] != null)
                 {
                     SolidColorBrush myBrush = new SolidColorBrush();
                     myBrush.Color                      = Color.FromRgb(100, 100, 100);
                     FoundFactors[i, j].Fill            = myBrush;
                     FoundFactors[i, j].StrokeThickness = 0;
                 }
             }
         }
     }
 }
コード例 #5
0
 private void CleanUpDrawingElements()
 {
     CorrectFactorNum = null;
     if (FoundProducts != null)
     {
         long fprows = FoundProducts.GetLength(0);
         long fpcols = FoundProducts.GetLength(1);
         for (long i = 0; i < fprows; i++)
         {
             for (long j = 0; j < fpcols; j++)
             {
                 if (FoundProducts[i, j] != null)
                 {
                     NumGrid.Children.Remove(FoundProducts[i, j]);
                     FoundProducts[i, j] = null;
                 }
             }
         }
     }
     FoundProducts = null;
     if (FoundFactors != null)
     {
         long ffrows = FoundFactors.GetLength(0);
         long ffcols = FoundFactors.GetLength(1);
         for (long i = 0; i < ffrows; i++)
         {
             for (long j = 0; j < ffcols; j++)
             {
                 if (FoundFactors[i, j] != null)
                 {
                     NumGrid.Children.Remove(FoundFactors[i, j]);
                     FoundFactors[i, j] = null;
                 }
             }
         }
     }
     FoundFactors = null;
 }