コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: sirkris/Birdie
        public MainPage(BirdieLib.BirdieLib birdieLib)
        {
            InitializeComponent();

            Shared.BirdieLib = birdieLib;

            labelVersion.Text = "Version " + Shared.BirdieLib.GetVersion();

            RefreshStats();

            if (string.IsNullOrWhiteSpace(Shared.BirdieLib.TwitterConfig.AccessToken) || string.IsNullOrWhiteSpace(Shared.BirdieLib.TwitterConfig.AccessTokenSecret))
            {
                Navigation.PushAsync(new TwitterAuth(this));
            }

            //BirdieLib.StatusUpdate += C_ActiveUpdated;  // Deprecated; fires when BirdieLib.Active changes and we're no longer tracking to that on mobile because of scheduler.  --Kris
            AlarmActive += C_AlarmActive;
            Shared.BirdieLib.RetweetsUpdate += C_StatsUpdated;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: sirkris/Birdie
        static void Main(string[] args)
        {
            // A very basic console app running BirdieLib.  --Kris
            BirdieLib.BirdieLib birdieLib = new BirdieLib.BirdieLib(args[0].Equals("testmode"));

            if (string.IsNullOrWhiteSpace(birdieLib.TwitterConfig.AccessToken) || string.IsNullOrWhiteSpace(birdieLib.TwitterConfig.AccessTokenSecret))
            {
                Console.WriteLine("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
                Console.WriteLine("Unable to proceed with execution!  No authorized user.");
                Console.WriteLine("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

                Console.WriteLine();

                Console.WriteLine("Auth URL:");
                Console.WriteLine(birdieLib.SetCredentials().AuthorizationURL);

                Console.WriteLine();

                Console.WriteLine("Press any key to exit....");

                Console.ReadKey();
            }
            else
            {
                birdieLib.Start();
                birdieLib.RetweetsUpdate += C_StatsUpdated;

                Console.WriteLine("Birdie is now running" + (args[0].Equals("testmode") ? " in test mode" : "") + ".  Press any key to exit....");

                Console.ReadKey();

                birdieLib.RetweetsUpdate -= C_StatsUpdated;
                birdieLib.Stop();

                Console.WriteLine("Birdie has stopped.");
            }
        }