private void startButton_Click(object sender, RoutedEventArgs e)
        {
            if (!gameCreated)
            {
                MessageBoxResult result;
                result = MessageBox.Show("Would you like to play in the game?", "Participation Option", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    this.humanIsPlaying = true;
                    this.game           = new GameController(3, this);
                }
                else
                {
                    this.humanIsPlaying = false;
                    this.game           = new GameController(2, this);
                }
                this.game.addGameObserver(this);
                this.initializeGame();

                // Start the game
                NoArgDelegate mainGameDel = new NoArgDelegate(this.game.beginGame);
                mainGameDel.BeginInvoke(null, null);
            }
            else
            {
                this.initializeGame();

                NoArgDelegate repeatedGameDel = new NoArgDelegate(this.game.playAgain);
                repeatedGameDel.BeginInvoke(null, null);
            }
        }
Example #2
0
        private void ButtonRefresh_Click(object sender, RoutedEventArgs e)
        {
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new NoArgDelegate(AnimateRefresh));
            NoArgDelegate fetcher = new NoArgDelegate(this.GetServers);

            fetcher.BeginInvoke(null, null);
        }
Example #3
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;
            NoArgDelegate fetcher = new NoArgDelegate(this.GetServers);

            fetcher.BeginInvoke(null, null);
        }
Example #4
0
        private void Connect()
        {
            lblConnectionStatus.Text = "Attemping to connect. Please standby.";

            // join the P2P network from a worker thread
            NoArgDelegate executor = new NoArgDelegate(fCore.Connect);

            executor.BeginInvoke(null, null);
        }
Example #5
0
        public NoteView()
        {
            InitializeComponent();

            NoArgDelegate fetcher = new NoArgDelegate(
                this.FetchWeatherFromServer);

            fetcher.BeginInvoke(null, null);
        }
Example #6
0
        private void playButton_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.main.isPlay = true;
            playEnable             = false;

            var fetcher2 = new NoArgDelegate(
                Check.getHashAll);

            fetcher2.BeginInvoke(null, null);
        }
Example #7
0
        private void Connect()
        {
            fCore.Profile.UserName = txtMemberName.Text;
            fCore.TCPListenerPort  = ProtocolHelper.PublicTCPPort;

            // join the P2P mesh from a worker thread
            NoArgDelegate executor = new NoArgDelegate(fCore.Connect);

            executor.BeginInvoke(null, null);
        }
Example #8
0
        private void btnRetrieveData_Click(object sender, RoutedEventArgs e)
        {
            this.btnRetrieveData.IsEnabled = false;
            this.btnRetrieveData.Content   = "连接服务器";

            NoArgDelegate fetcher = new NoArgDelegate(
                this.RetrieveDataFromServer);

            fetcher.BeginInvoke(null, null);
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            // Start fetching the weather forecast asynchronously.
            NoArgDelegate fetcher = new NoArgDelegate(
                this.FetchWeatherFromServer);

            fetcher.BeginInvoke(null, null);
            if (busy == null)
            {
                busy = new BusyDecorator(canvas);
            }
            busy.StartDecorator();
        }
Example #10
0
        private void ForecastButtonHandler(object sender, RoutedEventArgs e)
        {
            // Change the status image and start the rotation animation.
            fetchButton.IsEnabled = false;
            fetchButton.Content = "Contacting Server";
            weatherText.Text = "";
            _hideWeatherImageStoryboard.Begin(this);

            // Start fetching the weather forecast asynchronously.
            var fetcher = new NoArgDelegate(
                FetchWeatherFromServer);

            fetcher.BeginInvoke(null, null);
        }
Example #11
0
        public void GetWeatherAsync()
        {
            if (_requestingContext != null)
            {
                throw new InvalidOperationException("This component can only handle 1 async request at a time");
            }

            _requestingContext = (DispatcherSynchronizationContext)SynchronizationContext.Current;

            NoArgDelegate fetcher = FetchWeatherFromServer;

            // Launch thread
            fetcher.BeginInvoke(null, null);
        }
Example #12
0
        //<SnippetThreadingWeatherButtonHandler>
        private void ForecastButtonHandler(object sender, RoutedEventArgs e)
        {
            // Change the status image and start the rotation animation.
            fetchButton.IsEnabled = false;
            fetchButton.Content   = "Contacting Server";
            weatherText.Text      = "";
            hideWeatherImageStoryboard.Begin(this);

            // Start fetching the weather forecast asynchronously.
            NoArgDelegate fetcher = new NoArgDelegate(
                this.FetchWeatherFromServer);

            fetcher.BeginInvoke(null, null);
        }
Example #13
0
        public MainWindow()
        {
            main = this;
            InitializeComponent();

            var fetcher = new NoArgDelegate(
                News.get);

            fetcher.BeginInvoke(null, null);

            var fetcher2 = new NoArgDelegate(
                Check.getHashAll);

            fetcher2.BeginInvoke(null, null);
        }
Example #14
0
        private void SortListViewCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            UpdateProgressText("Sorting View ... Please Wait");
            SetIndeterminateProgressBar(true);

            var field = (string)e.Parameter;

            if (field == "ContainerName")
            {
                field = "ContainerIndex";
            }

            _field = field;
            Mouse.OverrideCursor = Cursors.Wait;

            NoArgDelegate fetcher = new NoArgDelegate(this.SortView2);

            fetcher.BeginInvoke(null, null);
        }
        private void DisplayLoginIfUserNotLoggedIn()
        {
            // Does the user need to login?
            if (string.IsNullOrEmpty(AppSettings.Username))
            {
                PlayStoryboard("ShowLogin");
            }
            else
            {
                LoginControl.Visibility = Visibility.Hidden;

                System.Security.SecureString password = TwitterNet.DecryptString(AppSettings.Password);

                // Jason Follas: Reworked Web Proxy - don't need to explicitly pass into TwitterNet ctor
                //twitter = new TwitterNet(AppSettings.Username, password, WebProxyHelper.GetConfiguredWebProxy());
                twitter = new TwitterNet(AppSettings.Username, password);

                // Jason Follas: Twitter proxy servers, anyone?  (Network Nazis who block twitter.com annoy me)
                twitter.TwitterServerUrl = AppSettings.TwitterHost;

                // Let the user know what's going on
                StatusTextBlock.Text = Properties.Resources.TryLogin;
                PlayStoryboard("Fetching");

                // Create a Dispatcher to attempt login on new thread
                NoArgDelegate loginFetcher = new NoArgDelegate(this.TryLogin);
                loginFetcher.BeginInvoke(null, null);

            }
        }
        private void DelegateRecentFetch()
        {
            // Let the user know what's going on
            //StatusTextBlock.Text = "Retrieving tweets...";

            //PlayStoryboard("Fetching");

            // Create a Dispatcher to fetching new tweets
            NoArgDelegate fetcher = new NoArgDelegate(
                this.GetTweets);

            fetcher.BeginInvoke(null, null);
        }
        private void DispatchFriendsList()
        {
            NoArgDelegate fetcher = new NoArgDelegate(this.GetFirends);

            fetcher.BeginInvoke(null, null);
        }
 public void RunConferencService()
 {
     //ThreadPool.QueueUserWorkItem(new WaitCallback(runConferencService));
     NoArgDelegate executor = new NoArgDelegate(this.runConferencService);
     executor.BeginInvoke(null, null);
 }
Example #19
0
        private void btnRetrieveData_Click(object sender, RoutedEventArgs e)
        {
            this.btnRetrieveData.IsEnabled = false;
            this.btnRetrieveData.Content = "Contacting Server";

            NoArgDelegate fetcher = new NoArgDelegate(
                this.RetrieveDataFromServer);
            fetcher.BeginInvoke(null, null);
        }
 public void RunConferencService()
 {
     NoArgDelegate executor = new NoArgDelegate(this.runConferencService);
     executor.BeginInvoke(null, null);
 }
Example #21
0
        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            if (!gameCreated)
            {
                MessageBoxResult result;
                result = MessageBox.Show("Would you like to play in the game?", "Participation Option", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    this.humanIsPlaying = true;
                    this.game = new GameController(3, this);
                }
                else
                {
                    this.humanIsPlaying = false;
                    this.game = new GameController(2, this);
                }
                this.game.addGameObserver(this);
                this.initializeGame();

                // Start the game
                NoArgDelegate mainGameDel = new NoArgDelegate(this.game.beginGame);
                mainGameDel.BeginInvoke(null, null);

            }
            else
            {
                this.initializeGame();

                NoArgDelegate repeatedGameDel = new NoArgDelegate(this.game.playAgain);
                repeatedGameDel.BeginInvoke(null, null);

            }
        }
        private void DelegateMessagesFetch()
        {
            // Let the user know what's going on
            StatusTextBlock.Text = "Retrieving direct messages...";

            PlayStoryboard("Fetching");

            // Create a Dispatcher to fetching new tweets
            NoArgDelegate fetcher = new NoArgDelegate(
                this.GetMessages);

            fetcher.BeginInvoke(null, null);
        }
Example #23
0
        private VICECOMManager()
        {
            NoArgDelegate fetcher = new NoArgDelegate(this.BackgroundThread);

            fetcher.BeginInvoke(null, null);
        }