Пример #1
0
        private void ShowSiteProperties(string sKey)
        {
            SitePropertiesDialog dlg = new SitePropertiesDialog(
                _started ? SitePropertiesDialog.OpenMode.MODE_READONLY : SitePropertiesDialog.OpenMode.MODE_EDIT,
                _webSites,
                sKey);

            dlg.txtKeyName.Text            = sKey;
            dlg.txtDefaultPage.Text        = _webSites[sKey].DefaultPage;
            dlg.txtPhysicalPath.Text       = _webSites[sKey].PhysicalPath;
            dlg.txtPortNumber.Text         = _webSites[sKey].Port.ToString();
            dlg.txtVirtualPath.Text        = _webSites[sKey].VirtualPath.Substring(1);
            dlg.chkLogPageRequests.Checked = _webSites[sKey].LogPageRequests;
            dlg.txtKeyName.Enabled         = !_started;
            dlg.txtDefaultPage.Enabled     = !_started;
            dlg.txtPhysicalPath.Enabled    = !_started;
            dlg.txtPortNumber.Enabled      = !_started;
            dlg.txtVirtualPath.Enabled     = !_started;
            dlg.btnOk.Enabled = !_started;

            if (dlg.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }

            _webSites.Remove(sKey);

            WebSite ws = new WebSite();

            ws.DefaultPage     = dlg.txtDefaultPage.Text;
            ws.PhysicalPath    = dlg.txtPhysicalPath.Text;
            ws.Port            = Convert.ToInt32(dlg.txtPortNumber.Text);
            ws.VirtualPath     = dlg.txtVirtualPath.Text;
            ws.LogPageRequests = dlg.chkLogPageRequests.Checked;

            _webSites.Add(dlg.txtKeyName.Text, ws);
            _webSites.Save(_allowRemoteConnections, _hideAtStartup, _startAutomatically);

            UpdateUI();
        }
Пример #2
0
        private void addSiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SitePropertiesDialog dlg = new SitePropertiesDialog(SitePropertiesDialog.OpenMode.MODE_ADD,
                                                                _webSites,
                                                                null);

            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            WebSite ws = new WebSite();

            ws.DefaultPage  = dlg.txtDefaultPage.Text;
            ws.PhysicalPath = dlg.txtPhysicalPath.Text;
            ws.Port         = Convert.ToInt32(dlg.txtPortNumber.Text);
            ws.VirtualPath  = dlg.txtVirtualPath.Text;

            _webSites.Add(dlg.txtKeyName.Text, ws);
            _webSites.Save(_allowRemoteConnections, _hideAtStartup, _startAutomatically);

            UpdateUI();
        }
Пример #3
0
        private void ShowSiteProperties(string sKey)
        {
            SitePropertiesDialog dlg = new SitePropertiesDialog(
                _started ? SitePropertiesDialog.OpenMode.MODE_READONLY : SitePropertiesDialog.OpenMode.MODE_EDIT,
                _webSites,
                sKey);

            dlg.txtKeyName.Text = sKey;
            dlg.txtDefaultPage.Text = _webSites[sKey].DefaultPage;
            dlg.txtPhysicalPath.Text = _webSites[sKey].PhysicalPath;
            dlg.txtPortNumber.Text = _webSites[sKey].Port.ToString();
            dlg.txtVirtualPath.Text = _webSites[sKey].VirtualPath.Substring(1);
            dlg.chkLogPageRequests.Checked = _webSites[sKey].LogPageRequests;
            dlg.txtKeyName.Enabled = !_started;
            dlg.txtDefaultPage.Enabled = !_started;
            dlg.txtPhysicalPath.Enabled = !_started;
            dlg.txtPortNumber.Enabled = !_started;
            dlg.txtVirtualPath.Enabled = !_started;
            dlg.btnOk.Enabled = !_started;

            if (dlg.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }

            _webSites.Remove(sKey);

            WebSite ws = new WebSite();
            ws.DefaultPage = dlg.txtDefaultPage.Text;
            ws.PhysicalPath = dlg.txtPhysicalPath.Text;
            ws.Port = Convert.ToInt32(dlg.txtPortNumber.Text);
            ws.VirtualPath = dlg.txtVirtualPath.Text;
            ws.LogPageRequests = dlg.chkLogPageRequests.Checked;

            _webSites.Add(dlg.txtKeyName.Text, ws);
            _webSites.Save(_allowRemoteConnections, _hideAtStartup, _startAutomatically);

            UpdateUI();
        }
Пример #4
0
        private void addSiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SitePropertiesDialog dlg = new SitePropertiesDialog(SitePropertiesDialog.OpenMode.MODE_ADD,
                _webSites,
                null);

            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            WebSite ws = new WebSite();
            ws.DefaultPage = dlg.txtDefaultPage.Text;
            ws.PhysicalPath = dlg.txtPhysicalPath.Text;
            ws.Port = Convert.ToInt32(dlg.txtPortNumber.Text);
            ws.VirtualPath = dlg.txtVirtualPath.Text;

            _webSites.Add(dlg.txtKeyName.Text, ws);
            _webSites.Save(_allowRemoteConnections, _hideAtStartup, _startAutomatically);

            UpdateUI();
        }