コード例 #1
0
        private Release[] Search(VsIdeServiceClient client, Guid id)
        {
            var whereClause    = string.Format("(Project.Metadata['SupportedVSEditions'] LIKE '%15.0.26430.16,Pro;%')", id);
            var orderClause    = "Project.Metadata['Ranking'] desc";
            var requestContext = new Dictionary <string, string>()
            {
                { "LCID", "1033" },
                { "SearchSource", "ExtensionManagerQuery" },
                { "OSVersion", "10.0.15063.0" }
            };

            var result = client.SearchReleases2("ErikEJ.SQLServerCompactSQLiteToolbox", whereClause, orderClause, 0, 1, requestContext);

            return(result.Releases);
        }
コード例 #2
0
        private Release[] Search(VsIdeServiceClient client)
        {
            var whereClause    = "(Project.MetaData['VsixId'] = '41521019-e4c7-480c-8ea8-fc4a2c6f50aa') AND (Project.Metadata['SupportedVSEditions'] LIKE '%15.0.26430.16,Pro;%')";
            var orderClause    = "Project.Metadata['Ranking'] desc";
            var requestContext = new Dictionary <string, string>()
            {
                { "LCID", "1033" },
                { "SearchSource", "ExtensionManagerQuery" },
                { "OSVersion", "10.0.15063.0" }
            };

            var result = client.SearchReleases2("ErikEJ.SQLServerCompactSQLiteToolbox", whereClause, orderClause, 0, 1, requestContext);

            return(result.Releases);
        }
コード例 #3
0
        Release DownloadExtensionDetails(ExtensionInfo ex)
        {
            var endpointAddress = new EndpointAddress("https://visualstudiogallery.msdn.microsoft.com/Services/dev12/Extension.svc");
            var binding         = new WSHttpBinding(SecurityMode.Transport)
            {
                MessageEncoding = WSMessageEncoding.Text,
                TextEncoding    = Encoding.UTF8
            };
            var extensionService = new VsIdeServiceClient(binding, endpointAddress);

            var entry = extensionService.SearchReleases("",
                                                        string.Format("(Project.Metadata['VsixId'] = '{0}')", ex.Identifier),
                                                        "Project.Metadata['Relevance'] desc", null, 0, 10);

            return(entry.Releases.LastOrDefault());
        }
コード例 #4
0
        public static bool CheckForUpdate(Uri galleryUri, IInstalledExtension extension)
        {
            //ProvideExtensionRepositoryAttribute gallery = typeof(CheckoutAndBuild2Package).GetAttributes<ProvideExtensionRepositoryAttribute>(false).FirstOrDefault();
            VsIdeServiceClient c = new VsIdeServiceClient(new WSHttpBinding(SecurityMode.None), new EndpointAddress(galleryUri));

            string[] list = c.GetCurrentVersionsForVsixList(new[] { GuidList.guidCheckoutAndBuild2PkgString }, null);
            string   res  = list.FirstOrDefault();
            Version  onlineVersion;

            if (res != null && Version.TryParse(res, out onlineVersion))
            {
                if (onlineVersion > extension.Header.Version)
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #5
0
        /// <summary>
        /// Checks for update.
        /// </summary>
        private static void CheckForUpdate()
        {
            TraceService.WriteLine("NinjaCoder.MvvmCross.UpdateChecker::CheckForUpdate");

            try
            {
                VsIdeServiceClient client = new VsIdeServiceClient();

                SettingsService settingsService = new SettingsService();

                string[] keys = new string[1];
                keys[0] = settingsService.GalleryId;

                Dictionary<string, string> requestContext = new Dictionary<string, string>()
                                                            {
                                                                { "LCID", "1033" },
                                                                {"SearchSource", "ExtensionManagerUpdate"},
                                                            };

                string[] output = client.GetCurrentVersionsForVsixList(keys, requestContext);

                if (output.Length > 0)
                {
                    string version = output[0];

                    TraceService.WriteLine("NinjaCoder.MvvmCross.UpdateChecker::CheckForUpdate version=" + version);

                    settingsService.LatestVersionOnGallery = version;
                    settingsService.LastCheckedForUpdateDateTime = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                }
            }
            catch (Exception exception)
            {
                TraceService.WriteError("NinjaCoder.MvvmCross.UpdateChecker::CheckForUpdate Error=" + exception.Message);
            }
        }