当前位置: 首页>>代码示例>>C#>>正文


C# CommentType类代码示例

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


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


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