コード例 #1
0
ファイル: Task.cs プロジェクト: hesam/SketchSharp
    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);
      }
    }
コード例 #2
0
ファイル: Tool.cs プロジェクト: hesam/SketchSharp
 public void Release()
 {
   if (taskManager != null) {
     taskManager.Release();
     taskManager = null;
     hosts.Clear();
   }
 }
コード例 #3
0
ファイル: Package.cs プロジェクト: dbremner/specsharp
 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;
 }
コード例 #4
0
ファイル: Task.cs プロジェクト: hesam/SketchSharp
 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;
   }
 }