예제 #1
0
 protected virtual void LoadComments(CommentItem addedComment)
 {
     // Comments enabled and exist?
     if (CurrentEntry.DisableComments.Checked || ManagerFactory.CommentManagerInstance.GetCommentsCount() == 0)
     {
         if (CommentList != null)
         {
             CommentList.Visible = false;
         }
     }
     else
     {
         if (ListViewComments != null)
         {
             CommentItem[] comments = ManagerFactory.CommentManagerInstance.GetEntryComments();
             //if a comment has been added but is not coming back yet (i.e. being indexed), fake it
             if (addedComment != null && comments.Count(comment => comment.ID == addedComment.ID) == 0)
             {
                 List <CommentItem> newList = new List <CommentItem>();
                 newList.Add(addedComment);
                 newList.AddRange(comments);
                 comments = newList.ToArray();
             }
             ListViewComments.DataSource = comments;
             ListViewComments.DataBind();
         }
     }
 }
예제 #2
0
파일: Json.cs 프로젝트: rxtur/be-plugins
        /// <summary>
        /// Convert json comment back to BE comment
        /// </summary>
        /// <param name="c">Json comment</param>
        /// <returns>Comment</returns>
        public static Comment SetComment(CommentItem c)
        {
            Comment item = (from p in Post.Posts
                            from cmn in p.AllComments
                            where cmn.Id == c.Id
                            select cmn).FirstOrDefault();

            if (c.IsPending)
            {
                item.IsApproved = false;
                item.IsSpam     = false;
            }
            if (c.IsApproved)
            {
                item.IsApproved = true;
                item.IsSpam     = false;
            }
            if (c.IsSpam)
            {
                item.IsApproved = false;
                item.IsSpam     = true;
            }

            item.Email  = c.Email;
            item.Author = c.Author;
            return(item);
        }
예제 #3
0
        public async Task <IActionResult> Post([FromBody] CommentItem item)
        {
            var commentRepository = _unitOfWork.GetRepository <Comment>();
            var postRepository    = _unitOfWork.GetRepository <Post>();

            try
            {
                var post = await postRepository.GetFirstOrDefaultAsync(predicate : m => m.Id == item.PostId);

                var newItem = new Comment()
                {
                    Content     = item.Content,
                    CreateDate  = DateTime.UtcNow,
                    DisplayName = item.DisplayName,
                    Ip          = AspNetCoreHelper.GetRequestIP(),
                    Posts       = post,
                    Email       = item.Email,
                    IsApproved  = true,
                    ParentId    = item.ParentId,
                };
                await commentRepository.InsertAsync(newItem);

                await _unitOfWork.SaveChangesAsync();

                item.Id          = newItem.Id;
                item.HasChildren = false;
                item.IsApproved  = true;
                item.DateCreated = newItem.CreateDate.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture);
                return(Ok(item));
            }
            catch (Exception ex)
            {
                return(NotFound());
            }
        }
예제 #4
0
        public void Process(PopulateScribanMailActionModelArgs args)
        {
            EntryItem   entryItem   = null;
            CommentItem commentItem = null;

            var dataItem = args.WorkflowPipelineArgs.DataItem;

            if (_templateManager.TemplateIsOrBasedOn(dataItem, _settings.EntryTemplateIds))
            {
                entryItem = new EntryItem(args.WorkflowPipelineArgs.DataItem);
            }
            else if (_templateManager.TemplateIsOrBasedOn(dataItem, _settings.CommentTemplateIds))
            {
                commentItem = new CommentItem(args.WorkflowPipelineArgs.DataItem);
                entryItem   = _entryManager.GetBlogEntryItemByCommentUri(commentItem.InnerItem.Uri);
            }

            if (args.EntryItem == null && entryItem != null)
            {
                args.EntryItem = entryItem;
            }

            if (args.CommentItem == null && commentItem != null)
            {
                args.CommentItem = commentItem;
            }
        }
예제 #5
0
 private void DeleteComment(CommentItem obj)
 {
     this.VM.DeleteComment(obj.Comment.cid);
     this.virtPanel.RemoveItem((IVirtualizable)obj);
     this._runningCommentsCount = this._runningCommentsCount - 1;
     this.KeepCommentsCountItemUpToDate();
 }
예제 #6
0
        void _postsList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            var comments = sender as ObservableCollection <MainViewModel.post_with_username_wrapper>;

            if (comments != null)
            {
                //start from new startindex
                for (int i = e.NewStartingIndex; i < comments.Count; i++)
                {
                    MainViewModel.post_with_username_wrapper c = comments[i];
                    var newcom = new CommentItem();
                    newcom.UserImage.Background = new ImageBrush()
                    {
                        Stretch = Stretch.UniformToFill, ImageSource = Constants.ByteArrayToImageConverter.Convert(c.userImage)
                    };
                    c.PropertyChanged += (s, a) =>
                    {
                        newcom.UserImage.Background = new ImageBrush()
                        {
                            Stretch = Stretch.UniformToFill, ImageSource = Constants.ByteArrayToImageConverter.Convert(c.userImage)
                        };
                    };
                    newcom.CommentText.Text = c.post.text;
                    newcom.NameText.Text    = c.post.name + " " + c.post.lastname;
                    newcom.DateText.Text    = "    " + c.post.created_at.Date.ToString();
                    _mainpanel.Children.Add(newcom);
                }
            }
        }
예제 #7
0
        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                CommentItem item = new CommentItem();
                item.Username   = this.Username.Text;
                item.Comment    = this.Comment.Text;
                item.CreatedAt  = DateTime.Now;
                item.RegionCode = ViewModelLocator.MainStatic.CurrentSelectedRegionItem.Code.ToString();
                ViewModelLocator.MainStatic.AddBox.IsOpen = false;
                if ((item.Username != "") && (item.Username != ""))
                {
                    await CommentTable.InsertAsync(item);

                    MessageDialog result = new MessageDialog("Комментарий успешно добавлен.");
                    result.ShowAsync();
                }
                else
                {
                    MessageDialog result = new MessageDialog("Укажите ваше имя и текст комментария.");
                    result.ShowAsync();
                };
            }
            catch { };
        }
예제 #8
0
        public async void Execute(CreateCommentCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }
            if (_repository == null)
            {
                throw new InvalidOperationException("Repository is not initialized.");
            }
            var instruction = await _repository.FindAsync(command.Id);

            var aggregate = new CommentItem
                                (command.Id, command.AdaptivReconId, command.Reference, command.ReconStatus,
                                command.Comments, command.Username, command.BusinessDate, command.CommentDate);

            if (instruction != null)
            {
                await _repository.UpdateAsync(Mapper.Map <CommentItem, MetaAdaptivReconComment>(aggregate));
            }
            else
            {
                await _repository.AddAsync(Mapper.Map <CommentItem, MetaAdaptivReconComment>(aggregate));
            }
        }
예제 #9
0
 public CommentItem Add(CommentItem item)
 {
     return(new CommentItem()
     {
         Id = Guid.NewGuid()
     });
 }
예제 #10
0
    void AddButtonList()
    {
        foreach (Transform child in contentPanel.GetComponentsInChildren <Transform>())
        {
            if (child.gameObject.name.Equals("CommentItem"))
            {
                Destroy(child.gameObject);
            }
        }
        if (tempResutl.Count > 0)
        {
            results.AddRange(tempResutl);
        }

        for (int i = 0; i < results.Count; i++)
        {
            Debug.Log(results);
            ParseObject obj  = results[i];
            ParseUser   user = (ParseUser)obj["user"];

            //Debug.Log(obj["stars"].GetType());
            GameObject newobj;
            newobj = (GameObject)Instantiate(commentItemPrefab);
            newobj.transform.SetParent(contentPanel);
            newobj.transform.localScale = new Vector3(1f, 1f, 1f);
            newobj.name = "CommentItem";
            CommentItem map = newobj.GetComponent <CommentItem>();
            map.createRow((string)user["nickName"], obj.CreatedAt.ToString(), (string)obj["content"]);
            if (i == results.Count - 1)
            {
                loadMore = false;
            }
        }
    }
예제 #11
0
        public async Task <ActionResult <CommentItem> > PostCommentItem(CommentItem item)
        {
            _context.CommentItems.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetCommentItem), new { id = item.Id }, item));
        }
        public override DataItem CreateData(UndoRedoManager undoRedo)
        {
            var comment = new CommentItem(this, undoRedo);

            comment.Value = Text;
            return(comment);
        }
예제 #13
0
        private static void TestOthers(BuildDocumenter documenter,
                                       TestOptions options, ReferenceEngineSettings engineSettings)
        {
            if (tocType == CustomTocType.ReferenceRoot)
            {
                return;
            }

            //string libraryDir = Path.Combine(sampleDir, @"SampleTestLibraryCLR\");
            //string outputDir = Path.Combine(libraryDir, @"Output\");
            //string projectDoc = Path.Combine(outputDir, "Project.xml");

            string sourceFile =
                @"F:\SandcastleAssist\Main\Samples\HelpersSamples.sln";
            ReferenceVsNetSource vsSource = new ReferenceVsNetSource();
            ReferenceVsNetItem   vsItem   = new ReferenceVsNetItem(
                new BuildFilePath(sourceFile));

            //vsItem.XamlSyntax = false;
            vsItem.AddInclude("{41A48F1C-3E52-4995-B181-363EDBC02CA0}");
            vsSource.Add(vsItem);

            CommentContent comments = vsSource.Comments;
            CommentItem    projItem = new CommentItem("R:Project",
                                                      CommentItemType.Project);

            projItem.Value.Add(new CommentPart("Summary of the project",
                                               CommentPartType.Summary));
            comments.Add(projItem);
            CommentItem nsItem = new CommentItem("N:TestLibraryCLR",
                                                 CommentItemType.Namespace);

            nsItem.Value.Add(new CommentPart("Summary of the namespace",
                                             CommentPartType.Summary));
            comments.Add(nsItem);

            ReferenceGroup apiGroup = new ReferenceGroup(
                "Test CPP-CLR Library", Guid.NewGuid().ToString(), vsSource);

            apiGroup.RunningHeaderText = "Sandcastle Helpers: C++/CLR Library";

            apiGroup.VersionType = ReferenceVersionType.AssemblyAndFile;

            if (engineSettings.RootNamespaceContainer)
            {
                apiGroup.RootNamespaceTitle = "Testing C++/CLR Library";
            }

            //ReferenceContent apiContent = apiGroup.Content;
            //apiContent.FrameworkType = BuildFrameworkType.Framework20;

            //apiGroup.AddItem(projectDoc, null);
            //apiContent.AddItem(Path.Combine(outputDir, "SampleLibraryCLR.xml"),
            //    Path.Combine(outputDir, "SampleLibraryCLR.dll"));

            //apiContent.AddDependency(Path.Combine(outputDir, ""));

            documenter.AddGroup(apiGroup);
        }
예제 #14
0
 private void editCommentCallback(CommentItem commentItem)
 {
     commentItem.Comment.GroupId = this._gid;
     commentItem.Comment.TopicId = this._tid;
     ParametersRepository.SetParameterForId("EditDiscussionComment", (object)commentItem.Comment);
     ParametersRepository.SetParameterForId("CidToAuthorIdDict", (object)this.GetCidToAuthorDict());
     Navigator.Current.NavigateToNewWallPost(Math.Abs(commentItem.Comment.owner_id), commentItem.Comment.owner_id < 0, 0, false, false, false);
 }
예제 #15
0
 /// <summary>
 /// Проверяет еквивалентны ли два комментария.
 /// </summary>
 /// Описание входных параметров.
 /// <param name="first_comment">Первый комментарий для сравнения.</param>
 /// <param name="second_comment">Второй комментарий для сравнения.</param>
 private void AreEqualComments(CommentItem first_comment, CommentItem second_comment)
 {
     Assert.AreEqual(first_comment.Id, second_comment.Id);
     Assert.AreEqual(first_comment.AddDate, second_comment.AddDate);
     Assert.AreEqual(first_comment.PersonId, second_comment.PersonId);
     Assert.AreEqual(first_comment.Text, second_comment.Text);
     Assert.AreEqual(first_comment.TaskId, second_comment.TaskId);
 }
예제 #16
0
        public void ImplicitOperatorFromItem_NullItem_ReturnsNull()
        {
            // arrange, act
            CommentItem commentItem = (Item)null;

            // assert
            Assert.That(commentItem, Is.Null);
        }
예제 #17
0
파일: CommentService.cs 프로젝트: dha01/IS
        /// <summary>
        /// Создает комментарий.
        /// </summary>
        /// <param name="comment">Комментарий.</param>
        /// <returns>Идентификаторо созданного комментария.</returns>
        public int Create(CommentItem comment)
        {
            if (string.IsNullOrEmpty(comment.Text))
            {
                throw new Exception("Поле 'Text' не должно быть пустым.");
            }

            return(_commentRepository.Create(comment));
        }
예제 #18
0
        /// <summary>
        /// Gets the entry item for the current comment.
        /// </summary>
        /// <param name="commentItem">The comment item.</param>
        /// <returns></returns>
        public virtual EntryItem GetBlogEntryByComment(CommentItem commentItem)
        {
            if (commentItem == null)
            {
                return(null);
            }

            return(commentItem.InnerItem.FindAncestorByAnyTemplate(Settings.EntryTemplateIds));
        }
예제 #19
0
        /// <summary>
        /// Update item
        /// </summary>
        /// <param name="item">Item to update</param>
        /// <param name="action">Action</param>
        /// <returns>True on success</returns>
        public bool Update(CommentItem item, string action)
        {
            if (!Security.IsAuthorizedTo(Rights.ModerateComments))
            {
                throw new UnauthorizedAccessException();
            }

            foreach (var p in Post.Posts.ToArray())
            {
                foreach (var c in p.Comments.Where(c => c.Id == item.Id).ToArray())
                {
                    if (action == "approve")
                    {
                        c.IsApproved   = true;
                        c.IsSpam       = false;
                        p.DateModified = DateTime.Now;
                        p.Save();
                        return(true);
                    }

                    if (action == "unapprove")
                    {
                        c.IsApproved   = false;
                        c.IsSpam       = true;
                        p.DateModified = DateTime.Now;
                        p.Save();
                        return(true);
                    }

                    //c.Content = item.Content;
                    c.Author = item.Author;
                    c.Email  = item.Email;
                    //c.Website = string.IsNullOrEmpty(item.Website) ? null : new Uri(item.Website);

                    if (item.IsPending)
                    {
                        c.IsApproved = false;
                        c.IsSpam     = false;
                    }
                    if (item.IsApproved)
                    {
                        c.IsApproved = true;
                        c.IsSpam     = false;
                    }
                    if (item.IsSpam)
                    {
                        c.IsApproved = false;
                        c.IsSpam     = true;
                    }
                    // need to mark post as "dirty"
                    p.DateModified = DateTime.Now;
                    p.Save();
                    return(true);
                }
            }
            return(false);
        }
예제 #20
0
 private void deleteCommentCallback(CommentItem obj)
 {
     if (obj.Comment.cid == 0L)
     {
         return;
     }
     this._virtPanel.RemoveItem((IVirtualizable)obj);
     GroupsService.Current.DeleteComment(this._gid, this._tid, obj.Comment.cid, (Action <BackendResult <ResponseWithId, ResultCode> >)(res => this.PublishChangedEvent()));
 }
예제 #21
0
        private void replyCallback(CommentItem obj)
        {
            TextBox textBoxNewComment = this.newCommentUC.TextBoxNewComment;
            string  str = textBoxNewComment.Text + string.Format("[post{0}|{1}], ", (object)obj.Comment.cid, (object)obj.NameWithoutLastName);

            textBoxNewComment.Text = (str);
            ((Control)this.newCommentUC.TextBoxNewComment).Focus();
            this.newCommentUC.TextBoxNewComment.Select(this.newCommentUC.TextBoxNewComment.Text.Length, 0);
        }
예제 #22
0
        public EventModel addCommentToEvent(EventModel e, CommentItem c)
        {
            List <CommentItem> comments = e.getComments();

            comments.Add(c);
            e.setComments(comments);
            saveEvent(e);
            return(e);
        }
예제 #23
0
        protected void buttonSaveComment_Click(object sender, EventArgs e)
        {
            if (MessagePanel != null)
            {
                MessagePanel.Visible = false;
            }
            if (Page.IsValid)
            {
                Comment comment = new Comment
                {
                    AuthorName  = GetFormValue(txtCommentName),
                    AuthorEmail = GetFormValue(txtCommentEmail),
                    Text        = GetFormValue(txtCommentText)
                };
                comment.Fields.Add(Constants.Fields.Website, GetFormValue(txtCommentWebsite));
                comment.Fields.Add(Constants.Fields.IpAddress, Context.Request.UserHostAddress);

                var result = ValidateCommentCore.Validate(comment, Request.Form);

                ID submissionResult = null;

                if (result.Success)
                {
                    submissionResult = SubmitCommentCore.Submit(comment);
                    if (submissionResult.IsNull)
                    {
                        SetErrorMessage(Translator.Text("COMMENT_SUBMIT_ERROR"));
                    }
                    else
                    {
                        SetSuccessMessage(Translator.Text("COMMENT_SUBMIT_SUCCESS"));
                        ResetCommentFields();
                    }
                }
                else
                {
                    var text = string.Join(", ", result.Errors);
                    SetErrorMessage(text);
                }

                //check if added comment is available. if so, send it along with the event
                //won't happen unless publishing and indexing is really fast, but worth a try
                var         newCommentReference = CommentManager.GetEntryComments(Sitecore.Context.Item, int.MaxValue).SingleOrDefault(item => item.Uri.ItemID == submissionResult);
                CommentItem newComment          = null;

                if (newCommentReference != null)
                {
                    newComment = Database.GetItem(newCommentReference.Uri);
                }

                Sitecore.Events.Event.RaiseEvent(Constants.Events.UI.COMMENT_ADDED, new object[] { newComment });

                //display javascript to scroll right to the comments list
                CommentScroll.Visible = true;
            }
        }
예제 #24
0
        /// <summary>
        /// Gets the entry item for the current comment.
        /// </summary>
        /// <param name="commentItem">The comment item.</param>
        /// <returns></returns>
        public EntryItem GetBlogEntryByComment(CommentItem commentItem)
        {
            Item[] blogEntry = commentItem.InnerItem.Axes.GetAncestors().Where(item => item.TemplateIsOrBasedOn(Settings.EntryTemplateID)).ToArray();

            if (blogEntry.Length > 0)
            {
                return(new EntryItem(blogEntry.FirstOrDefault()));
            }
            return(null);
        }
예제 #25
0
        public ActionResult Submit(string title, string text)
        {
            CommentItem comment = Engine.Definitions.CreateInstance <CommentItem>(CurrentItem);

            comment.Title = Server.HtmlEncode(title);
            comment.Text  = Server.HtmlEncode(text);
            Engine.Persister.Save(comment);

            return(RedirectToAction("index"));
        }
예제 #26
0
    public HttpResponseMessage DeleteAll([FromBody] CommentItem item)
    {
        var action = Request.GetRouteData().Values["id"].ToString();

        if (action.ToLower() == "pending" || action.ToLower() == "spam")
        {
            repository.DeleteAll(action);
        }
        return(Request.CreateResponse(HttpStatusCode.OK));
    }
예제 #27
0
        public async Task Update(CommentItem comment)
        {
            using (var session = SessionManager.OpenSession())
                using (var transaction = session.BeginTransaction())
                {
                    await session.UpdateAsync(comment);

                    await transaction.CommitAsync();
                }
        }
예제 #28
0
        public IActionResult DeleteAll([FromBody] CommentItem item)
        {
            var action = ControllerContext.RouteData.Values["id"].ToString().ToLowerInvariant();

            if (action.ToLower() == "pending" || action.ToLower() == "spam")
            {
                repository.DeleteAll(action);
            }
            return(Ok());
        }
예제 #29
0
 /// <summary>
 /// Get the name of the blog entry a comment was made against
 /// </summary>
 /// <param name="comment">The comment to find the blog entry title for</param>
 /// <returns>The title if found, otherwise an empty string</returns>
 public virtual string GetEntryTitleForComment(CommentItem comment)
 {
     if (comment != null)
     {
         return(ManagerFactory.EntryManagerInstance.GetBlogEntryByComment(comment).Title.Text);
     }
     else
     {
         return(string.Empty);
     }
 }
예제 #30
0
 /// <summary>
 /// Get the URL of the blog entry a comment was made against
 /// </summary>
 /// <param name="comment">The comment to find the blog entry URL for</param>
 /// <returns>The URL if found, otherwise an empty string</returns>
 public virtual string GetEntryUrlForComment(CommentItem comment)
 {
     if (comment != null)
     {
         return(LinkManager.GetItemUrl(ManagerFactory.EntryManagerInstance.GetBlogEntryByComment(comment).InnerItem));
     }
     else
     {
         return(string.Empty);
     }
 }
예제 #31
0
		public override Item newItem(XmlNode node,
			XmlEditor document)
		{
			Item item = null;

			if (node.NodeType == XmlNodeType.Element) 
			{
				item = new ElementItem(document);
			}
			else if (node.NodeType == XmlNodeType.Attribute )
			{
				item = new AttrItem(document);
			}
			else if (node.NodeType == XmlNodeType.Text) 
			{
				item = new TextItem(document);
			}
			else if (node.NodeType == XmlNodeType.ProcessingInstruction )
			{
				item = new ProcessingInstructionItem(document);
			}
			else if (node.NodeType == XmlNodeType.XmlDeclaration )
			{
				item = new DeclarationItem(document);
			}
			else if (node.NodeType == XmlNodeType.Comment)
			{
				item = new CommentItem(document);
			}
			else if (node.NodeType == XmlNodeType.CDATA)
			{
				item = new CDATAItem(document);
			}
			else if (node.NodeType == XmlNodeType.DocumentType)
			{
				item = new DocumentTypeItem(document);
			}
			else if (node.NodeType == XmlNodeType.EntityReference)
			{
				item = new EntityReferenceItem(document);
			}

			//item.m_document = document;
			return item;
		}
예제 #32
0
 void _postsList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     var comments = sender as ObservableCollection<MainViewModel.post_with_username_wrapper>;
     if (comments != null)
     {
         //start from new startindex
         for (int i = e.NewStartingIndex; i < comments.Count; i++)
         {
             MainViewModel.post_with_username_wrapper c = comments[i];
             var newcom = new CommentItem();
             newcom.UserImage.Background = new ImageBrush() { Stretch = Stretch.UniformToFill, ImageSource = Constants.ByteArrayToImageConverter.Convert(c.userImage) };
             c.PropertyChanged += (s, a) =>
             {
                 newcom.UserImage.Background = new ImageBrush() { Stretch = Stretch.UniformToFill, ImageSource = Constants.ByteArrayToImageConverter.Convert(c.userImage) };
             };
             newcom.CommentText.Text = c.post.text;
             newcom.NameText.Text = c.post.name + " " + c.post.lastname;
             newcom.DateText.Text = "    " + c.post.created_at.Date.ToString();
             _mainpanel.Children.Add(newcom);
         }
     }
         
 }
예제 #33
0
        /// <summary>
        /// получаем комменты
        /// </summary>
        private void ListCommentsCallback()
        {
            var requestString = string.Format("https://api.vk.com/method/wall.getComments?access_token={0}&owner_id={1}&post_id={2}&sort=desc", Client.Instance.Access_token.token, _uid, _postId);
            requestString = _uidlist.Aggregate(requestString, (current, item) => current + ("," + item));
            var web = (HttpWebRequest)WebRequest.Create(requestString);
            web.Method = "POST";
            web.ContentType = "application/x-www-form-urlencoded";
            web.BeginGetResponse(delegate(IAsyncResult e)
            {
                var request = (HttpWebRequest)e.AsyncState;
                var response = (HttpWebResponse)request.EndGetResponse(e);
                var responseReader = new StreamReader(response.GetResponseStream());

                try
                {
                    var responseString = responseReader.ReadToEnd();
                    var o = JObject.Parse(responseString);
                    try
                    {

                        var responseArray = (JArray)o["response"];
                        for (var i = 1; i < responseArray.Count; i++)
                        {
                            var commentItem = new CommentItem
                                                  {
                                                      Cid = (int)responseArray[i]["cid"],
                                                      Uid = (int)responseArray[i]["uid"],
                                                      Date =
                                                          new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(
                                                              Convert.ToDouble((int)responseArray[i]["date"])),
                                                      Text = (string)responseArray[i]["text"]
                                                  };
                            //if ((int)responseArray[i]["reply_to_uid"] > 0) { commentItem.ReplyToUid = (int)responseArray[i]["reply_to_uid"]; }
                            //if ((int)responseArray[i]["reply_to_cid"] > 0) { commentItem.ReplyToCid = (int)responseArray[i]["reply_to_cid"]; }
                            FeedItem.Comments.Add(commentItem);
                            _uidlist.Add((int)responseArray[i]["uid"]);
                        }
                    }
                    catch
                    {
                        switch ((int)o["error"]["error_code"])
                        {
                            case 212:
                                {
                                    Dispatcher.BeginInvoke(() =>
                                                               {
                                                                   CommentBox.Visibility = Visibility.Collapsed;
                                                                   MessageBox.Show("Вы не можете читать и оставлять комментарии");
                                                               });
                                    break;
                                }
                        }
                    }
                    Dispatcher.BeginInvoke(ListProfileCallback);
                }
                catch (Exception exception)
                {
                    Dispatcher.BeginInvoke(() => MessageBox.Show(exception.Message));
                }
            }, web);
            if (progressBar1.IsIndeterminate == false)
            {
                progressBar1.IsIndeterminate = true;
            }
        }
예제 #34
0
파일: XmlEditor.cs 프로젝트: renyh1013/dp2
		// 创建一个CommentItem
		// parameter:
		//		strValue	值
		public CommentItem CreateCommentItem(string strValue)
		{
			CommentItem item = new CommentItem(this);
			item.SetValue(strValue);
			return item;
		}