public TwitterControl(Tweet tweet) { this.tweet = tweet; }
private void CreateTwitterUpdate(Element element, string fileFullName, Tweet tweet) { TwitterControl tc = new TwitterControl(tweet); if (tc.Update()) { CreateShortcut(element, tc.GetTweetURL(), fileFullName); } else { throw new Exception("Failed to create Twitter update."); } }
private void HandleICC(Element element, ICCAssociationType type) { // Note: defaultName does NOT contain file extension string defaultName = String.Empty; bool insertBelow = true; TextBox tb = GetTextBox(element); if (tb.SelectionStart == 0 && tb.Text != String.Empty) { insertBelow = false; } if (tb.SelectedText != String.Empty) { defaultName = tb.SelectedText; insertBelow = true; } else { defaultName = element.NoteText; } if (defaultName.Length > StartProcess.MAX_EXTRACTNAME_LENGTH) defaultName = defaultName.Substring(0, StartProcess.MAX_EXTRACTNAME_LENGTH); while (defaultName.EndsWith(".")) defaultName = defaultName.TrimEnd('.'); switch (type) { case ICCAssociationType.TwitterUpdate: TwitterWindow tw = new TwitterWindow(defaultName); if (tw.ShowDialog().Value == true) { Tweet tweet = new Tweet{ Username = tw.Username, Password = tw.Password, Message = tw.Tweet, }; elementControl.ICC(element, tweet, insertBelow, type); } break; case ICCAssociationType.OutlookEmailMessage: if (defaultName.Trim() == String.Empty) { defaultName = "New Email"; } elementControl.ICC(element, defaultName, insertBelow, type); break; default: string fileFullName = element.Path + ICCFileNameHandler.GenerateFileName(defaultName, type); FileNameWindow fnw = new FileNameWindow(fileFullName, type); if (fnw.ShowDialog().Value == true) { elementControl.ICC(element, fnw.FileName, insertBelow, type); } break; }; GetFocusToElementTextBox(elementControl.CurrentElement, elementControl.CurrentElement.NoteText.Length, false, false); }