コード例 #1
0
        /// <summary>
        /// Retrieve Tweets Trend Topics
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetTrendTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TweetGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TrendGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible  = Windows.UI.Xaml.Visibility.Collapsed;

            try
            {
                tweetAPI          = new TweetAPICall();
                GlobalTrendTweets = await tweetAPI.TweetsbyTrend(null);

                //GridViewTweets = GlobalTrendTweets;
                //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
                //UserTweets = await tweetAPI.TweetsByUser(UserScreenName);
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }
        }
コード例 #2
0
 public void setUnSelected()
 {
     textVisibility  = Windows.UI.Xaml.Visibility.Visible;
     imageVisibility = Windows.UI.Xaml.Visibility.Collapsed;
     OnPropertyChanged("textVisibility");
     OnPropertyChanged("imageVisibility");
 }
コード例 #3
0
        private async void GetUserInformation(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TweetGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            UserGridVisible  = Windows.UI.Xaml.Visibility.Visible;

            //Do verification
            if (!String.IsNullOrEmpty(TwitterSearchText))
            {
                tweetAPI = new TweetAPICall();
                //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
                UserFollowers = await tweetAPI.FollowersByUser(TwitterSearchText);

                GridViewTweets = UserTweets;
            }
            else
            {
                throw new ArgumentNullException("No Twitter Screen Name Provided");
            }
        }
コード例 #4
0
        /// <summary>
        /// Retrieve Search by Topic Tweets
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetSearchTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TweetGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible  = Windows.UI.Xaml.Visibility.Collapsed;

            if (!string.IsNullOrEmpty(TwitterSearchText))
            {
                tweetAPI     = new TweetAPICall();
                SearchTweets = await tweetAPI.TweetsbySearch(TwitterSearchText);

                GridViewTweets = SearchTweets;
            }
            else
            {
                throw new Exception("Search Query Cannot Be Empty");
            }
        }
コード例 #5
0
        /// <summary>
        /// Retrieve Tweets for the Twitter User (Home Timeline Tweets)
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetHomeTimelineTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus)
            {
                AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);
            }

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TweetGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible  = Windows.UI.Xaml.Visibility.Collapsed;

            try
            {
                tweetAPI       = new TweetAPICall();
                UserHomeTweets = await tweetAPI.TweetsbyHomeTimeline();

                GridViewTweets = UserHomeTweets;
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }
        }
コード例 #6
0
 private void setCustomOptionCheckBoxes(bool customOptionVisibility)
 {
     Windows.UI.Xaml.Visibility visibility = customOptionVisibility
         ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
     chbLegendGroups.Visibility      = visibility;
     chbLegendNames.Visibility       = visibility;
     chbLegendCustomIcons.Visibility = visibility;
 }
コード例 #7
0
 public AddressBookEntryModel(string fullName, string bankName, string account, string phone, string photoPath, bool flag = false)
 {
     this.FullName = fullName;
     this.BankName = bankName;
     this.Account = account;
     this.Phone = phone;
     this.PhotoPath = photoPath;
     this.Initials = ExtractNameInitials(fullName);
     this.Flag = flag ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
 }
コード例 #8
0
ファイル: Todo.cs プロジェクト: chent86/myList
        public Todo()
        {
            this.Title  = "todo";
            this.detail = "testing";
            string path = "ms-appx:///Assets/picture0.jpg";

            this.Picture     = new BitmapImage(new Uri(path));
            this.picture_id  = "0";
            this.date        = "2020/5/21 0:10:30 +08:00";
            this.create_date = DateTime.Now.ToString();
            visi             = Windows.UI.Xaml.Visibility.Collapsed;
            Is_check         = false;
            m_db             = Database.Instance;
            just_create      = 1;
        }
コード例 #9
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            Windows.UI.Xaml.Visibility resultVisibility = Windows.UI.Xaml.Visibility.Visible;
            DateTime dateTime = (DateTime)value;

            if (dateTime != DateTime.MinValue && parameter.ToString().Equals("created"))
            {
                resultVisibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (dateTime == DateTime.MinValue && parameter.ToString().Equals("lastRecord"))
            {
                resultVisibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            return(resultVisibility);
        }
コード例 #10
0
        private async Task SetAdControlVisibility(Windows.UI.Xaml.Visibility visibility)
        {
            if (!MSAdControl.Dispatcher.HasThreadAccess)
            {
                await MSAdControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                {
                    await SetAdControlVisibility(visibility);
                });

                return;
            }

            MSAdControl.Visibility = visibility;
            //MSAdControl.IsAutoRefreshEnabled = visibility == Windows.UI.Xaml.Visibility.Visible;
        }
コード例 #11
0
        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            var invert = false;

            if (parameter != null)
            {
                invert = Boolean.Parse(parameter.ToString());
            }

            Windows.UI.Xaml.Visibility isVisible = (Windows.UI.Xaml.Visibility)value;

            if (invert)
            {
                return(isVisible != Windows.UI.Xaml.Visibility.Visible);
            }
            return(isVisible == Windows.UI.Xaml.Visibility.Visible);
        }
コード例 #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CharacteristicPageViewModel" /> class.
        /// </summary>
        public CharacteristicPageViewModel()
        {
            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
            }

            Notify   = Characteristic.IsNotifySet;
            Indicate = Characteristic.IsIndicateSet;

            this.PropertyChanged           += CharacteristicPageViewModel_PropertyChanged;
            Characteristic.PropertyChanged += Characteristic_PropertyChanged;

            if (Characteristic.DisplayType == ObservableGattCharacteristics.DisplayTypes.Unsupported)
            {
                DisplayPresentError = Windows.UI.Xaml.Visibility.Visible;
            }
        }
コード例 #13
0
        /// <summary>
        /// Characteristic changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Characteristic_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Value")
            {
                if (UseWindowsNotifications == true && (Notify == true || Indicate == true))
                {
                    BluetoothLEExplorer.Services.ToastService.ToastService.PopToast(Characteristic.Name, Characteristic.Value, "Notification", "Notification");
                }
            }

            if (e.PropertyName == "DisplayType")
            {
                if (Characteristic.DisplayType == ObservableGattCharacteristics.DisplayTypes.Unsupported)
                {
                    DisplayPresentError = Windows.UI.Xaml.Visibility.Visible;
                }
            }
        }
コード例 #14
0
        private async void GetUserInformation(int TwitAuthType) 
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus) AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TweetGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            UserGridVisible = Windows.UI.Xaml.Visibility.Visible;
             
            //Do verification
            if (!String.IsNullOrEmpty(TwitterSearchText))
            {
                tweetAPI = new TweetAPICall();
                //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
                UserFollowers = await tweetAPI.FollowersByUser(TwitterSearchText);
                GridViewTweets = UserTweets;
            }
            else
            {
                throw new ArgumentNullException("No Twitter Screen Name Provided");
            }
        }
コード例 #15
0
        /// <summary>
        /// Retrieve Search by Topic Tweets
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetSearchTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus) AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TweetGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible = Windows.UI.Xaml.Visibility.Collapsed;

            if (!string.IsNullOrEmpty(TwitterSearchText))
            {
                tweetAPI = new TweetAPICall();
                SearchTweets = await tweetAPI.TweetsbySearch(TwitterSearchText);
                GridViewTweets = SearchTweets;
            }
            else
            { throw new Exception("Search Query Cannot Be Empty"); }


        }
コード例 #16
0
        /// <summary>
        /// Retrieve Tweets Trend Topics
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetTrendTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus) AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);

           //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TweetGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TrendGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            
            try
            {
                tweetAPI = new TweetAPICall();
                GlobalTrendTweets = await tweetAPI.TweetsbyTrend(null);
                //GridViewTweets = GlobalTrendTweets;
                //Debug.WriteLine("Trying to get tweets and AuthUser is " + oauthTwitter.AuthenticatedUser);
                //UserTweets = await tweetAPI.TweetsByUser(UserScreenName);
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }

        }
コード例 #17
0
        /// <summary>
        /// Retrieve Tweets for the Twitter User (Home Timeline Tweets)
        /// </summary>
        /// <param name="TwitAuthType"></param>
        private async void GetHomeTimelineTweets(int TwitAuthType)
        {
            //Verify if User Authenticated by Twitter
            AuthenticatedUserStatus = VerifyAuthenticatedUser();

            //If User Not already verified by Twitter; Authenticate and Set updated User Auth State
            if (!AuthenticatedUserStatus) AuthenticatedUserStatus = await AuthenticateTwitterUser(TwitAuthType);

            //Set appropriate Grid - Binding to Visibility to keep all code in ViewModel not the best method, but quick and dirty for UI Test of API Data
            TrendGridVisible = Windows.UI.Xaml.Visibility.Collapsed;
            TweetGridVisible = Windows.UI.Xaml.Visibility.Visible;
            UserGridVisible = Windows.UI.Xaml.Visibility.Collapsed;

            try
            {
                tweetAPI = new TweetAPICall();
                UserHomeTweets = await tweetAPI.TweetsbyHomeTimeline();
                GridViewTweets = UserHomeTweets;
             
            }
            catch (Exception Ex)
            {
                throw new Exception(Ex.Message);
            }

        }
コード例 #18
0
 public object ConvertBack(object value, Type targetType, object parameter, string language)
 {
     Windows.UI.Xaml.Visibility data = (Windows.UI.Xaml.Visibility)value;
     return(data == Windows.UI.Xaml.Visibility.Visible);
 }
コード例 #19
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            Windows.UI.Xaml.Visibility mode = (Windows.UI.Xaml.Visibility)value;

            return(mode.ToString());
        }