示例#1
0
        void ReleaseDesignerOutlets()
        {
            if (InputLayout != null)
            {
                InputLayout.Dispose();
                InputLayout = null;
            }

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

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

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }
        }
示例#2
0
        void ReleaseDesignerOutlets()
        {
            if (InputLayout != null)
            {
                InputLayout.Dispose();
                InputLayout = null;
            }

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

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

            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }
        }
示例#3
0
 void Awake()
 {
     delayCollapseForSeconds = delayCollapse;
     parent   = this.transform.parent.parent.GetComponent <Field>();
     catImage = this.transform.Find("catImage").GetComponent <CatImage>();
     board    = GameObject.Find("board").GetComponent <Board>();
     catImage.gameObject.SetActive(false);
 }
示例#4
0
        public async Task CatAsync(EventContext e)
        {
            WebClient c = new WebClient();

            byte[]   b   = c.DownloadData("http://random.cat/meow");
            string   str = Encoding.Default.GetString(b);
            CatImage cat = JsonConvert.DeserializeObject <CatImage>(str);
            await e.Channel.SendMessage(cat.File);
        }
示例#5
0
        public async Task CatAsync(EventContext e)
        {
            WebClient c = new WebClient();

            byte[]   b   = c.DownloadData("http://random.cat/meow");
            string   str = Encoding.Default.GetString(b);
            CatImage cat = JsonConvert.DeserializeObject <CatImage>(str);

            await Utils.Embed
            .SetTitle("🐱 Kitties!")
            .SetColor(0.8f, 0.6f, 0.4f)
            .SetImageUrl(cat.File)
            .QueueToChannel(e.Channel);
        }
示例#6
0
        public async Task CatAsync(IContext e)
        {
            using WebClient c = new WebClient();
            byte[]   b   = c.DownloadData("http://aws.random.cat/meow");
            string   str = Encoding.Default.GetString(b);
            CatImage cat = JsonConvert.DeserializeObject <CatImage>(str);

            await new EmbedBuilder()
            .SetTitle("🐱 Kitties!")
            .SetColor(0.8f, 0.6f, 0.4f)
            .SetImage(cat.File)
            .ToEmbed()
            .QueueAsync(e, e.GetChannel());
        }
示例#7
0
        public Task CatAsync(EventContext e)
        {
            WebClient c = new WebClient();

            byte[]   b   = c.DownloadData("http://aws.random.cat/meow");
            string   str = Encoding.Default.GetString(b);
            CatImage cat = JsonConvert.DeserializeObject <CatImage>(str);

            new EmbedBuilder()
            .SetTitle("🐱 Kitties!")
            .SetColor(0.8f, 0.6f, 0.4f)
            .SetImage(cat.File)
            .ToEmbed()
            .QueueToChannel(e.Channel);
            return(Task.CompletedTask);
        }
示例#8
0
        // Insert Add below here
        public async Task <Response> Add(CatImage image)
        {
            var result = await this.PostAsync(
                $"https://api.thecatapi.com/v1/favourites",
                JsonSerializer.Serialize(
                    new Dictionary <string, string>
            {
                { "image_id", image.Id },
                { "sub_id", "uno-client" }
            }),
                _defaultHeaders);

            if (result != null)
            {
                return(JsonSerializer.Deserialize <Response>(result));
            }

            return(null);
        }
示例#9
0
        void ReleaseDesignerOutlets()
        {
            if (CatImage != null)
            {
                CatImage.Dispose();
                CatImage = null;
            }

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

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