public Task( TaskManager taskManager , string description, string tipText, string code, string helpKeyword , TaskPriority priority, TaskCategory category, TaskMarker markerType , Location loc , ITaskCommands commands ) { this.taskManager = taskManager; this.code = code; this.description = description; this.tipText = ((tipText == null || tipText.Length == 0) ? description : tipText); this.helpKeyword = helpKeyword; this.priority = priority; this.category = category; this.markerType = markerType; this.commands = commands; this.location = (loc == null ? new Location(null, null) : loc); this.initLoc = this.location.Clone(); this.persistLoc = this.location.Clone(); // isChecked = false; // isDeleted = false; // marker = null; // Create markers if the document is already opened. IVsTextLines textLines = this.location.GetTextLines(false); if (textLines != null) { OnOpenFile(textLines); } }
public void Release() { if (taskManager != null) { taskManager.Release(); taskManager = null; hosts.Clear(); } }
public ITaskManager QuerySharedTaskManager(string providerName, bool createIfAbsent) { foreach (TaskManager taskManager in sharedTaskManagers) { string name; taskManager.GetProviderName(out name); if (name == providerName) { Interlocked.Increment(ref taskManager.sharedCount); return taskManager; } } if (createIfAbsent) { TaskManager taskManager = new TaskManager(providerName); Interlocked.Increment(ref taskManager.sharedCount); sharedTaskManagers.Add(taskManager); return taskManager; } else return null; }
public void Release() { // Called from "OnDelete" // task list makes sure it doesn't show up // and we remove it later when an enumeration is asked. isDeleted = true; if (marker != null) { marker.Invalidate(); marker = null; } if (commands != null) { commands.Dispose(); commands = null; } userContext = null; taskManager = null; if (location != null) { location.Dispose(); location = null; } if (persistLoc != null) { persistLoc.Dispose(); persistLoc = null; } if (initLoc != null) { initLoc.Dispose(); initLoc = null; } }