internal GeneralViewNode(TaskHost taskHost, IDtsConnectionService connectionService) { // Extract common values from the Task Host name = taskHost.Name; description = taskHost.Description; // Extract values from the task object HelloWorldTask task = taskHost.InnerObject as HelloWorldTask; if (task == null) { string msg = string.Format(CultureInfo.CurrentCulture, "Type mismatch for taskHost inner object. Received: {0} Expected: {1}", taskHost.InnerObject.GetType().Name, typeof(HelloWorldTask).Name); throw new ArgumentException(msg); } displayText = task.DisplayText; }
public void OnCommit(object taskHost) { TaskHost host = taskHost as TaskHost; if (host == null) { throw new ArgumentException("Argument is not a TaskHost.", "taskHost"); } HelloWorldTask task = host.InnerObject as HelloWorldTask; if (task == null) { throw new ArgumentException("Argument is not a HelloWorldTask.", "taskHost"); } host.Name = generalNode.Name; host.Description = generalNode.Description; // Task properties task.DisplayText = generalNode.DisplayText; }