internal static ITask GetTask(ITaskScheduler iSvc, string name) { var riid = Marshal.GenerateGuidForType(typeof(ITask)); try { return(iSvc.Activate(name, ref riid)); } catch { } return(null); }
/// <summary> /// Opens the task with the given <paramref name="name" />. An open task holds COM interfaces /// which are released by the Task's Close() method. /// </summary> /// <remarks>If the task does not exist, null is returned.</remarks> /// <param name="name">Name of task to open.</param> /// <returns>An instance of a Task, or null if the task name couldn'task be found.</returns> public Task OpenTask(string name) { try { object o; its.Activate(name, ref ITaskGuid, out o); ITask iTask = (ITask)o; return(new Task(iTask, name)); } catch { return(null); } }
internal static ITask GetTask(ITaskScheduler iSvc, string name) { var ITaskGuid = Marshal.GenerateGuidForType(typeof (ITask)); try { return iSvc.Activate(name, ref ITaskGuid); } catch { } return null; }