当前位置: 首页>>代码示例>>C#>>正文


C# OpenTween.Twitter类代码示例

本文整理汇总了C#中OpenTween.Twitter的典型用法代码示例。如果您正苦于以下问题:C# Twitter类的具体用法?C# Twitter怎么用?C# Twitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Twitter类属于OpenTween命名空间,在下文中一共展示了Twitter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TwitPic

 public TwitPic(Twitter twitter, Twitter tltwitter)
     : base(new Uri( "http://api.twitter.com/" ), new Uri( "https://api.twitter.com/1/account/verify_credentials.json" ))
 {
     this.tw = twitter;
     this.tltw = tltwitter;
     this.Initialize(tltw.ConsumerKey, tltw.ConsumerSecret, tltw.AccessToken, tltw.AccessTokenSecret, "", "");
 }
开发者ID:ims-kuzu,项目名称:OpenTween,代码行数:7,代码来源:TwitPic.cs

示例2: BeginSelection_BlankTest

        public void BeginSelection_BlankTest()
        {
            using (var twitter = new Twitter())
            using (var mediaSelector = new MediaSelector { Visible = false, Enabled = false })
            {
                twitter.Initialize("", "", "", 0L);
                mediaSelector.Initialize(twitter, TwitterConfiguration.DefaultConfiguration(), "Twitter");

                var eventCalled = false;
                mediaSelector.BeginSelecting += (o, e) => eventCalled = true;

                mediaSelector.BeginSelection();

                Assert.True(eventCalled);

                Assert.True(mediaSelector.Visible);
                Assert.True(mediaSelector.Enabled);

                // 1 ページ目のみ選択可能な状態
                var pages = mediaSelector.ImagePageCombo.Items;
                Assert.Equal(new[] { "1" }, pages.Cast<object>().Select(x => x.ToString()));

                // 1 ページ目が表示されている
                Assert.Equal("1", mediaSelector.ImagePageCombo.Text);
                Assert.Equal("", mediaSelector.ImagefilePathText.Text);
                Assert.Null(mediaSelector.ImageSelectedPicture.Image);
            }
        }
开发者ID:opentween,项目名称:OpenTween,代码行数:28,代码来源:MediaSelectorTest.cs

示例3: Set

 public void Set(string msg, string tweet, long reply_to, FileInfo mediaFile, Twitter ppc)
 {
     this.msg = msg;
     this.tweet = tweet;
     this.reply_to = reply_to;
     this.mediaFile = mediaFile;
     this.ppc = ppc;
 }
开发者ID:shobotch,项目名称:OpenTween,代码行数:8,代码来源:TweetPool.cs

示例4: MyLists

        public MyLists(string userName, Twitter tw)
        {
            this.InitializeComponent();

            this.contextUserName = userName;
            this._tw = tw;

            this.Text = this.contextUserName + Properties.Resources.MyLists1;
        }
开发者ID:nezuku,项目名称:OpenTween,代码行数:9,代码来源:MyLists.cs

示例5: Set

 public void Set(string msg, string tweet, long reply_to, FileInfo mediaFile, Twitter ppc, int interval)
 {
     this.msg = msg;
     this.tweet = tweet;
     this.reply_to = reply_to;
     this.mediaFile = mediaFile;
     this.ppc = ppc;
     this.retryTimer.Interval = interval;
 }
开发者ID:ims-kuzu,项目名称:OpenTween,代码行数:9,代码来源:TweetPool.cs

示例6: UserInfoDialog

        public UserInfoDialog(TweenMain mainForm, Twitter twitter)
        {
            this.mainForm = mainForm;
            this.twitter = twitter;

            InitializeComponent();

            // LabelScreenName のフォントを OTBaseForm.GlobalFont に変更
            this.LabelScreenName.Font = this.ReplaceToGlobalFont(this.LabelScreenName.Font);
        }
开发者ID:nezuku,项目名称:OpenTween,代码行数:10,代码来源:UserInfoDialog.cs

示例7: ListElement

        public ListElement(TwitterList listElementData, Twitter tw)
        {
            this.Description = listElementData.Description;
            this.Id = listElementData.Id;
            this.IsPublic = (listElementData.Mode == "public");
            this.MemberCount = listElementData.MemberCount;
            this.Name = listElementData.Name;
            this.SubscriberCount = listElementData.SubscriberCount;
            this.Slug = listElementData.Slug;
            this.Nickname = listElementData.User.Name.Trim();
            this.Username = listElementData.User.ScreenName;
            this.UserId = listElementData.User.Id;

            this._tw = tw;
        }
开发者ID:nezuku,项目名称:OpenTween,代码行数:15,代码来源:ListElement.cs

示例8: Initialize_yfrogTest

        public void Initialize_yfrogTest()
        {
            using (var mediaSelector = new MediaSelector())
            {
                var twitter = new Twitter();
                var config = TwitterConfiguration.DefaultConfiguration();
                mediaSelector.Initialize(twitter, config, "yfrog");

                // 投稿先に yfrog が選択されている
                Assert.Equal("yfrog", mediaSelector.ImageServiceCombo.Text);

                // ページ番号が初期化された状態
                var pages = mediaSelector.ImagePageCombo.Items;
                Assert.Equal(new[] { "1" }, pages.Cast<object>().Select(x => x.ToString()));
            }
        }
开发者ID:nezuku,项目名称:OpenTween,代码行数:16,代码来源:MediaSelectorTest.cs

示例9: Initialize_yfrogTest

        public void Initialize_yfrogTest()
        {
            using (var twitter = new Twitter())
            using (var mediaSelector = new MediaSelector())
            {
                twitter.Initialize("", "", "", 0L);
                mediaSelector.Initialize(twitter, TwitterConfiguration.DefaultConfiguration(), "yfrog");

                // 投稿先に yfrog が選択されている
                Assert.Equal("yfrog", mediaSelector.ImageServiceCombo.Text);

                // ページ番号が初期化された状態
                var pages = mediaSelector.ImagePageCombo.Items;
                Assert.Equal(new[] { "1" }, pages.Cast<object>().Select(x => x.ToString()));

                // 代替テキストの入力欄が非表示の状態
                Assert.False(mediaSelector.AlternativeTextPanel.Visible);
            }
        }
开发者ID:opentween,项目名称:OpenTween,代码行数:19,代码来源:MediaSelectorTest.cs

示例10: ShowApiInfo

        private void ShowApiInfo(Twitter _tw)
        {
            ApiInfo info = new ApiInfo();
            StringBuilder tmp = new StringBuilder();
            GetApiInfoArgs args = new GetApiInfoArgs(){ info = info, tw = _tw };

            using (FormInfo dlg = new FormInfo(this, Properties.Resources.ApiInfo6, GetApiInfo_Dowork, null, args))
            {
                dlg.ShowDialog();
                if ((bool)dlg.Result)
                {
                    tmp.AppendLine("@" + args.tw.Username + "(" + args.tw.UserId.ToString() + ")");
                    tmp.AppendLine();
                    tmp.AppendLine(Properties.Resources.ApiInfo1 + args.info.MaxCount.ToString());
                    tmp.AppendLine(Properties.Resources.ApiInfo2 + args.info.RemainCount.ToString());
                    tmp.AppendLine(Properties.Resources.ApiInfo3 + args.info.ResetTime.ToString());
                    tmp.AppendLine(Properties.Resources.ApiInfo7 + (args.tw.UserStreamEnabled ? Properties.Resources.Enable : Properties.Resources.Disable).ToString());

                    tmp.AppendLine();
                    tmp.AppendLine(Properties.Resources.ApiInfo8 + args.info.AccessLevel.ToString());
                    SetStatusLabelUrl();

                    tmp.AppendLine();
                    tmp.AppendLine(Properties.Resources.ApiInfo9 + (args.info.MediaMaxCount < 0 ? Properties.Resources.ApiInfo91 : args.info.MediaMaxCount.ToString()));
                    tmp.AppendLine(Properties.Resources.ApiInfo10 + (args.info.MediaRemainCount < 0 ? Properties.Resources.ApiInfo91 : args.info.MediaRemainCount.ToString()));
                    tmp.AppendLine(Properties.Resources.ApiInfo11 + (args.info.MediaResetTime == new DateTime() ? Properties.Resources.ApiInfo91 : args.info.MediaResetTime.ToString()));
                }
                else
                {
                    tmp.Append(Properties.Resources.ApiInfo5);
                }
            }

            MessageBox.Show(tmp.ToString(), Properties.Resources.ApiInfo4, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
开发者ID:alicesanten,项目名称:OpenTween,代码行数:35,代码来源:Tween.cs

示例11: TweenMain_Load

        private void TweenMain_Load(object sender, EventArgs e)
        {
            _ignoreConfigSave = true;
            this.Visible = false;

            //Win32Api.SetProxy(HttpConnection.ProxyType.Specified, "127.0.0.1", 8080, "user", "pass")

            new InternetSecurityManager(PostBrowser);
            this.PostBrowser.AllowWebBrowserDrop = false;  // COMException を回避するため、ActiveX の初期化が終わってから設定する

            MyCommon.TwitterApiInfo.AccessLimitUpdated += TwitterApiStatus_AccessLimitUpdated;
            Microsoft.Win32.SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            if (MyApplication.StartupOptions.ContainsKey("d"))
                MyCommon.TraceFlag = true;

            Regex.CacheSize = 100;

            InitializeTraceFrag();
            LoadIcons(); // アイコン読み込み

            //発言保持クラス
            _statuses = TabInformations.GetInstance();

            //アイコン設定
            this.Icon = MainIcon;              //メインフォーム(TweenMain)
            NotifyIcon1.Icon = NIconAt;      //タスクトレイ
            TabImage.Images.Add(TabIcon);    //タブ見出し

            SettingDialog.Owner = this;;
            SearchDialog.Owner = this;
            fltDialog.Owner = this;
            UrlDialog.Owner = this;

            _history.Add(new PostingStatus());
            _hisIdx = 0;
            _reply_to_id = null;
            _reply_to_name = null;

            //<<<<<<<<<設定関連>>>>>>>>>
            //設定コンバージョン
            //ConvertConfig();

            ////設定読み出し
            LoadConfig();

            ThumbnailGenerator.InitializeGenerator();

            var imgazyobizinet = ThumbnailGenerator.ImgAzyobuziNetInstance;
            imgazyobizinet.Enabled = this._cfgCommon.EnableImgAzyobuziNet;
            imgazyobizinet.DisabledInDM = this._cfgCommon.ImgAzyobuziNetDisabledInDM;

            Thumbnail.Services.TonTwitterCom.InitializeOAuthToken = x =>
                x.Initialize(ApplicationSettings.TwitterConsumerKey, ApplicationSettings.TwitterConsumerSecret,
                    this.tw.AccessToken, this.tw.AccessTokenSecret, "", "");

            //新着バルーン通知のチェック状態設定
            NewPostPopMenuItem.Checked = _cfgCommon.NewAllPop;
            this.NotifyFileMenuItem.Checked = NewPostPopMenuItem.Checked;

            //フォント&文字色&背景色保持
            _fntUnread = _cfgLocal.FontUnread;
            _clUnread = _cfgLocal.ColorUnread;
            _fntReaded = _cfgLocal.FontRead;
            _clReaded = _cfgLocal.ColorRead;
            _clFav = _cfgLocal.ColorFav;
            _clOWL = _cfgLocal.ColorOWL;
            _clRetweet = _cfgLocal.ColorRetweet;
            _fntDetail = _cfgLocal.FontDetail;
            _clDetail = _cfgLocal.ColorDetail;
            _clDetailLink = _cfgLocal.ColorDetailLink;
            _clDetailBackcolor = _cfgLocal.ColorDetailBackcolor;
            _clSelf = _cfgLocal.ColorSelf;
            _clAtSelf = _cfgLocal.ColorAtSelf;
            _clTarget = _cfgLocal.ColorTarget;
            _clAtTarget = _cfgLocal.ColorAtTarget;
            _clAtFromTarget = _cfgLocal.ColorAtFromTarget;
            _clAtTo = _cfgLocal.ColorAtTo;
            _clListBackcolor = _cfgLocal.ColorListBackcolor;
            _clInputBackcolor = _cfgLocal.ColorInputBackcolor;
            _clInputFont = _cfgLocal.ColorInputFont;
            _fntInputFont = _cfgLocal.FontInputFont;

            var fontUIGlobal = this._cfgLocal.FontUIGlobal;
            if (fontUIGlobal != null)
            {
                OTBaseForm.GlobalFont = fontUIGlobal;
                this.Font = fontUIGlobal;
            }

            // StringFormatオブジェクトへの事前設定
            //sf.Alignment = StringAlignment.Near;             // Textを近くへ配置(左から右の場合は左寄せ)
            //sf.LineAlignment = StringAlignment.Near;         // Textを近くへ配置(上寄せ)
            //sf.FormatFlags = StringFormatFlags.LineLimit;    // 
            sfTab.Alignment = StringAlignment.Center;
            sfTab.LineAlignment = StringAlignment.Center;

            //不正値チェック
            if (!MyApplication.StartupOptions.ContainsKey("nolimit"))
            {
//.........这里部分代码省略.........
开发者ID:nanayaT,项目名称:OpenTween,代码行数:101,代码来源:Tween.cs

示例12: SettingStripMenuItem_Click

        private void SettingStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result;

            // 設定画面表示前のユーザー情報
            var oldUser = new { tw.AccessToken, tw.AccessTokenSecret, tw.Username, tw.UserId };

            this.SettingDialog.tw = this.tw;
            this.SettingDialog.LoadConfig(this._cfgCommon, this._cfgLocal);

            try
            {
                result = SettingDialog.ShowDialog(this);
            }
            catch (Exception)
            {
                return;
            }

            if (result == DialogResult.OK)
            {
                lock (_syncObject)
                {
                    var oldIconSz = this._cfgCommon.IconSize;

                    this.SettingDialog.SaveConfig(this._cfgCommon, this._cfgLocal);

                    tw.RestrictFavCheck = this._cfgCommon.RestrictFavCheck;
                    tw.ReadOwnPost = this._cfgCommon.ReadOwnPost;
                    ShortUrl.Instance.DisableExpanding = !this._cfgCommon.TinyUrlResolve;
                    ShortUrl.Instance.BitlyId = this._cfgCommon.BilyUser;
                    ShortUrl.Instance.BitlyKey = this._cfgCommon.BitlyPwd;
                    HttpTwitter.TwitterUrl = _cfgCommon.TwitterUrl;

                    Networking.DefaultTimeout = TimeSpan.FromSeconds(this._cfgCommon.DefaultTimeOut);
                    Networking.SetWebProxy(this._cfgLocal.ProxyType,
                        this._cfgLocal.ProxyAddress, this._cfgLocal.ProxyPort,
                        this._cfgLocal.ProxyUser, this._cfgLocal.ProxyPassword);

                    ImageSelector.Reset(tw, this.tw.Configuration);

                    try
                    {
                        if (this._cfgCommon.TabIconDisp)
                        {
                            ListTab.DrawItem -= ListTab_DrawItem;
                            ListTab.DrawMode = TabDrawMode.Normal;
                            ListTab.ImageList = this.TabImage;
                        }
                        else
                        {
                            ListTab.DrawItem -= ListTab_DrawItem;
                            ListTab.DrawItem += ListTab_DrawItem;
                            ListTab.DrawMode = TabDrawMode.OwnerDrawFixed;
                            ListTab.ImageList = null;
                        }
                    }
                    catch (Exception ex)
                    {
                        ex.Data["Instance"] = "ListTab(TabIconDisp)";
                        ex.Data["IsTerminatePermission"] = false;
                        throw;
                    }

                    try
                    {
                        if (!this._cfgCommon.UnreadManage)
                        {
                            ReadedStripMenuItem.Enabled = false;
                            UnreadStripMenuItem.Enabled = false;
                            if (this._cfgCommon.TabIconDisp)
                            {
                                foreach (TabPage myTab in ListTab.TabPages)
                                {
                                    myTab.ImageIndex = -1;
                                }
                            }
                        }
                        else
                        {
                            ReadedStripMenuItem.Enabled = true;
                            UnreadStripMenuItem.Enabled = true;
                        }
                    }
                    catch (Exception ex)
                    {
                        ex.Data["Instance"] = "ListTab(UnreadManage)";
                        ex.Data["IsTerminatePermission"] = false;
                        throw;
                    }

                    // タブの表示位置の決定
                    SetTabAlignment();

                    SplitContainer1.IsPanelInverted = !this._cfgCommon.StatusAreaAtBottom;

                    var imgazyobizinet = ThumbnailGenerator.ImgAzyobuziNetInstance;
                    imgazyobizinet.Enabled = this._cfgCommon.EnableImgAzyobuziNet;
                    imgazyobizinet.DisabledInDM = this._cfgCommon.ImgAzyobuziNetDisabledInDM;

//.........这里部分代码省略.........
开发者ID:nanayaT,项目名称:OpenTween,代码行数:101,代码来源:Tween.cs

示例13: IsMyEventNotityAsEventType

 private bool IsMyEventNotityAsEventType(Twitter.FormattedEvent ev)
 {
     return (ev.Eventtype & this._cfgCommon.IsMyEventNotifyFlag) != 0 ? true : !ev.IsMe;
 }
开发者ID:nanayaT,项目名称:OpenTween,代码行数:4,代码来源:Tween.cs

示例14: TwitterPhoto

 public TwitterPhoto( Twitter twitter )
 {
     this.tw = twitter;
 }
开发者ID:noqisofon,项目名称:OpenTween,代码行数:4,代码来源:TwitterPhoto.cs

示例15: GetTextLengthRemain_DirectMessageTest

        public void GetTextLengthRemain_DirectMessageTest()
        {
            using (var twitter = new Twitter())
            {
                // 2015年8月から DM の文字数上限が 10,000 文字に変更された
                // https://twittercommunity.com/t/41348
                twitter.Configuration.DmTextCharacterLimit = 10000;

                Assert.Equal(10000, twitter.GetTextLengthRemain("D twitter "));
                Assert.Equal(9992, twitter.GetTextLengthRemain("D twitter hogehoge"));
            }
        }
开发者ID:nezuku,项目名称:OpenTween,代码行数:12,代码来源:TwitterTest.cs


注:本文中的OpenTween.Twitter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。