本文整理汇总了C#中MonoDevelop.Ide.Tasks.Task类的典型用法代码示例。如果您正苦于以下问题:C# Task类的具体用法?C# Task怎么用?C# Task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Task类属于MonoDevelop.Ide.Tasks命名空间,在下文中一共展示了Task类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddTask
public static void AddTask(string fileName, string message, int column, int line, TaskSeverity taskType)
{
// HACK: Use a compiler error since we cannot add an error
// task otherwise (task type property is read-only and
// no constructors usable).
BuildError error = new BuildError ();
error.Column = column;
error.Line = line;
error.ErrorText = message;
error.FileName = fileName;
error.IsWarning = false;
//Task task = new Task(fileName, message, column, line);
Task task = new Task (error);
TaskService.Errors.Add(task);
}
开发者ID:segaman,项目名称:monodevelop,代码行数:16,代码来源:XmlEditorService.cs
示例2: MessageBubbleTextMarker
public MessageBubbleTextMarker (TextEditor editor, Task task, LineSegment lineSegment, bool isError, string errorMessage)
{
this.editor = editor;
this.task = task;
this.IsVisible = true;
this.lineSegment = lineSegment;
this.initialText = editor.Document.GetTextAt (lineSegment);
this.Flags = TextMarkerFlags.DrawsSelection;
AddError (isError, errorMessage);
editor.EditorOptionsChanged += HandleEditorEditorOptionsChanged;
errorPixbuf = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
warningPixbuf = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:13,代码来源:MessageBubbleTextMarker.cs
示例3: FindTask
static TreeIter FindTask (ListStore store, Task task)
{
TreeIter iter;
if (!store.GetIterFirst (out iter))
return TreeIter.Zero;
do {
Task t = store.GetValue (iter, (int)Columns.Task) as Task;
if (t == task)
return iter;
}
while (store.IterNext (ref iter));
return TreeIter.Zero;
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:15,代码来源:CommentTasksView.cs
示例4: RemoveGeneratedTask
void RemoveGeneratedTask (Task t)
{
TreeIter iter = FindTask (store, t);
if (!iter.Equals (TreeIter.Zero))
store.Remove (ref iter);
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:6,代码来源:CommentTasksView.cs
示例5: NewUserTaskClicked
void NewUserTaskClicked (object obj, EventArgs e)
{
Task task = new Task ();
task.WorkspaceObject = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem;
updating = true;
TaskService.UserTasks.Add (task);
updating = false;
TreeIter iter = store.AppendValues (GettextCatalog.GetString (Enum.GetName (typeof (TaskPriority), task.Priority)), task.Completed, task.Description, task, GetColorByPriority (task.Priority), task.Completed ? (int)Pango.Weight.Light : (int)Pango.Weight.Bold);
view.Selection.SelectIter (iter);
TreePath path = store.GetPath (iter);
view.ScrollToCell (path, view.Columns[(int)Columns.Description], true, 0, 0);
view.SetCursorOnCell (path, view.Columns[(int)Columns.Description], cellRendDesc, true);
TaskService.SaveUserTasks (task.WorkspaceObject);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:14,代码来源:UserTasksView.cs
示例6: AddError
public void AddError (Task task, bool isError, string errorMessage)
{
var match = mcsErrorFormat.Match (errorMessage);
if (match.Success)
errorMessage = match.Groups [1].Value;
errors.Add (new ErrorText (task, isError, errorMessage));
DisposeLayout ();
}
开发者ID:llucenic,项目名称:monodevelop,代码行数:8,代码来源:MessageBubbleTextMarker.cs
示例7: AddTaskInternal
void AddTaskInternal (Task t)
{
if (tasks.Contains (t)) return;
Gdk.Pixbuf stock;
switch (t.Severity) {
case TaskSeverity.Error:
stock = iconError;
errorCount++;
UpdateErrorsNum ();
break;
case TaskSeverity.Warning:
stock = iconWarning;
warningCount++;
UpdateWarningsNum ();
break;
default:
stock = iconInfo;
infoCount++;
UpdateMessagesNum ();
break;
}
tasks [t] = t;
store.AppendValues (stock, false, t);
}
开发者ID:segaman,项目名称:monodevelop,代码行数:28,代码来源:ErrorListPad.cs
示例8: SetText
static void SetText (CellRendererText textRenderer, TreeModel model, TreeIter iter, Task task, string text)
{
textRenderer.Text = text;
textRenderer.Weight = (int)((bool)model.GetValue (iter, DataColumns.Read) ? Pango.Weight.Normal : Pango.Weight.Bold);
textRenderer.Strikethrough = task.Completed;
}
开发者ID:segaman,项目名称:monodevelop,代码行数:6,代码来源:ErrorListPad.cs
示例9: MessageBubbleTextMarker
internal MessageBubbleTextMarker (MessageBubbleCache cache, Task task, LineSegment lineSegment, bool isError, string errorMessage)
{
this.cache = cache;
this.task = task;
this.IsVisible = true;
this.lineSegment = lineSegment;
this.initialText = editor.Document.GetTextAt (lineSegment);
this.Flags = TextMarkerFlags.DrawsSelection;
AddError (isError, errorMessage);
// cache.Changed += (sender, e) => CalculateLineFit (editor, lineSegment);
}
开发者ID:nieve,项目名称:monodevelop,代码行数:11,代码来源:MessageBubbleTextMarker.cs
示例10: ErrorText
public ErrorText (Task task, bool isError, string errorMessage)
{
this.Task = task;
this.IsError = isError;
this.ErrorMessage = errorMessage;
}
开发者ID:harishamdani,项目名称:monodevelop,代码行数:6,代码来源:MessageBubbleTextMarker.cs
示例11: SignPackageDone
void SignPackageDone (IProgressMonitor monitor, BuildResult result)
{
monitor.EndTask ();
if (result != null && result.Errors.Count > 0) {
var tasks = new Task [result.Errors.Count];
for (int n = 0; n < tasks.Length; n++) {
tasks [n] = new Task (result.Errors [n], this);
}
TaskService.Errors.AddRange (tasks);
TaskService.ShowErrors ();
}
monitor.Dispose ();
}
开发者ID:stewartwhaley,项目名称:monodevelop,代码行数:15,代码来源:MonoDroidProject.cs
示例12: StyleCopCoreViolationEncountered
/// <summary>
/// Called when a violation is found.
/// </summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event arguments.</param>
internal static void StyleCopCoreViolationEncountered(object sender, ViolationEventArgs e)
{
Param.Ignore(sender, e);
// Check the violation count. At some point we don't allow any more violations so we cancel the analyze run.
if (e.SourceCode.Project.MaxViolationCount > 0 && styleCopAnalysisResultList.Count == e.SourceCode.Project.MaxViolationCount)
{
IdeApp.ProjectOperations.CancelStyleCopAnalysis();
}
string trimmedNamespace = e.Violation.Rule.Namespace;
string searchValue = global::StyleCop.Constants.ProductName + ".";
int indexOfProductName = trimmedNamespace.IndexOf(searchValue, StringComparison.Ordinal);
if (indexOfProductName != -1 && indexOfProductName < trimmedNamespace.Length - 1)
{
trimmedNamespace = trimmedNamespace.Substring(indexOfProductName + searchValue.Length);
int indexOfRulesString = trimmedNamespace.LastIndexOf("Rules", StringComparison.Ordinal);
trimmedNamespace = indexOfRulesString != -1 ? trimmedNamespace.Substring(0, indexOfRulesString) : trimmedNamespace;
}
else
{
trimmedNamespace = string.Empty;
}
string fileName = string.Empty;
if (e.Element != null)
{
fileName = e.Element.Document.SourceCode.Path;
}
else
{
if (e.SourceCode != null)
{
fileName = e.SourceCode.Path;
}
}
TaskSeverity severity = TaskSeverity.Error;
if (e.Warning || !e.SourceCode.Project.ViolationsAsErrors)
{
severity = TaskSeverity.Warning;
}
Task styleCopWarning = new Task(
fileName,
string.Concat(e.Violation.Rule.CheckId, " : ", trimmedNamespace, " : ", e.Message),
e.Location != null ? e.Location.Value.StartPoint.IndexOnLine : 1,
e.LineNumber,
severity,
TaskPriority.Normal,
ProjectUtilities.Instance.CachedProjects.GetProjectForFile(fileName),
ProjectOperationsExtensions.ownerObject);
styleCopAnalysisResultList.Add(styleCopWarning);
}
开发者ID:DarkCloud14,项目名称:MonoDevelop.StyleCop,代码行数:62,代码来源:ProjectOperationsExtensionsPreXS6.cs
示例13: AddTaskInternal
void AddTaskInternal (Task t)
{
if (tasks.Contains (t)) return;
Xwt.Drawing.Image stock;
switch (t.Severity) {
case TaskSeverity.Error:
stock = iconError;
errorCount++;
UpdateErrorsNum ();
break;
case TaskSeverity.Warning:
stock = iconWarning;
warningCount++;
UpdateWarningsNum ();
break;
default:
stock = iconInfo;
infoCount++;
UpdateMessagesNum ();
break;
}
tasks [t] = t;
var indexOfNewLine = t.Description.IndexOfAny (new [] { '\n', '\r' });
if (indexOfNewLine != -1) {
var iter = store.AppendValues (stock, false, t, t.Description.Remove (indexOfNewLine));
store.AppendValues (iter, iconEmpty, false, null, t.Description);
} else {
store.AppendValues (stock, false, t, t.Description);
}
UpdatePadIcon ();
}
开发者ID:lkalif,项目名称:monodevelop,代码行数:36,代码来源:ErrorListPad.cs
示例14: OnViolationEncountered
/// <summary>
/// Reports violations encountered by stylecop to the error pad
/// </summary>
/// <param name="sender">
/// A <see cref="System.Object"/> determining which object sends this violation
/// </param>
/// <param name="args">
/// A <see cref="ViolationEventArgs"/> determining elements composing the violation
/// </param>
private void OnViolationEncountered(object sender, ViolationEventArgs args)
{
try
{
MonoDevelop.Projects.BuildError b = new MonoDevelop.Projects.BuildError(args.Element.Document.SourceCode.Path, args.LineNumber, 0, args.Violation.Rule.CheckId, args.Message);
b.IsWarning = args.Warning;
Task errorTask = new Task(b, RunStyleCopHandler.styleCopAddinOwner);
this.errorPad.AddTask(errorTask);
}
catch (Exception e)
{
this.logger.WriteLine("Error: {0}\nStackTrace:{1}", e.Message, e.StackTrace);
}
}
开发者ID:franckleveque,项目名称:Stylecop-Monodevelop-Addin,代码行数:24,代码来源:RunStyleCopHandler.cs
示例15: GetPath
static string GetPath (Task task)
{
if (task.WorkspaceObject != null)
return FileService.AbsoluteToRelativePath (task.WorkspaceObject.BaseDirectory, task.FileName);
return task.FileName;
}
开发者ID:segaman,项目名称:monodevelop,代码行数:7,代码来源:ErrorListPad.cs
示例16: ShowStatus
/// <summary>
/// Shows a description of the task in the status bar
/// </summary>
public static void ShowStatus (Task t)
{
if (t == null)
IdeApp.Workbench.StatusBar.ShowMessage (GettextCatalog.GetString ("No more errors or warnings"));
else if (t.Severity == TaskSeverity.Error)
IdeApp.Workbench.StatusBar.ShowError (t.Description);
else if (t.Severity == TaskSeverity.Warning)
IdeApp.Workbench.StatusBar.ShowWarning (t.Description);
else
IdeApp.Workbench.StatusBar.ShowMessage (t.Description);
}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:14,代码来源:TaskService.cs
示例17: GetProject
static string GetProject (Task task)
{
return (task != null && task.WorkspaceObject is SolutionItem)? task.WorkspaceObject.Name: string.Empty;
}
开发者ID:segaman,项目名称:monodevelop,代码行数:4,代码来源:ErrorListPad.cs
示例18: InformJumpToTask
internal static void InformJumpToTask (Task task)
{
EventHandler<TaskEventArgs> handler = JumpedToTask;
if (handler != null)
handler (null, new TaskEventArgs (task));
}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:6,代码来源:TaskService.cs
示例19: AddTask
public void AddTask (Task t)
{
AddTaskInternal (t);
filter.Refilter ();
}
开发者ID:segaman,项目名称:monodevelop,代码行数:5,代码来源:ErrorListPad.cs
示例20: UpdateCommentTags
void UpdateCommentTags (Solution wob, FilePath fileName, IEnumerable<Tag> tagComments)
{
if (fileName == FilePath.Null)
return;
fileName = fileName.FullPath;
List<Task> newTasks = new List<Task> ();
if (tagComments != null) {
foreach (Tag tag in tagComments) {
if (!priorities.ContainsKey (tag.Key))
continue;
//prepend the tag if it's not already there
string desc = tag.Text.Trim ();
if (!desc.StartsWith (tag.Key)) {
if (desc.StartsWith (":"))
desc = tag.Key + desc;
else if (tag.Key.EndsWith (":"))
desc = tag.Key + " " + desc;
else
desc = tag.Key + ": " + desc;
}
Task t = new Task (fileName, desc, tag.Region.Start.Column, tag.Region.Start.Line,
TaskSeverity.Information, priorities[tag.Key], wob);
newTasks.Add (t);
}
}
List<Task> oldTasks = new List<Task> (comments.GetFileTasks (fileName));
for (int i = 0; i < newTasks.Count; ++i) {
for (int j = 0; j < oldTasks.Count; ++j) {
if (oldTasks[j] != null &&
newTasks[i].Line == oldTasks[j].Line &&
newTasks[i].Column == oldTasks[j].Column &&
newTasks[i].Description == oldTasks[j].Description &&
newTasks[i].Priority == oldTasks[j].Priority)
{
newTasks.RemoveAt (i);
oldTasks.RemoveAt (j);
i--;
break;
}
}
}
comments.BeginTaskUpdates ();
try {
comments.AddRange (newTasks);
comments.RemoveRange (oldTasks);
} finally {
comments.EndTaskUpdates ();
}
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:56,代码来源:CommentTasksView.cs
注:本文中的MonoDevelop.Ide.Tasks.Task类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论