Пример #1
0
        public void OpenApp(PackageInfoViewModel package)
        {
            uint res = PackageActivator.StartApp(package.PackageInfo.PFN);

            DiagnosticsClient.TrackEvent("OpenApp",
                                         new Dictionary <string, string> {
                { "AppToOpen", package.PackageInfo.PFN }, { "opened", (res > 0).ToString() }
            },
                                         null);
        }
Пример #2
0
        public void CopyToClipboard(PackageInfoViewModel package)
        {
            StringBuilder ClipboardText = new StringBuilder();

            ClipboardText.Append(package.PackageInfo.Id + Environment.NewLine);
            ClipboardText.Append(package.PackageInfo.Version + Environment.NewLine);
            ClipboardText.Append(package.PackageInfo.Architecture + Environment.NewLine);
            ClipboardText.Append(package.PackageInfo.Author + Environment.NewLine);
            ClipboardText.Append(package.PackageInfo.InstalledDate + Environment.NewLine);
            ClipboardText.Append(package.PackageInfo.InstallLocation + Environment.NewLine);

            Clipboard.SetText(ClipboardText.ToString());
        }
Пример #3
0
        public void CopyToClipboard(PackageInfoViewModel package)
        {
            StringBuilder ClipboardText = new StringBuilder();

            ClipboardText.AppendLine(package.PackageInfo.Id);
            ClipboardText.AppendLine(package.PackageInfo.Version);
            ClipboardText.AppendLine(package.PackageInfo.Architecture);
            ClipboardText.AppendLine(package.PackageInfo.Author);
            ClipboardText.AppendLine(package.PackageInfo.InstalledDate.ToString());
            ClipboardText.AppendLine(package.PackageInfo.InstallLocation);
            ClipboardText.AppendLine(package.PackageInfo.PackageFullName);
            ClipboardText.AppendLine(package.PackageInfo.PackageName);

            Clipboard.SetText(ClipboardText.ToString());
        }
Пример #4
0
        public void OpenFolder(PackageInfoViewModel package)
        {
            ProcessStartInfo psi = new ProcessStartInfo()
            {
                UseShellExecute = true,
                FileName        = package.PackageInfo.InstallLocation
            };

            Process.Start(psi);
            DiagnosticsClient.TrackEvent("OpenFolder",
                                         new Dictionary <string, string> {
                { "FolderToOpen", package.PackageInfo.InstallLocation }
            },
                                         null);
        }
Пример #5
0
        public void ViewManifest(PackageInfoViewModel package)
        {
            var manifestPath     = Path.Combine(package.PackageInfo.InstallLocation, "AppxManifest.xml");
            Uri manifestUri      = new Uri(manifestPath, UriKind.Absolute);
            ProcessStartInfo psi = new ProcessStartInfo()
            {
                UseShellExecute = true,
                FileName        = manifestUri.AbsoluteUri
            };

            Process.Start(psi);
            DiagnosticsClient.TrackEvent("ViewManifest",
                                         new Dictionary <string, string> {
                { "ManifestToOpen", manifestPath }
            },
                                         null);
        }
Пример #6
0
        private void NavigateToInstallLocation(PackageInfoViewModel p)
        {
            Uri    appInstallerUri = new Uri(PackageInfo.AppInstallerUri);
            string folderUri       = $"{appInstallerUri.Scheme}://{appInstallerUri.DnsSafeHost}";

            for (int i = 0; i < appInstallerUri.Segments.Length - 1; i++)
            {
                folderUri += appInstallerUri.Segments[i];
            }
            ProcessStartInfo psi = new ProcessStartInfo()
            {
                UseShellExecute = true,
                FileName        = folderUri
            };

            Process.Start(psi);
        }