Example #1
0
        public void RemoveSpam()
        {
            var request = Reddit.CreatePost(RemoveUrl);

            request.BeginGetRequestStream(new AsyncCallback(RemoveSpamRequest), request);

            HttpClient client = new HttpClient();
        }
Example #2
0
        public void Distinguish(DistinguishType distinguishType)
        {
            if (Reddit.User == null)
            {
                throw new Exception("No user logged in.");
            }
            var          request      = Reddit.CreatePost(DistinguishUrl);
            CommentState commentState = new CommentState();

            commentState.AsyncRequest   = request;
            commentState.ParameterValue = distinguishType;
            request.BeginGetRequestStream(new AsyncCallback(DistinguishRequest), commentState);
        }
Example #3
0
        public void EditText(string newText)
        {
            if (Reddit.User == null)
            {
                throw new Exception("No user logged in.");
            }

            var          request      = Reddit.CreatePost(EditUserTextUrl);
            CommentState commentState = new CommentState();

            commentState.AsyncRequest   = request;
            commentState.ParameterValue = newText;

            request.BeginGetRequestStream(new AsyncCallback(EditTextRequest), commentState);
        }
Example #4
0
        public Comment Comment(string message)
        {
            if (Reddit.User == null)
            {
                throw new Exception("No user logged in.");
            }
            StateObject postState = new StateObject();
            var         request   = Reddit.CreatePost(CommentUrl);

            postState.Request        = request;
            postState.ParameterValue = message;

            IAsyncResult commentRequestAR  = request.BeginGetRequestStream(new AsyncCallback(CommentRequest), postState);
            IAsyncResult commentResponseAR = request.BeginGetResponse(new AsyncCallback(CommentResponse), postState);

            return(returnComment);
        }
Example #5
0
        public Comment Reply(string message)
        {
            if (Reddit.User == null)
            {
                // RedditSharp used an AuthenticationException
                // but it's not available for Windows Phone
                throw new Exception("No user logged in.");
            }

            CommentState commentState = new CommentState();
            var          request      = Reddit.CreatePost(CommentUrl);

            commentState.AsyncRequest   = request;
            commentState.ParameterValue = message;

            IAsyncResult replyRequestAR  = request.BeginGetRequestStream(new AsyncCallback(ReplyRequest), commentState);
            IAsyncResult replyResponseAR = request.BeginGetResponse(new AsyncCallback(ReplyResponse), commentState);

            return(returnComment);
        }
Example #6
0
        public void Remove()
        {
            var request = Reddit.CreatePost(RemoveUrl);

            request.BeginGetRequestStream(new AsyncCallback(RemoveRequest), request);
        }