• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CommentType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CommentType的典型用法代码示例。如果您正苦于以下问题:C# CommentType类的具体用法?C# CommentType怎么用?C# CommentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommentType类属于命名空间,在下文中一共展示了CommentType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CommentNode

 public CommentNode(int col, int line, string value, CommentType type)
 {
     this.col = col;
     this.line = line;
     Value = value;
     Type = type;
 }
开发者ID:qingemeng,项目名称:designscript,代码行数:7,代码来源:AssociativeAST.cs


示例2: LogCommentM

        //主线程中在窗口打印日志信息
        private void LogCommentM(CommentType commentType, string comment)
        {
            string mark = null;
            ItemType itemType = ItemType.Error;
            if (commentType == CommentType.Info)
            {
                mark = "消息";
                itemType = ItemType.Info;
            }
            else if (commentType == CommentType.Warn)
            {
                mark = "警告";
                itemType = ItemType.Warn;
            }
            else if (commentType == CommentType.Error)
            {
                mark = "错误";
                itemType = ItemType.Error;
            }

            string message = String.Format("{0} [{1}] {2}", DateTime.Now.ToString(), mark, comment);
            SListBoxItem item = new SListBoxItem(message, itemType);

            //添加滚动效果,在添加记录前,先计算滚动条是否在底部,从而决定添加后是否自动滚动
            bool scoll = false;
            if (logsBox.TopIndex == logsBox.Items.Count - (int)(logsBox.Height / logsBox.ItemHeight))
                scoll = true;
            //添加记录
            logsBox.Items.Add(item);
            //滚动到底部
            if (scoll)
                logsBox.TopIndex = logsBox.Items.Count - (int)(logsBox.Height / logsBox.ItemHeight);
        }
开发者ID:390493386,项目名称:SAPIServer,代码行数:34,代码来源:SAPIServer.cs


示例3: StartComment

		// used for comment tracking
		public void StartComment(CommentType commentType, bool commentStartsLine, Location startPosition)
		{
			this.currentCommentType = commentType;
			this.startPosition      = startPosition;
			this.sb.Length          = 0;
			this.commentStartsLine  = commentStartsLine;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:8,代码来源:SpecialTracker.cs


示例4: GetLastestCommentsForSomeone

        public override CommentCollection GetLastestCommentsForSomeone(int targetUserID, CommentType type, int top)
        {
            using (SqlQuery query = new SqlQuery())
            {
                string getTargetNameSql = null;

                switch (type)
                {
                    case CommentType.Blog:
                        getTargetNameSql = "(SELECT [Subject] FROM [bx_BlogArticles] WHERE [ArticleID]=TargetID) AS [TargetName] ";
                        break;

                    case CommentType.Photo:
                        getTargetNameSql = "(SELECT [Name] FROM [bx_Photos] WHERE [PhotoID]=TargetID) AS [TargetName] ";
                        break;

                    default:
                        getTargetNameSql = string.Empty;
                        break;
                }

                query.CommandText = "SELECT TOP (@TopCount) *, " + getTargetNameSql + " FROM bx_Comments WHERE [TargetUserID][email protected] AND [Type][email protected] ORDER BY [CommentID] DESC";
                query.CommandType = CommandType.Text;

                query.CreateParameter<int>("@TargetUserID", targetUserID, SqlDbType.Int);
                query.CreateParameter<CommentType>("@Type", type, SqlDbType.TinyInt);

                query.CreateTopParameter("@TopCount", top);

                using (XSqlDataReader reader = query.ExecuteReader())
                {
                    return new CommentCollection(reader);
                }
            }
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:35,代码来源:CommentDao.cs


示例5: Comment

		public Comment(CommentType commentType, string comment, bool commentStartsLine, Location startPosition, Location endPosition)
			: base(startPosition, endPosition)
		{
			this.CommentType   = commentType;
			this.CommentText       = comment;
			CommentStartsLine = commentStartsLine;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:7,代码来源:Comment.cs


示例6: GetObjectID

    private int GetObjectID(CommentType type, string WebID)
    {
        if (type == CommentType.Wall)
        {
            Member m = Member.GetMemberViaWebMemberID(WebID);
            return m.MemberID;
        }
        else if (type == CommentType.Video)
        {
            Video v = Video.GetVideoByWebVideoIDWithJoin(WebID);
            return v.VideoID;
        }
        else if (type == CommentType.AskAFriend)
        {
            AskAFriend aaf = AskAFriend.GetAskAFriendByWebAskAFriendID(WebID);
            return aaf.AskAFriendID;
        }
        else if (type == CommentType.Blog)
        {
            BlogEntry blog = BlogEntry.GetBlogEntryByWebBlogEntryID(WebID);
            return blog.BlogEntryID;
        }
        else if (type == CommentType.Photo)
        {
            Photo photo = Photo.GetPhotoByWebPhotoIDWithJoin(WebID);
            return photo.PhotoID;
        }
        else if (type == CommentType.PhotoGallery)
        {
            PhotoCollection photoColl = PhotoCollection.GetPhotoCollectionByWebPhotoCollectionID(WebID);
            return photoColl.PhotoCollectionID;
        }

        return -1;
    }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:35,代码来源:ForwardToFriend.ascx.cs


示例7: GetComments

		public async Task<List<Comment>> GetComments(string id, CommentType commentType)
		{
			var uri = "/" + id + "?commentType=" + commentType;
			List<Comment> comments = new List<Comment>();
			var recievedContent = "";
			try
			{
				var response = await httpClient.GetAsync(new Uri(App.serverUri + "message/comment" + uri));
				if (response.IsSuccessStatusCode) { 
					recievedContent = await response.Content.ReadAsStringAsync(); 
					comments = JsonConvert.DeserializeObject<List<Comment>>(recievedContent);
				}
				else
				{
					await App.coreView.displayAlertMessage("Connection Error", "Trouble Connecting To Server", "OK");
				}

			}
			catch (Exception ex)
			{
				System.Diagnostics.Debug.WriteLine(@"				ERROR {0}", ex.Message);
				Comment comm = JsonConvert.DeserializeObject<Comment>(recievedContent);
				comments.Add(comm);
			}
			return comments;
		}
开发者ID:todibbang,项目名称:HowlOutApp,代码行数:26,代码来源:MessageApiManager.cs


示例8: Comment

 public Comment(Nemerle.Compiler.Comment comment, CommentType type, int textPosition)
 {
     Position = comment.Position;
       Length = comment.Length;
       IsDocument = comment.IsDocument;
       IsMultiline = comment.IsMultiline;
       Type = type;
       TextPosition = textPosition;
 }
开发者ID:vestild,项目名称:nemerle,代码行数:9,代码来源:Comment.cs


示例9: Comment

 /// <summary>
 /// 显示Comment
 /// </summary>
 /// <param name="type"></param>
 /// <param name="message"></param>
 /// <param name="arg"></param>
 public static void Comment(CommentType type, string message, params object[] arg)
 {
     if (LogEvent != null)
     {
         if (arg.Length == 0)
             LogEvent(type, message);
         else
             LogEvent(type, String.Format(message, arg));
     }
 }
开发者ID:390493386,项目名称:SAPIServer,代码行数:16,代码来源:Log.cs


示例10: CrawlerComment

 /// <summary>
 /// Creates a new comment instance from an XML element.
 /// </summary>
 /// <param name="xml">The XML element.</param>
 public CrawlerComment(XElement xml)
 {
     this.type = (CommentType)int.Parse(xml.Attribute("type").Value, CultureInfo.InvariantCulture);
     this.guid = Guid.Parse(xml.Attribute("guid").Value);
     this.time = DateTime.Parse(xml.Attribute("time").Value, CultureInfo.InvariantCulture);
     this.user = xml.Attribute("user").Value;
     this.item = xml.Attribute("item").Value;
     this.text = xml.Value;
     this.xml = xml;
 }
开发者ID:alexbikfalvi,项目名称:InetAnalytics,代码行数:14,代码来源:CrawlerComment.cs


示例11: GetCommentHeight

        /// <summary>
        /// Returns the height of the given comment.
        /// </summary>
        public static int GetCommentHeight(string comment, CommentType commentType)
        {
            int minHeight = 38;
            if (commentType == CommentType.None) minHeight = 17;

            GUIStyle style = "HelpBox";
            return Math.Max(
                (int)style.CalcHeight(new GUIContent(comment), Screen.width),
                minHeight);
        }
开发者ID:JoeYarnall,项目名称:something-new,代码行数:13,代码来源:fiCommentUtility.cs


示例12: Comment

        /// <summary>
        /// Initializes a new instance of the Comment class.
        /// </summary>
        /// <param name="document">The parent document.</param>
        /// <param name="text">The line text.</param>
        /// <param name="commentType">The type of the comment.</param>
        internal Comment(CsDocument document, string text, CommentType commentType)
            : base(document, (int)commentType)
        {
            Param.AssertNotNull(document, "document");
            Param.AssertNotNull(text, "text");
            Param.Ignore(commentType);

            this.Text = text;
            CsLanguageService.Debug.Assert(System.Enum.IsDefined(typeof(CommentType), this.CommentType), "The type is invalid.");
        }
开发者ID:jonthegiant,项目名称:StyleCop,代码行数:16,代码来源:Comment.cs


示例13: GetResourseType

 public static int GetResourseType(CommentType type)
 {
     switch (type)
     {
         case CommentType.AlbumComment:
             return 1;
         case CommentType.PhotoComment:
         default:
             return 2;
     }
 }
开发者ID:AntonPashkowskiy,项目名称:PhotoAlbums,代码行数:11,代码来源:CommentTypeMapper.cs


示例14: Comment

 public Comment(String memberID, String commentToID, String content,CommentType type)
 {
     this.MemberID = memberID;
     this.Creater = new BiZ.Creater.Creater(memberID);
     this.CommentToID = commentToID;
     this.Content = content;
     this.CreatedTime = DateTime.Now;
     this.UpdateTime = DateTime.Now;
     this.CommentType = type;
     this.DeleteFlag = Comm.DeletedFlag.No;
 }
开发者ID:dkme,项目名称:moooyo,代码行数:11,代码来源:Comment.cs


示例15: RequestShortComments

        private async Task RequestShortComments()
        {
            if (_currCommentType == CommentType.Long)
            {
                _currCommentType = CommentType.Short;
            }
            var shortComment = await DataRequester.RequestShortComment(CurrentStoryId, _currCommentType == CommentType.Long ? null : LastCommentId);
            if (shortComment == null)
                return;

            CommentList.Last().AddRange(shortComment.comments);
        }
开发者ID:Autumn05,项目名称:UWP_ZhiHuRiBao,代码行数:12,代码来源:CommentViewModel.cs


示例16: GetCloserOfPositionOfComment

 public static Int32 GetCloserOfPositionOfComment(String Code, Int32 SearchOffset, CommentType Type)
 {
     switch (Type)
     {
         case CommentType.SingleLine:
             return Code.IndexOf(CloserOfSingleLineComment, SearchOffset);
         case CommentType.MultiLine:
             return Code.IndexOf(CloserOfMultiLineComment, SearchOffset);
         default:
             return IndexNotFound;
     }
 }
开发者ID:SakovichPavel1,项目名称:metrix,代码行数:12,代码来源:CodeForAnaliz.cs


示例17: FormatComments

        protected XElement FormatComments(Step step, CommentType type)
        {
            XElement comment = new XElement(this.xmlns + "span", new XAttribute("class", "comment"));

            foreach (var stepComment in step.Comments.Where(o => o.Type == type))
            {
                comment.Add(stepComment.Text.Trim());
                comment.Add(new XElement(this.xmlns + "br"));
            }
            comment.LastNode.Remove();

            return comment;
        }
开发者ID:ngm,项目名称:pickles,代码行数:13,代码来源:HtmlStepFormatter.cs


示例18: GetComments

        /// <summary>
        /// Comments list
        /// </summary>
        /// <param name="commentType">Comment type</param>
        /// <param name="take">Items to take</param>
        /// <param name="skip">Items to skip</param>
        /// <param name="filter">Filter expression</param>
        /// <param name="order">Sort order</param>
        /// <returns>List of comments</returns>
        public IEnumerable<CommentItem> GetComments(CommentType commentType = CommentType.All, int take = 10, int skip = 0, string filter = "", string order = "")
        {
            if (!Security.IsAuthorizedTo(BlogEngine.Core.Rights.ViewPublicComments))
                throw new System.UnauthorizedAccessException();

            if (string.IsNullOrEmpty(filter)) filter = "1==1";
            if (string.IsNullOrEmpty(order)) order = "DateCreated desc";

            var items = new List<Comment>();
            var query = items.AsQueryable().Where(filter);
            var comments = new List<CommentItem>();

            var all = Security.IsAuthorizedTo(BlogEngine.Core.Rights.EditOtherUsersPosts);

            foreach (var p in Post.Posts)
            {
                if (all || p.Author.ToLower() == Security.CurrentUser.Identity.Name.ToLower())
                {
                    switch (commentType)
                    {
                        case CommentType.Pending:
                            items.AddRange(p.NotApprovedComments);
                            break;
                        case CommentType.Pingback:
                            items.AddRange(p.Pingbacks);
                            break;
                        case CommentType.Spam:
                            items.AddRange(p.SpamComments);
                            break;
                        case CommentType.Approved:
                            items.AddRange(p.ApprovedComments);
                            break;
                        default:
                            items.AddRange(p.Comments);
                            break;
                    }
                }
            }

            // if take passed in as 0, return all
            if (take == 0) take = items.Count;        

            var itemList = query.OrderBy(order).Skip(skip).Take(take).ToList();

            foreach (var item in itemList)
            {
                comments.Add(CreateJsonCommentFromComment(item, itemList));               
            }

            return comments;
        }
开发者ID:ildragocom,项目名称:BlogEngine.NET,代码行数:60,代码来源:CommentsRepository.cs


示例19: CheckPossibilityOfChangingComment

        public bool CheckPossibilityOfChangingComment(string userId, int commentId, CommentType type)
        {
            switch (type)
            {
                case CommentType.AlbumComment:
                    var albumComment = _unitOfWork.AlbumComments.Get(commentId);
                    return albumComment != null && albumComment.TargetAlbum.UserId == userId;

                case CommentType.PhotoComment:
                default:
                    var photoComment = _unitOfWork.PhotoComments.Get(commentId);
                    return photoComment != null && photoComment.TargetPhoto.AuthorId == userId;
            }
        }
开发者ID:AntonPashkowskiy,项目名称:PhotoAlbums,代码行数:14,代码来源:DataService.cs


示例20: PostComment

        public HttpResponseMessage PostComment(CommentType c)
        {
            Log.InfoFormat("POST api/comments/{0}/    EventId={1}  Content={2}", c.id, c.id, c.content);
            var comment = c.content;

            var userId = User.Identity.GetUserName().ToLong(); // Pulling this from the IPrincipal.  It is actually the user id
            var profile = _profilesService.GetProfile(userId);

            var ev = _eventService.GetEvent(c.id);

            _eventService.AddShoutoutToEvent(profile, ev, c.content);
            Log.InfoFormat("Posted comment to event.   EventId={0} ", c.id);

            return Request.CreateResponse(HttpStatusCode.OK);
        }
开发者ID:ryanerdmann,项目名称:angora,代码行数:15,代码来源:EventsController.cs



注:本文中的CommentType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Comments类代码示例发布时间:2022-05-24
下一篇:
C# Comment类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap