Exemple #1
0
        private void SolutionInstallButtonClicked(object sender, EventArgs e)
        {
            var model = (PackageSolutionDetailControlModel)DataContext;

            if (model != null && model.SelectedVersion != null)
            {
                var userAction = UserAction.CreateInstallAction(
                    model.Id,
                    model.SelectedVersion.Version,
                    Control.Model.IsSolution,
                    UIUtility.ToContractsItemFilter(Control._topPanel.Filter));

                ExecuteUserAction(userAction, NuGetActionType.Install);
            }
        }
Exemple #2
0
        /// <summary>
        /// Handles Hyperlink controls inside this DetailControl class associated with
        /// <see cref="PackageManagerControlCommands.OpenExternalLink" />
        /// </summary>
        /// <param name="sender">A Hyperlink control</param>
        /// <param name="e">Command arguments</param>
        private void ExecuteOpenExternalLink(object sender, ExecutedRoutedEventArgs e)
        {
            var hyperlink = e.OriginalSource as Hyperlink;

            if (hyperlink != null && hyperlink.NavigateUri != null)
            {
                Control.Model.UIController.LaunchExternalLink(hyperlink.NavigateUri);
                e.Handled = true;

                if (e.Parameter is not null and HyperlinkType hyperlinkType)
                {
                    var evt = new HyperlinkClickedTelemetryEvent(hyperlinkType, UIUtility.ToContractsItemFilter(Control.ActiveFilter), Control.Model.IsSolution);
                    TelemetryActivity.EmitTelemetryEvent(evt);
                }
            }
        }