Exemplo n.º 1
0
        public void DisplayInputErrorInfo(Rect rect, StrokeCollection removedStrokes)
        {
            foreach (InkRegion inkRegion in InkRegions)
            {
                if (inkRegion.Rect.Contains(rect))
                {
                    TruthTableErrorArgs args = new TruthTableErrorArgs();
                    args.RemovedStrokes = removedStrokes;

                    if (!inkRegion.IsInputInvalid)
                    {
                        inkRegion.IsInputInvalid = true;
                    }
                    else
                    {
                        return;
                    }

                    if (!inkRegion.IsHeader)
                    {
                        args.ErrorMsg = "Warning: Input 1 or 0 in this region!";
                        truthTableInputErrorDisplayed(this, args);
                    }
                    else
                    {
                        /*
                        b = new Rect(inkRegion.Rect.X, inkRegion.Rect.Y - GAP, 2 * GAP, GAP);
                        center = new Point(b.X + b.Width / 2, b.Y + b.Height / 2);
                        color = Brushes.Red;
                        values = new InkFigure("Warning: Input capitalized single letter in the below box!", b, center, color);

                        inkRegion.ErrorProneFigure = values;

                        InkCanvas.Children.Add(values);
                        */
                        args.ErrorMsg = "Warning: Input capitalized single letter in this region!";
                        truthTableInputErrorDisplayed(this, args);
                    }
                }

            }
        }
Exemplo n.º 2
0
 void truthTable_truthTableInputErrorDisplayed(object sender, TruthTableErrorArgs e)
 {
     //MessageBox.Show("Test");
     this.Dispatcher.BeginInvoke((Action)(() =>
     {
         MessageBox.Show(e.ErrorMsg);
         if (e.RemovedStrokes != null)
         {
             this.truthTableInkCanvas.Strokes.Remove(e.RemovedStrokes);
             this.truthTableInkCanvas.InkAnalyzer.RemoveStrokes(e.RemovedStrokes);
             this.truthTableInkCanvas.ShowInkAnalysisFeedback = false;
         }
     }));
 }
Exemplo n.º 3
0
 public bool CheckInputValueCompleted()
 {
     foreach (InkRegion _region in this.inkRegions)
     {
         if (!_region.HasInputValue && !_region.IsHeader)
         {
             TruthTableErrorArgs args = new TruthTableErrorArgs();
             args.ErrorMsg = "Pls complete input values!!!";
             truthTableInputErrorDisplayed(this, args);
             return false;
         }
     }
     return true;
 }