Beispiel #1
0
 public void Start()
 {
     ProgressBar.Progress = 1F;
     for (int a = 0; a < 9; a++)
     {
         Console.WriteLine(DataCollection[a]);
     }
     fit     = new Algorithm(DataCollection, ImportanceCollection);
     results = fit.FindPutter();
     fit.setCharacteristic();
     //If results are greater than 3 provide question ten
     if (results.Length > 3)
     {
         ImportanceLevelLabel.Hidden = true;
         ImportanceTextBox.Hidden    = true;
         OneToFiveLabel2.Hidden      = true;
         HighLowLabel.Hidden         = true;
         BackButton.Hidden           = true;
         //**SelectedButton.Hidden = true;
         InfoButton.Hidden = true;
         TitleLabel.Text   = "Brand Preference";
         //OLDM.SetData(fit.putter.PutterBrands());
         SetImages(false);
         ptdata = fit.putter.PutterBrands();
         if (ptdata[0] != null && ptdata.Length > 0)
         {
             TopLeft_Button.SetBackgroundImage(UIImage.FromFile(ptdata[0] + ".png"), UIControlState.Normal);
         }
         if (ptdata[0] != null && ptdata.Length > 1)
         {
             TopRight_Button.SetBackgroundImage(UIImage.FromFile(ptdata[1] + ".png"), UIControlState.Normal);
         }
         if (ptdata[0] != null && ptdata.Length > 2)
         {
             BottomLeft_Button.SetBackgroundImage(UIImage.FromFile(ptdata[2] + ".png"), UIControlState.Normal);
         }
         if (ptdata[0] != null && ptdata.Length > 3)
         {
             BottomRight_Button.SetBackgroundImage(UIImage.FromFile(ptdata[3] + ".png"), UIControlState.Normal);
         }
     }
     else
     {
         ResultsSetup();
         ResultsTitleLabel.Text = "Results: ( " + results.Length + " )";
         OLDM.SetData(results);
         ResultsView.Model     = OLDM;
         PutterSpecsLabel.Text = "Length: " + fit.putter.PutterLength + Environment.NewLine + "Grip: " + fit.putter.PutterGrip;
     }
 }
Beispiel #2
0
 public void Start()
 {
     ProgressBar.Progress = 1F;
     for (int a = 0; a < 9; a++)
     {
         Console.WriteLine(DataCollection[a]);
     }
     fit     = new Algorithm(DataCollection, ImportanceCollection);
     results = fit.FindPutter();
     fit.setCharacteristic();
     //If results are greater than 3 provide question ten
     if (results.Length > 3)
     {
         ImportanceLevelLabel.Hidden = true;
         ImportanceTextBox.Hidden    = true;
         OneToFiveLabel2.Hidden      = true;
         HighLowLabel.Hidden         = true;
         BackButton.Hidden           = true;
         InfoButton.Hidden           = true;
         TitleLabel.Text             = "Brand Preference";
         SetImages(false);
         ptdata = fit.putter.PutterBrands();
         if (ptdata[0] != null && ptdata.Length > 0)
         {
             TopLeft_Button.SetBackgroundImage(UIImage.FromFile(ptdata[0] + ".png"), UIControlState.Normal);
         }
         if (ptdata[0] != null && ptdata.Length > 1)
         {
             TopRight_Button.SetBackgroundImage(UIImage.FromFile(ptdata[1] + ".png"), UIControlState.Normal);
         }
         if (ptdata[0] != null && ptdata.Length > 2)
         {
             BottomLeft_Button.SetBackgroundImage(UIImage.FromFile(ptdata[2] + ".png"), UIControlState.Normal);
         }
         if (ptdata[0] != null && ptdata.Length > 3)
         {
             BottomRight_Button.SetBackgroundImage(UIImage.FromFile(ptdata[3] + ".png"), UIControlState.Normal);
         }
     }
     else
     {
         LoadResults(results.Length, results);
     }
 }
Beispiel #3
0
 private void SetImages(bool b)
 {
     if (!b)
     {
         TopLeft_Button.SetBackgroundImage(UIImage.FromFile("Blank.png"), UIControlState.Normal);
         TopRight_Button.SetBackgroundImage(UIImage.FromFile("Blank.png"), UIControlState.Normal);
         BottomLeft_Button.SetBackgroundImage(UIImage.FromFile("Blank.png"), UIControlState.Normal);
         BottomRight_Button.SetBackgroundImage(UIImage.FromFile("Blank.png"), UIControlState.Normal);
     }
     else
     {
         counter++;
         TitleLabel.Text = TitleNames[counter];
         TopLeft_Button.SetBackgroundImage(UIImage.FromFile(ImagesArray[counter, 0]), UIControlState.Normal);
         TopRight_Button.SetBackgroundImage(UIImage.FromFile(ImagesArray[counter, 1]), UIControlState.Normal);
         BottomLeft_Button.SetBackgroundImage(UIImage.FromFile(ImagesArray[counter, 2]), UIControlState.Normal);
         BottomRight_Button.SetBackgroundImage(UIImage.FromFile(ImagesArray[counter, 3]), UIControlState.Normal);
     }
 }
Beispiel #4
0
        void ReleaseDesignerOutlets()
        {
            if (AILogo != null)
            {
                AILogo.Dispose();
                AILogo = null;
            }

            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (BottomLeft_Button != null)
            {
                BottomLeft_Button.Dispose();
                BottomLeft_Button = null;
            }

            if (BottomRight_Button != null)
            {
                BottomRight_Button.Dispose();
                BottomRight_Button = null;
            }

            if (CenteringLabel != null)
            {
                CenteringLabel.Dispose();
                CenteringLabel = null;
            }

            if (HighLowLabel != null)
            {
                HighLowLabel.Dispose();
                HighLowLabel = null;
            }

            if (ImportanceLevelLabel != null)
            {
                ImportanceLevelLabel.Dispose();
                ImportanceLevelLabel = null;
            }

            if (ImportanceTextBox != null)
            {
                ImportanceTextBox.Dispose();
                ImportanceTextBox = null;
            }

            if (InfoButton != null)
            {
                InfoButton.Dispose();
                InfoButton = null;
            }

            if (OneToFiveLabel2 != null)
            {
                OneToFiveLabel2.Dispose();
                OneToFiveLabel2 = null;
            }

            if (PCTitle != null)
            {
                PCTitle.Dispose();
                PCTitle = null;
            }

            if (PlayCharLabel != null)
            {
                PlayCharLabel.Dispose();
                PlayCharLabel = null;
            }

            if (PlayErrorLabel != null)
            {
                PlayErrorLabel.Dispose();
                PlayErrorLabel = null;
            }

            if (PlayPrefLabel != null)
            {
                PlayPrefLabel.Dispose();
                PlayPrefLabel = null;
            }

            if (ProgressBar != null)
            {
                ProgressBar.Dispose();
                ProgressBar = null;
            }

            if (Putter_Fitter != null)
            {
                Putter_Fitter.Dispose();
                Putter_Fitter = null;
            }

            if (PutterSpecsLabel != null)
            {
                PutterSpecsLabel.Dispose();
                PutterSpecsLabel = null;
            }

            if (ResultsTitleLabel != null)
            {
                ResultsTitleLabel.Dispose();
                ResultsTitleLabel = null;
            }

            if (ResultsView != null)
            {
                ResultsView.Dispose();
                ResultsView = null;
            }

            if (ShowMoreButton != null)
            {
                ShowMoreButton.Dispose();
                ShowMoreButton = null;
            }

            if (ShowMoreLabel != null)
            {
                ShowMoreLabel.Dispose();
                ShowMoreLabel = null;
            }

            if (ShowMyDetailsButton != null)
            {
                ShowMyDetailsButton.Dispose();
                ShowMyDetailsButton = null;
            }

            if (StartOverButton != null)
            {
                StartOverButton.Dispose();
                StartOverButton = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (TopLeft_Button != null)
            {
                TopLeft_Button.Dispose();
                TopLeft_Button = null;
            }

            if (TopRight_Button != null)
            {
                TopRight_Button.Dispose();
                TopRight_Button = null;
            }
        }