private void BtnRunPressed(object sender, RoutedEventArgs e) { selectedFilePaths.Clear(); ParseSelectedItems(nodes); Insert_CommentPackage package = Insert_Comment_Command.Instance.package as Insert_CommentPackage; if (package == null) { return; } switch (package.selectedLicenseType) { case LicenseType.Individual: { WriteComment(Constants.individualComment); break; } case LicenseType.OpenSource: { WriteComment(Constants.openSourceComment); break; } case LicenseType.Student: { WriteComment(Constants.studentComment); break; } } }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void Execute(object sender, EventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); Insert_CommentPackage package = this.package as Insert_CommentPackage; if (package == null) { return; } switch (package.selectedLicenseType) { case LicenseType.Individual: { WriteComment(Constants.individualComment); break; } case LicenseType.OpenSource: { WriteComment(Constants.openSourceComment); break; } case LicenseType.Student: { WriteComment(Constants.studentComment); break; } } }