Exemplo n.º 1
0
 public MyLists(string userName, Twitter tw)
 {
     InitializeComponent();
     _contextUserName = userName;
     _twitter = tw;
     Text = _contextUserName + R.MyLists1;
 }
Exemplo n.º 2
0
 public ListElement(ListElementData listElementData, Twitter tw)
     : this()
 {
     Description = listElementData.Description;
     Id = listElementData.Id;
     IsPublic = listElementData.Mode == "public";
     MemberCount = listElementData.MemberCount;
     Name = listElementData.Name;
     SubscriberCount = listElementData.SubscriberCount;
     Slug = listElementData.Slug;
     Nickname = listElementData.User.Name.Trim();
     Username = listElementData.User.ScreenName;
     UserId = listElementData.User.Id;
     Tw = tw;
 }
Exemplo n.º 3
0
 public Imgly(Twitter twitter)
     : base(new Uri("http://api.twitter.com/"), new Uri("https://api.twitter.com/1.1/account/verify_credentials.json"))
 {
     _tw = twitter;
     Initialize(ConsumerKey, ConsumerSecretKey, _tw.AccessToken, _tw.AccessTokenSecret, string.Empty, string.Empty);
 }
Exemplo n.º 4
0
        private void Tw_UserStreamEventArrived(Twitter.FormattedEvent ev)
        {
            try
            {
                if (InvokeRequired && !IsDisposed)
                {
                    Invoke(new Action<Twitter.FormattedEvent>(Tw_UserStreamEventArrived), ev);
                    return;
                }
            }
            catch (ObjectDisposedException)
            {
                return;
            }
            catch (InvalidOperationException)
            {
                return;
            }

            StatusLabel.Text = string.Format("Event: {0}", ev.Event);
            NotifyEvent(ev);
            if (ev.Event == "favorite" || ev.Event == "unfavorite")
            {
                if (_curTab != null && _statuses.Tabs[_curTab.Text].Contains(ev.Id))
                {
                    _itemCache = null;
                    _itemCacheIndex = -1;
                    _postCache = null;
                    ((DetailsListView)_curTab.Tag).Update();
                }

                if (ev.Event == "unfavorite" && ev.Username.ToLower().Equals(_tw.Username.ToLower()))
                {
                    RemovePostFromFavTab(new[] { ev.Id });
                }
            }
        }
Exemplo n.º 5
0
 public NewListElement(Twitter tw)
 {
     Tw = tw;
     IsCreated = false;
 }
Exemplo n.º 6
0
 public ListManage(Twitter tw)
 {
     InitializeComponent();
     _twitter = tw;
 }
Exemplo n.º 7
0
 private bool IsMyEventNotityAsEventType(Twitter.FormattedEvent ev)
 {
     return Convert.ToBoolean(ev.Eventtype & _configs.IsMyEventNotifyFlag) || !ev.IsMe;
 }
Exemplo n.º 8
0
        private void NotifyEvent(Twitter.FormattedEvent ev)
        {
            // 新着通知
            if (IsBalloonRequired(ev))
            {
                NotifyIcon1.BalloonTipIcon = ToolTipIcon.Warning;
                var title = new StringBuilder();
                if (_configs.DispUsername)
                {
                    title.AppendFormat("{0} - ", _tw.Username);
                }

                title.AppendFormat("Hoehoe [{0}] ", ev.Event.ToUpper());
                if (!string.IsNullOrEmpty(ev.Username))
                {
                    title.AppendFormat("by {0}", ev.Username);
                }

                string text = !string.IsNullOrEmpty(ev.Target) ? ev.Target : " ";
                if (_configs.IsNotifyUseGrowl)
                {
                    _growlHelper.Notify(GrowlHelper.NotifyType.UserStreamEvent, ev.Id.ToString(), title.ToString(), text);
                }
                else
                {
                    NotifyIcon1.BalloonTipIcon = ToolTipIcon.Warning;
                    NotifyIcon1.BalloonTipTitle = title.ToString();
                    NotifyIcon1.BalloonTipText = text;
                    NotifyIcon1.ShowBalloonTip(500);
                }
            }

            if (Convert.ToBoolean(ev.Eventtype & _configs.EventNotifyFlag) && IsMyEventNotityAsEventType(ev))
            {
                // サウンド再生
                if (!_isInitializing && _configs.PlaySound)
                {
                    MyCommon.PlaySound(_configs.EventSoundFile);
                }
            }
        }
Exemplo n.º 9
0
 private bool IsBalloonRequired(Twitter.FormattedEvent ev)
 {
     return IsEventNotifyAsEventType(ev.Eventtype)
         && IsMyEventNotityAsEventType(ev)
         && (NewPostPopMenuItem.Checked || (_configs.ForceEventNotify && ev.Eventtype != EventType.None))
         && !_isInitializing
         && ((_configs.LimitBalloon && (WindowState == FormWindowState.Minimized || !Visible || ActiveForm == null)) || !_configs.LimitBalloon)
         && !Win32Api.IsScreenSaverRunning();
 }
Exemplo n.º 10
0
        private void Setting_Load(object sender, EventArgs e)
        {
            GroupBox2.Visible = false;
            _tw = ((TweenMain)Owner).TwitterInstance;
            AuthClearButton.Enabled = true;

            AuthUserCombo.Items.Clear();
            if (_configurations.UserAccounts.Count > 0)
            {
                AuthUserCombo.Items.AddRange(_configurations.UserAccounts.ToArray());
                foreach (var u in _configurations.UserAccounts)
                {
                    if (u.UserId == _tw.UserId)
                    {
                        AuthUserCombo.SelectedItem = u;
                        _initialUserId = u.UserId;
                        break;
                    }
                }
            }

            StartupUserstreamCheck.Checked = _configurations.UserstreamStartup;
            UserstreamPeriod.Text = _configurations.UserstreamPeriodInt.ToString();
            TimelinePeriod.Text = _configurations.TimelinePeriodInt.ToString();
            ReplyPeriod.Text = _configurations.ReplyPeriodInt.ToString();
            DMPeriod.Text = _configurations.DMPeriodInt.ToString();
            PubSearchPeriod.Text = _configurations.PubSearchPeriodInt.ToString();
            ListsPeriod.Text = _configurations.ListsPeriodInt.ToString();
            UserTimelinePeriod.Text = _configurations.UserTimelinePeriodInt.ToString();
            StartupReaded.Checked = _configurations.Readed;

            switch (_configurations.IconSz)
            {
                case IconSizes.IconNone:
                    IconSize.SelectedIndex = 0;
                    break;

                case IconSizes.Icon16:
                    IconSize.SelectedIndex = 1;
                    break;

                case IconSizes.Icon24:
                    IconSize.SelectedIndex = 2;
                    break;

                case IconSizes.Icon48:
                    IconSize.SelectedIndex = 3;
                    break;

                case IconSizes.Icon48_2:
                    IconSize.SelectedIndex = 4;
                    break;
            }

            StatusText.Text = _configurations.Status;
            UReadMng.Checked = _configurations.UnreadManage;
            StartupReaded.Enabled = _configurations.UnreadManage;
            PlaySnd.Checked = _configurations.PlaySound;
            OneWayLv.Checked = _configurations.OneWayLove;
            lblListFont.Font = _configurations.FontReaded;
            lblUnread.Font = _configurations.FontUnread;
            lblUnread.ForeColor = _configurations.ColorUnread;
            lblListFont.ForeColor = _configurations.ColorReaded;
            lblFav.ForeColor = _configurations.ColorFav;
            lblOWL.ForeColor = _configurations.ColorOWL;
            lblRetweet.ForeColor = _configurations.ColorRetweet;
            lblDetail.Font = _configurations.FontDetail;
            lblSelf.BackColor = _configurations.ColorSelf;
            lblAtSelf.BackColor = _configurations.ColorAtSelf;
            lblTarget.BackColor = _configurations.ColorTarget;
            lblAtTarget.BackColor = _configurations.ColorAtTarget;
            lblAtFromTarget.BackColor = _configurations.ColorAtFromTarget;
            lblAtTo.BackColor = _configurations.ColorAtTo;
            lblInputBackcolor.BackColor = _configurations.ColorInputBackcolor;
            lblInputFont.ForeColor = _configurations.ColorInputFont;
            lblInputFont.Font = _configurations.FontInputFont;
            lblListBackcolor.BackColor = _configurations.ColorListBackcolor;
            lblDetailBackcolor.BackColor = _configurations.ColorDetailBackcolor;
            lblDetail.ForeColor = _configurations.ColorDetail;
            lblDetailLink.ForeColor = _configurations.ColorDetailLink;

            switch (_configurations.NameBalloon)
            {
                case NameBalloonEnum.None:
                    cmbNameBalloon.SelectedIndex = 0;
                    break;

                case NameBalloonEnum.UserID:
                    cmbNameBalloon.SelectedIndex = 1;
                    break;

                case NameBalloonEnum.NickName:
                    cmbNameBalloon.SelectedIndex = 2;
                    break;
            }

            if (_configurations.PostCtrlEnter)
            {
                ComboBoxPostKeySelect.SelectedIndex = 1;
            }
            else if (_configurations.PostShiftEnter)
            {
                ComboBoxPostKeySelect.SelectedIndex = 2;
            }
            else
            {
                ComboBoxPostKeySelect.SelectedIndex = 0;
            }

            TextCountApi.Text = _configurations.CountApi.ToString();
            TextCountApiReply.Text = _configurations.CountApiReply.ToString();
            BrowserPathText.Text = _configurations.BrowserPath;
            CheckPostAndGet.Checked = _configurations.PostAndGet;
            CheckUseRecommendStatus.Checked = _configurations.UseRecommendStatus;
            CheckDispUsername.Checked = _configurations.DispUsername;
            CheckCloseToExit.Checked = _configurations.CloseToExit;
            CheckMinimizeToTray.Checked = _configurations.MinimizeToTray;
            switch (_configurations.DispLatestPost)
            {
                case DispTitleEnum.None:
                    ComboDispTitle.SelectedIndex = 0;
                    break;

                case DispTitleEnum.Ver:
                    ComboDispTitle.SelectedIndex = 1;
                    break;

                case DispTitleEnum.Post:
                    ComboDispTitle.SelectedIndex = 2;
                    break;

                case DispTitleEnum.UnreadRepCount:
                    ComboDispTitle.SelectedIndex = 3;
                    break;

                case DispTitleEnum.UnreadAllCount:
                    ComboDispTitle.SelectedIndex = 4;
                    break;

                case DispTitleEnum.UnreadAllRepCount:
                    ComboDispTitle.SelectedIndex = 5;
                    break;

                case DispTitleEnum.UnreadCountAllCount:
                    ComboDispTitle.SelectedIndex = 6;
                    break;

                case DispTitleEnum.OwnStatus:
                    ComboDispTitle.SelectedIndex = 7;
                    break;
            }

            CheckSortOrderLock.Checked = _configurations.SortOrderLock;
            CheckTinyURL.Checked = _configurations.TinyUrlResolve;
            CheckForceResolve.Checked = _configurations.ShortUrlForceResolve;
            switch (_configurations.SelectedProxyType)
            {
                case HttpConnection.ProxyType.None:
                    RadioProxyNone.Checked = true;
                    break;

                case HttpConnection.ProxyType.IE:
                    RadioProxyIE.Checked = true;
                    break;

                default:
                    RadioProxySpecified.Checked = true;
                    break;
            }

            ChangeProxySettingControlsStatus(RadioProxySpecified.Checked);

            TextProxyAddress.Text = _configurations.ProxyAddress;
            TextProxyPort.Text = _configurations.ProxyPort.ToString();
            TextProxyUser.Text = _configurations.ProxyUser;
            TextProxyPassword.Text = _configurations.ProxyPassword;

            CheckPeriodAdjust.Checked = _configurations.PeriodAdjust;
            CheckStartupVersion.Checked = _configurations.StartupVersion;
            CheckStartupFollowers.Checked = _configurations.StartupFollowers;
            CheckFavRestrict.Checked = _configurations.RestrictFavCheck;
            CheckAlwaysTop.Checked = _configurations.AlwaysTop;
            CheckAutoConvertUrl.Checked = _configurations.UrlConvertAuto;
            ShortenTcoCheck.Checked = _configurations.ShortenTco;
            ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
            CheckOutputz.Checked = _configurations.OutputzEnabled;
            ChangeOutputzControlsStatus(CheckOutputz.Checked);
            TextBoxOutputzKey.Text = _configurations.OutputzKey;
            switch (_configurations.OutputzUrlmode)
            {
                case OutputzUrlmode.twittercom:
                    ComboBoxOutputzUrlmode.SelectedIndex = 0;
                    break;

                case OutputzUrlmode.twittercomWithUsername:
                    ComboBoxOutputzUrlmode.SelectedIndex = 1;
                    break;
            }

            CheckNicoms.Checked = _configurations.Nicoms;
            chkUnreadStyle.Checked = _configurations.UseUnreadStyle;
            CmbDateTimeFormat.Text = _configurations.DateTimeFormat;
            ConnectionTimeOut.Text = _configurations.DefaultTimeOut.ToString();
            CheckRetweetNoConfirm.Checked = _configurations.RetweetNoConfirm;
            CheckBalloonLimit.Checked = _configurations.LimitBalloon;
            ApplyEventNotifyFlag(_configurations.EventNotifyEnabled, _configurations.EventNotifyFlag, _configurations.IsMyEventNotifyFlag);
            CheckForceEventNotify.Checked = _configurations.ForceEventNotify;
            CheckFavEventUnread.Checked = _configurations.FavEventUnread;
            ComboBoxTranslateLanguage.SelectedIndex = (new Bing()).GetIndexFromLanguageEnum(_configurations.TranslateLanguage);
            SoundFileListup();
            ComboBoxAutoShortUrlFirst.SelectedIndex = (int)_configurations.AutoShortUrlFirst;
            CheckTabIconDisp.Checked = _configurations.TabIconDisp;
            chkReadOwnPost.Checked = _configurations.ReadOwnPost;
            CheckGetFav.Checked = _configurations.GetFav;
            CheckMonospace.Checked = _configurations.IsMonospace;
            CheckReadOldPosts.Checked = _configurations.ReadOldPosts;
            CheckUseSsl.Checked = _configurations.UseSsl;
            TextBitlyId.Text = _configurations.BitlyUser;
            TextBitlyPw.Text = _configurations.BitlyPwd;
            TextBitlyId.Modified = false;
            TextBitlyPw.Modified = false;
            CheckShowGrid.Checked = _configurations.ShowGrid;
            CheckAtIdSupple.Checked = _configurations.UseAtIdSupplement;
            CheckHashSupple.Checked = _configurations.UseHashSupplement;
            CheckPreviewEnable.Checked = _configurations.PreviewEnable;
            TwitterAPIText.Text = _configurations.TwitterApiUrl;
            TwitterSearchAPIText.Text = _configurations.TwitterSearchApiUrl;
            switch (_configurations.ReplyIconState)
            {
                case ReplyIconState.None:
                    ReplyIconStateCombo.SelectedIndex = 0;
                    break;

                case ReplyIconState.StaticIcon:
                    ReplyIconStateCombo.SelectedIndex = 1;
                    break;

                case ReplyIconState.BlinkIcon:
                    ReplyIconStateCombo.SelectedIndex = 2;
                    break;
            }

            switch (_configurations.Language)
            {
                case "OS":
                    LanguageCombo.SelectedIndex = 0;
                    break;

                case "ja":
                    LanguageCombo.SelectedIndex = 1;
                    break;

                case "en":
                    LanguageCombo.SelectedIndex = 2;
                    break;

                case "zh-CN":
                    LanguageCombo.SelectedIndex = 3;
                    break;

                default:
                    LanguageCombo.SelectedIndex = 0;
                    break;
            }

            HotkeyCheck.Checked = _configurations.HotkeyEnabled;
            HotkeyAlt.Checked = (_configurations.HotkeyMod & Keys.Alt) == Keys.Alt;
            HotkeyCtrl.Checked = (_configurations.HotkeyMod & Keys.Control) == Keys.Control;
            HotkeyShift.Checked = (_configurations.HotkeyMod & Keys.Shift) == Keys.Shift;
            HotkeyWin.Checked = (_configurations.HotkeyMod & Keys.LWin) == Keys.LWin;
            HotkeyCode.Text = _configurations.HotkeyValue.ToString();
            HotkeyText.Text = _configurations.HotkeyKey.ToString();
            HotkeyText.Tag = _configurations.HotkeyKey;
            HotkeyAlt.Enabled = _configurations.HotkeyEnabled;
            HotkeyShift.Enabled = _configurations.HotkeyEnabled;
            HotkeyCtrl.Enabled = _configurations.HotkeyEnabled;
            HotkeyWin.Enabled = _configurations.HotkeyEnabled;
            HotkeyText.Enabled = _configurations.HotkeyEnabled;
            HotkeyCode.Enabled = _configurations.HotkeyEnabled;
            CheckNewMentionsBlink.Checked = _configurations.BlinkNewMentions;
            GetMoreTextCountApi.Text = _configurations.MoreCountApi.ToString();
            FirstTextCountApi.Text = _configurations.FirstCountApi.ToString();
            SearchTextCountApi.Text = _configurations.SearchCountApi.ToString();
            FavoritesTextCountApi.Text = _configurations.FavoritesCountApi.ToString();
            UserTimelineTextCountApi.Text = _configurations.UserTimelineCountApi.ToString();
            ListTextCountApi.Text = _configurations.ListCountApi.ToString();
            UseChangeGetCount.Checked = _configurations.UseAdditionalCount;
            Label28.Enabled = UseChangeGetCount.Checked;
            Label30.Enabled = UseChangeGetCount.Checked;
            Label53.Enabled = UseChangeGetCount.Checked;
            Label66.Enabled = UseChangeGetCount.Checked;
            Label17.Enabled = UseChangeGetCount.Checked;
            Label25.Enabled = UseChangeGetCount.Checked;
            GetMoreTextCountApi.Enabled = UseChangeGetCount.Checked;
            FirstTextCountApi.Enabled = UseChangeGetCount.Checked;
            SearchTextCountApi.Enabled = UseChangeGetCount.Checked;
            FavoritesTextCountApi.Enabled = UseChangeGetCount.Checked;
            UserTimelineTextCountApi.Enabled = UseChangeGetCount.Checked;
            ListTextCountApi.Enabled = UseChangeGetCount.Checked;
            CheckOpenUserTimeline.Checked = _configurations.OpenUserTimeline;
            ListDoubleClickActionComboBox.SelectedIndex = _configurations.ListDoubleClickAction;
            UserAppointUrlText.Text = _configurations.UserAppointUrl;
            HideDuplicatedRetweetsCheck.Checked = _configurations.HideDuplicatedRetweets;
            IsPreviewFoursquareCheckBox.Checked = _configurations.IsPreviewFoursquare;
            FoursquarePreviewHeightTextBox.Text = _configurations.FoursquarePreviewHeight.ToString();
            FoursquarePreviewWidthTextBox.Text = _configurations.FoursquarePreviewWidth.ToString();
            FoursquarePreviewZoomTextBox.Text = _configurations.FoursquarePreviewZoom.ToString();
            IsListsIncludeRtsCheckBox.Checked = _configurations.IsListStatusesIncludeRts;
            TabMouseLockCheck.Checked = _configurations.TabMouseLock;
            IsRemoveSameFavEventCheckBox.Checked = _configurations.IsRemoveSameEvent;
            IsNotifyUseGrowlCheckBox.Checked = _configurations.IsNotifyUseGrowl;
            IsNotifyUseGrowlCheckBox.Enabled = GrowlHelper.IsDllExists;

            TreeViewSetting.Nodes["BasedNode"].Tag = BasedPanel;
            TreeViewSetting.Nodes["BasedNode"].Nodes["PeriodNode"].Tag = GetPeriodPanel;
            TreeViewSetting.Nodes["BasedNode"].Nodes["StartUpNode"].Tag = StartupPanel;
            TreeViewSetting.Nodes["BasedNode"].Nodes["GetCountNode"].Tag = GetCountPanel;
            TreeViewSetting.Nodes["ActionNode"].Tag = ActionPanel;
            TreeViewSetting.Nodes["ActionNode"].Nodes["TweetActNode"].Tag = TweetActPanel;
            TreeViewSetting.Nodes["PreviewNode"].Tag = PreviewPanel;
            TreeViewSetting.Nodes["PreviewNode"].Nodes["TweetPrvNode"].Tag = TweetPrvPanel;
            TreeViewSetting.Nodes["PreviewNode"].Nodes["NotifyNode"].Tag = NotifyPanel;
            TreeViewSetting.Nodes["FontNode"].Tag = FontPanel;
            TreeViewSetting.Nodes["FontNode"].Nodes["FontNode2"].Tag = FontPanel2;
            TreeViewSetting.Nodes["ConnectionNode"].Tag = ConnectionPanel;
            TreeViewSetting.Nodes["ConnectionNode"].Nodes["ProxyNode"].Tag = ProxyPanel;
            TreeViewSetting.Nodes["ConnectionNode"].Nodes["CooperateNode"].Tag = CooperatePanel;
            TreeViewSetting.Nodes["ConnectionNode"].Nodes["ShortUrlNode"].Tag = ShortUrlPanel;

            TreeViewSetting.SelectedNode = TreeViewSetting.Nodes[0];
            TreeViewSetting.ExpandAll();
            ActiveControl = StartAuthButton;
        }
Exemplo n.º 11
0
 public TwitterPhoto(Twitter twitter)
 {
     _tw = twitter;
 }
Exemplo n.º 12
0
        private bool IsFilterMatch(Twitter.FormattedEvent x)
        {
            if (!CheckBoxFilter.Checked || string.IsNullOrEmpty(TextBoxKeyword.Text))
            {
                return true;
            }

            if (!CheckRegex.Checked)
            {
                return x.Username.Contains(TextBoxKeyword.Text) || x.Target.Contains(TextBoxKeyword.Text);
            }

            try
            {
                var rx = new Regex(TextBoxKeyword.Text);
                return rx.Match(x.Username).Success || rx.Match(x.Target).Success;
            }
            catch (Exception ex)
            {
                MessageBox.Show(R.ButtonOK_ClickText3 + ex.Message, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return false;
            }
        }
Exemplo n.º 13
0
 private ListViewItem CreateListViewItem(Twitter.FormattedEvent source)
 {
     return new ListViewItem(new[] { source.CreatedAt.ToString(), source.Event.ToUpper(), source.Username, source.Target });
 }