Esempio n. 1
0
        public ModStore()
        {
            config.parentForm = this;
            InitializeComponent();
            this.Icon           = Resources.icon;
            PoweredByLinkS.Text = "Powered By HakchiResources.com";

            var welcomeURL = new Uri("https://hakchiresources.com/modstorewelcome/?mode=welcome");

            if (Shared.isWindows)
            {
                var browser = new WebBrowser()
                {
                    ScriptErrorsSuppressed = true, AllowWebBrowserDrop = false, Dock = DockStyle.Fill, Url = welcomeURL
                };
                tabPage0.Controls.Add(browser);
            }
            else
            {
                var welcomeControl = new TextReadmeControl()
                {
                    Dock = DockStyle.Fill
                };
                using (var webClient = new System.Net.WebClient())
                {
                    ReverseMarkdown.Converter converter = new ReverseMarkdown.Converter();

                    var welcomeText = Shared.ReverseMarkdown(webClient.DownloadString(welcomeURL));

                    welcomeControl.setReadme(null, welcomeText);
                }

                tabPage0.Controls.Add(welcomeControl);
            }
        }
Esempio n. 2
0
        private void loadModuleDescription()
        {
            Cursor.Current = Cursors.WaitCursor;
            var installedModule = manager.GetInstalledModule(currentItem);

            if (Shared.isWindows)
            {
                webBrowser1.Navigate(new Uri(currentItem.Description, UriKind.Absolute));
            }
            else
            {
                trcReadme.setReadme(null, Shared.ReverseMarkdown(currentItem.Content));
            }

            modInfo.SetInfo(currentItem.Name, currentItem.Author, currentItem.Version, (installedModule != null ? installedModule.Version : "N/A"));

            if (installedModule != null)
            {
                if (installedModule.Version != currentItem.Version)
                {
                    moduleDownloadButton.Enabled     = true;
                    moduleDownloadButton.Text        = "Update " + currentItem.Type;
                    moduleDownloadInstallButton.Text = "Update and Install" + currentItem.Type;
                }
                else
                {
                    moduleDownloadButton.Enabled     = false;
                    moduleDownloadButton.Text        = currentItem.Type + " Up-To-Date";
                    moduleDownloadInstallButton.Text = "Install " + currentItem.Type;
                }
            }
            else
            {
                moduleDownloadButton.Enabled     = true;
                moduleDownloadButton.Text        = "Download " + currentItem.Type;
                moduleDownloadInstallButton.Text = "Download and Install " + currentItem.Type;
            }
            moduleDownloadInstallButton.Enabled = true;
        }