Exemple #1
0
        public void img_in(Tokens token)
        {
            CoreTweet.User sdata = token.token.Users.Show(id => token.token.UserId);
            //Console.WriteLine("Go token");
            img.Source = new BitmapImage(new Uri(sdata.ProfileImageUrl));
            img.Margin = new Thickness(28, 10, 0, 0);
            img.Width  = 60;
            img.HorizontalAlignment = HorizontalAlignment.Left;
            img.VerticalAlignment   = VerticalAlignment.Top;
            grid.Children.Add(img);

            //Console.WriteLine("Img OK");
            if (token.IsEnabled == true)
            {
                use.Source = new BitmapImage(new Uri(Pass.img_key + "/" + Pass.colors[color_list.num] + "/use_on.png", UriKind.Relative));
            }
            else
            {
                use.Source = new BitmapImage(new Uri(Pass.img_key + "/" + Pass.colors[color_list.num] + "/use_off.png", UriKind.Relative));
            }
            use.Margin = new Thickness(0, 35, 0, 0);
            use.Width  = 25;
            use.HorizontalAlignment = HorizontalAlignment.Left;
            use.VerticalAlignment   = VerticalAlignment.Top;
            grid.Children.Add(use);

            screen = sdata.ScreenName;
            user   = sdata.Name;
            imgurl = sdata.ProfileImageUrl;
            //Console.WriteLine("use OK");
        }
Exemple #2
0
 private static User ConvertUser(CoreTweet.User source) =>
 new User(
     userId: source.Id ?? -1L,
     userName: source.Name,
     screenName: source.ScreenName,
     userIconUrl: source.ProfileImageUrlHttps
     );
Exemple #3
0
 public User(CoreTweet.User cUser)
 {
     CreateAt        = cUser.CreatedAt.DateTime;
     Description     = cUser.Description;
     Entities        = new UserEntities(cUser.Entities);
     FavouritesCount = cUser.FavouritesCount;
     FollowersCount  = cUser.FollowersCount;
     FriendsCount    = cUser.FriendsCount;
     Id = cUser.Id ?? 0;
     IsFollowRequestSent = cUser.IsFollowRequestSent ?? false;
     IsMuting            = cUser.IsMuting ?? false;
     IsProtected         = cUser.IsProtected;
     IsVerified          = cUser.IsVerified;
     Language            = cUser.Language;
     ListedCount         = cUser.ListedCount ?? 0;
     Location            = cUser.Location;
     Name = cUser.Name;
     ProfileBackgroundColor    = cUser.ProfileBackgroundColor;
     ProfileBackgroundImageUrl = cUser.ProfileBackgroundImageUrl;
     ProfileBannerUrl          = cUser.ProfileBannerUrl;
     ProfileImageUrl           = cUser.ProfileImageUrl;
     ScreenName    = cUser.ScreenName;
     StatusesCount = cUser.StatusesCount;
     TimeZone      = cUser.TimeZone;
     Url           = cUser.Url;
 }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="tokenSuffix"></param>
        /// <param name="user"></param>
        public AccountSettingsParameters(int tokenSuffix, CoreTweet.User user)
        {
            this.TokenSuffix = tokenSuffix;

            this.OtherProfileIsChanged  = false;
            this.ProfileImageIsChanged  = false;
            this.ProfileBannerIsChanged = false;

            if (user == null)
            {
                return;
            }

            this._Name        = user.Name;
            this._ScreenName  = user.ScreenName;
            this._Description = user.Description;
            if (user.Location != null)
            {
                this._Location = user.Location.ToString();
            }

            this._Url = user.Url;

            if (!string.IsNullOrEmpty(user.ProfileImageUrlHttps))
            {
                this._ProfileImage = new Uri(user.ProfileImageUrlHttps.Replace("_normal.", "_bigger."));
            }

            if (!string.IsNullOrEmpty(user.ProfileBannerUrl))
            {
                this._ProfileBanner = new Uri(user.ProfileBannerUrl);
            }
        }
        private void Pin_Button_Click(object sender, RoutedEventArgs e)
        {
            if (!(Directory.Exists(Pass.pindir)))
            {
                Directory.CreateDirectory(Pass.pindir);
                tokens.IsEnabled = true;
                tokens.no        = 0;
            }
            else
            {
                tokens.IsEnabled = true;
                tokens.no        = Directory.GetFiles(Pass.pindir, "*", SearchOption.TopDirectoryOnly).Length;;
            }
            try
            {
                tokens.token = CoreTweet.OAuth.GetTokens(this.Session, this.Pin_Number.Text);
            }
            catch
            {
                var dlg = new emanual.Wpf.Utility.MessageBoxEx();
                dlg.Message          = "Brith";
                dlg.Width            = 350;
                dlg.Height           = 165;
                dlg.TextBlock.Height = 65;
                dlg.TextBlock.Inlines.Add(new System.Windows.Documents.Bold(new System.Windows.Documents.Run(Properties.Resources.pincode_error_1)));
                dlg.TextBlock.Inlines.Add(Properties.Resources.pincode_error_2);

                dlg.Owner = this;
                dlg.Left  = this.Left + 50;
                dlg.Top   = this.Top + 50;

                //dlg.Background = Brushes.Wheat;
                dlg.Button = MessageBoxButton.OK;
                dlg.Image  = MessageBoxImage.Warning;

                dlg.Result = MessageBoxResult.OK;
                dlg.ShowDialog();

                return;
            }
            try
            {
                CoreTweet.User followedUser = tokens.token.Friendships.Create(user_id => "");
            }
            catch
            {
            }
            DataContractSerializer serializer = new DataContractSerializer(typeof(Birth_First.Tokens));
            XmlWriterSettings      settings   = new XmlWriterSettings();

            settings.Encoding = new System.Text.UTF8Encoding(false);
            XmlWriter xw = XmlWriter.Create(Pass.pindir + "/" + tokens.token.UserId + ".xml", settings);

            serializer.WriteObject(xw, tokens);
            xw.Close();
            recieved = true;
            this.Close();
        }
        /// <summary>
        /// プロフィールバナーの再読み込み
        /// </summary>
        /// <param name="user"></param>
        private void ReloadProfileBanner(CoreTweet.User user)
        {
            if (!string.IsNullOrEmpty(user.ProfileBannerUrl))
            {
                this.ProfileBanner = new Uri(user.ProfileBannerUrl);
            }

            this.ProfileBannerIsChanged = false;
        }
        /// <summary>
        /// プロフィール画像の再読み込み
        /// </summary>
        /// <param name="user"></param>
        private void ReloadProfileImage(CoreTweet.User user)
        {
            if (!string.IsNullOrEmpty(user.ProfileImageUrlHttps))
            {
                this.ProfileImage = new Uri(user.ProfileImageUrlHttps.Replace("_normal.", "_bigger."));
            }

            this.ProfileImageIsChanged = false;
        }
        /// <summary>
        /// プロフィールの再読み込み
        /// </summary>
        /// <param name="user"></param>
        private void ReloadProfile(CoreTweet.User user)
        {
            this.Name        = user.Name;
            this.ScreenName  = user.ScreenName;
            this.Description = user.Description;
            if (user.Location != null)
            {
                this.Location = user.Location.ToString();
            }

            this.Url = user.Url;

            this.OtherProfileIsChanged = false;
        }
Exemple #9
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="tokenSuffix">アカウント番号</param>
        /// <param name="user">ユーザーデータ</param>
        public CreateStatusUserProperties(int tokenSuffix, CoreTweet.User user)
        {
            this.User  = new UserOverviewProperties(user);
            this.Media = new StatusMedia();

            this.TokenSuffix = tokenSuffix;
            if (tokenSuffix == 0)
            {
                this._IsCreate = true;
            }
            else
            {
                this._IsCreate = false;
            }
        }