Beispiel #1
0
        private void RedBlueGreen_Click(object sender, EventArgs e)
        {
            if (PictureBox1.Image == null)
            {
                alert.Show();
            }
            else
            {
                if (boolrbg == true)
                {
                    RedButton.Show();

                    BlueButton.Show();

                    GreenButton.Show();

                    boolrbg = false;
                }
                else if (boolrbg == false)
                {
                    RedButton.Hide();

                    BlueButton.Hide();

                    GreenButton.Hide();
                    boolrbg = true;
                }
            }
        }
Beispiel #2
0
        async void FlipButton(object sender, EventArgs e)
        {
            uint timeout = 500;

            if (RedButton.IsVisible)
            {
                GreenButton.RotationY = -270;
                await RedButton.RotateYTo(-90, timeout, Easing.SpringIn);

                RedButton.IsVisible   = false;
                GreenButton.IsVisible = true;
                await GreenButton.RotateYTo(-360, timeout, Easing.SpringOut);

                GreenButton.RotationY = 0;
            }
            else
            {
                RedButton.RotationY = -270;
                await GreenButton.RotateYTo(-90, timeout, Easing.SpringIn);

                GreenButton.IsVisible = false;
                RedButton.IsVisible   = true;
                await RedButton.RotateYTo(-360, timeout, Easing.SpringOut);

                RedButton.RotationY = 0;
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        blueButton   = GameObject.Find("Blue_Button").GetComponent <BlueButton>();
        greenButton  = GameObject.Find("Green_Button").GetComponent <GreenButton>();
        orangeButton = GameObject.Find("Orange_Button").GetComponent <OrangeButton>();
        timer        = GameObject.Find("Timer").GetComponent <TimerContoller>();
        blueSound    = false;
        greenSound   = false;
        orangeSound  = false;

        randomController();
    }
        /// <summary>
        /// Aux function to instantiate each Feature subclass
        /// Fixes the "Web API error: The 'ObjectContent`1' type failed to serialize" Error
        /// </summary>
        /// <param name="feature"></param>
        /// <param name="isNew"></param>
        /// <returns></returns>
        private Feature CreateFeature(Feature feature, bool isNew)
        {
            Feature featuremodel = new Feature();

            switch (feature.FeatureType)
            {
            case "BlueButton":
                if (isNew)
                {
                    featuremodel = new BlueButton(feature.Name);
                }
                else
                {
                    featuremodel = new BlueButton(feature.Name, feature.FeatureFlag, feature.FeaturePermissions);
                }
                break;

            case "RedButton":
                if (isNew)
                {
                    featuremodel = new RedButton(feature.Name);
                }
                else
                {
                    featuremodel = new RedButton(feature.Name, feature.FeatureFlag, feature.FeaturePermissions);
                }
                break;

            case "GreenButton":
                if (isNew)
                {
                    featuremodel = new GreenButton(feature.Name);
                }
                else
                {
                    featuremodel = new GreenButton(feature.Name, feature.FeatureFlag, feature.FeaturePermissions);
                }
                break;

            default:
                return(null);
            }
            featuremodel.Id = feature.Id;

            return(featuremodel);
        }
    // Start is called before the first frame update
    void Start()
    {
        blueButton      = GameObject.Find("Blue_Button").GetComponent <BlueButton>();
        greenButton     = GameObject.Find("Green_Button").GetComponent <GreenButton>();
        orangeButton    = GameObject.Find("Orange_Button").GetComponent <OrangeButton>();
        lightBlueButton = GameObject.Find("LightBlue_Button").GetComponent <LightBlueButton>();
        whiteButton     = GameObject.Find("White_Button").GetComponent <WhiteButton>();
        pinkButton      = GameObject.Find("Pink_Button").GetComponent <PinkButton>();
        timer           = GameObject.Find("Timer").GetComponent <TimerContoller>();
        blueSound       = false;
        greenSound      = false;
        orangeSound     = false;
        lightblueSound  = false;
        whiteSound      = false;
        pinkSound       = false;

        randomController();
    }
        void ReleaseDesignerOutlets()
        {
            if (GreenButton != null)
            {
                GreenButton.Dispose();
                GreenButton = null;
            }

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

            if (AluminiumButton != null)
            {
                AluminiumButton.Dispose();
                AluminiumButton = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CleanAllButton != null)
            {
                CleanAllButton.Dispose();
                CleanAllButton = null;
            }

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

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

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

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

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

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

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

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

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