Esempio n. 1
0
    //also used to go there in the first place :D
    public void Return(string input)
    {
        switch (input)
        {
        case "fromMain":
        {
            OnOptions?.Invoke();
            mainMenu.SetActive(false);
            pauseMenu.SetActive(false);
            optionsMenu.SetActive(true);
        }
        break;

        case "fromOptions":
        {
            OnMain?.Invoke();
            if (pauseMode)
            {
                pauseMenu.SetActive(true);
                optionsMenu.SetActive(false);
            }
            else
            {
                mainMenu.SetActive(true);
                optionsMenu.SetActive(false);
            }
        }
        break;
        }
    }
Esempio n. 2
0
 void Start()
 {
     hand        = FindObjectOfType(typeof(movehand1)) as movehand1;
     phand       = FindObjectOfType(typeof(Playerhand)) as Playerhand;
     optionsMenu = FindObjectOfType(typeof(OnOptions)) as OnOptions;
     setup       = FindObjectOfType(typeof(SetUp)) as SetUp;
 }
Esempio n. 3
0
        private void handleRequest(HttpListenerContext context)
        {
            var eventArgs = new HttpEventArgs(context.Request, context.Response);
            var method    = context.Request.HttpMethod;

            try
            {
                if (method == HttpMethod.Get.Method)
                {
                    OnGet?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Post.Method)
                {
                    OnPost?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Put.Method)
                {
                    OnPut?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Options.Method)
                {
                    OnOptions?.Invoke(this, eventArgs);
                }
            }
            catch (NotImplementedException)
            {
                context.Response.Abort();
            }
        }
        public void GetHtmlTest()
        {
            IOptions options = new OnOptions();

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
        }
Esempio n. 5
0
 public static void ClassInitialize(TestContext context)
 {
     OnOptions = new OnOptions
     {
         PaymentCancel  = "cancel",
         PaymentError   = "error",
         PaymentSuccess = "success"
     };
 }
        public void GetHtmlWithOptionsTest()
        {
            IOptions options = new OnOptions
            {
                PaymentCancel  = "cancel",
                PaymentError   = "error",
                PaymentSuccess = "success"
            };

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("V.on(\"payment.success\", function(payment){success});"));
            Assert.IsTrue(result.Contains("V.on(\"payment.error\", function(payment){error});"));
            Assert.IsTrue(result.Contains("V.on(\"payment.cancel\", function(payment){cancel});"));
        }
Esempio n. 7
0
        private void onRequest(HttpListenerContext context)
        {
            var req       = context.Request;
            var res       = context.Response;
            var eventArgs = new HttpRequestEventArgs(context);

            if (req.HttpMethod == "GET" && !OnGet.IsNull())
            {
                OnGet(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "HEAD" && !OnHead.IsNull())
            {
                OnHead(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "POST" && !OnPost.IsNull())
            {
                OnPost(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "PUT" && !OnPut.IsNull())
            {
                OnPut(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "DELETE" && !OnDelete.IsNull())
            {
                OnDelete(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "OPTIONS" && !OnOptions.IsNull())
            {
                OnOptions(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "TRACE" && !OnTrace.IsNull())
            {
                OnTrace(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "CONNECT" && !OnConnect.IsNull())
            {
                OnConnect(this, eventArgs);
                return;
            }

            if (req.HttpMethod == "PATCH" && !OnPatch.IsNull())
            {
                OnPatch(this, eventArgs);
                return;
            }

            res.StatusCode = (int)HttpStatusCode.NotImplemented;
        }
Esempio n. 8
0
 public void PressOptions()
 {
     OnOptions?.Invoke();
     Hide();
 }