本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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;
}
示例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);
}
示例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.");
}
示例13: GetResourseType
public static int GetResourseType(CommentType type)
{
switch (type)
{
case CommentType.AlbumComment:
return 1;
case CommentType.PhotoComment:
default:
return 2;
}
}
示例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;
}
示例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);
}