private void GetPluginStatus([NotNull] InstalledPluginInfo plugin)
        {
            Debug.ArgumentNotNull(plugin, nameof(plugin));

            if (!AppHost.Plugins.IsServerComponent(plugin.Name))
            {
                return;
            }

            var component = GetComponent(plugin.Name);

            if (component != null)
            {
                return;
            }

            var update = new UpdateInfo
            {
                Name          = plugin.Name,
                Plugin        = plugin,
                LocalVersion  = plugin.Version,
                ServerVersion = Rocks.Resources.N_A,
                IsChecked     = true,
                Action        = Rocks.Resources.UpdateServerComponentsDialog_GetComponentStatus_Copy_to_Server
            };

            Updates.Add(update);
        }
예제 #2
0
        private static void GetAssemblyFiles([NotNull] List <InstalledPluginInfo> result, [NotNull] IEnumerable <string> fileNames, [NotNull] System.Version sitecoreVersion, [NotNull] RuntimeVersion kernelRuntimeVersion)
        {
            Diagnostics.Debug.ArgumentNotNull(result, nameof(result));
            Diagnostics.Debug.ArgumentNotNull(fileNames, nameof(fileNames));
            Diagnostics.Debug.ArgumentNotNull(sitecoreVersion, nameof(sitecoreVersion));
            Diagnostics.Debug.ArgumentNotNull(kernelRuntimeVersion, nameof(kernelRuntimeVersion));

            foreach (var fileName in fileNames)
            {
                var runtimeVersion = GetRuntimeVersion(fileName);
                if (kernelRuntimeVersion != RuntimeVersion.Empty && runtimeVersion > kernelRuntimeVersion)
                {
                    continue;
                }

                if (!IsSitecoreVersion(sitecoreVersion, fileName))
                {
                    continue;
                }

                var fileVersionInfo = FileVersionInfo.GetVersionInfo(fileName);

                var info = new InstalledPluginInfo
                {
                    ServerFile     = fileName,
                    Name           = Path.GetFileNameWithoutExtension(fileName) ?? string.Empty,
                    Version        = fileVersionInfo.FileVersion,
                    RuntimeVersion = runtimeVersion
                };

                result.Add(info);
            }
        }