Example #1
0
        public Form1()
        {
            InitializeComponent();
            lastImageName = "";
            clvshell      = new ClovershellConnection()
            {
                AutoReconnect = true, Enabled = true
            };

            SNSConfig.createTemplateIf();
            configTwitter = SNSConfig.load();

            if (null != configTwitter)
            {
                if (configTwitter.isProductionToken())
                {
                    displayTwitterAccountValid(true);
                    twitterTokens = CoreTweet.Tokens.Create(configTwitter.ConsumerKey, configTwitter.ConsumerSecret, configTwitter.AccessToken,
                                                            TestNetworkError ? "0000" : configTwitter.AccessTokenSecret);
                }
                else
                {
                    labelTwhint.Text    = "Generate tokens on Twitter web before using.";
                    labelTwhint.Visible = true;
                }
            }
            showState("Please connect your console before taking screenshot.", 0);
        }
Example #2
0
        public static SNSConfig load()
        {
            var confPath = makeConfigFilePath();

            var ins  = new StreamReader(confPath, Encoding.UTF8);
            var yaml = new YamlStream();

            yaml.Load(ins);

            var             root    = yaml.Documents[0].RootNode;
            YamlMappingNode rootMap = root as YamlMappingNode;

            foreach (var ch in rootMap.Children)
            {
                var k = ch.Key.ToString();
                if (ieq(k, "twitter"))
                {
                    var conf = new SNSConfig();
                    if (conf.readTwitterConf(ch.Value as YamlMappingNode))
                    {
                        return(conf);
                    }
                }
            }

            return(null);
        }