private void postMessage() { string user = commandlineparameters[0]; string Message = commandlineparameters[2]; tweetyMessage newmessage = new tweetyMessage(user, Message); TweetMessageWriter tmw = new TweetMessageWriter(newmessage); tweetMessageReader tmr = new tweetMessageReader(false); tmr.addMessage(newmessage); tmw.writeMessage(); this.sb.AppendLine("New Post!..."); this.sb.AppendLine(tmr.ToString()); }
public followUser(string p1, string p2) { // TODO: Complete member initialization this.user = p1; this.followeduser = p2; // FileInfo fi = TweetRepository.GetUsersFollowerFile(this.user); StreamWriter sw = new StreamWriter(fi.FullName, true); //write this followed user to the follows file. sw.WriteLine(followeduser); sw.Close(); //tell the world who the user is following tweetyMessage fm = new tweetyMessage(user, string.Format("{0} is following {1}", user, followeduser)); TweetMessageWriter tm = new TweetMessageWriter(fm); tm.writeMessage(); }