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

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

            HttpClient client = new HttpClient();
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#6
0
        public void Remove()
        {
            var request = Reddit.CreatePost(RemoveUrl);

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