void CreateWebSite()
        {
            var newWebSite = WebSiteViewModel.CreateNew(this.webSiteManager, this.mediator);

            WebSites.Add(newWebSite);
            SetActiveWebSite(newWebSite);
        }
        void ConnectClick(object Sender, RoutedEventArgs e)
        {
            SetPassword();
            blogger = Utils.InitializeBlogger(ProviderInfo);
            IEnumerable <BlogInfo> blogs = blogger.GetUsersBlogs();

            if (blogs == null)
            {
                return;
            }
            WebSites.Clear();
            foreach (BlogInfo blog in blogs)
            {
                WebSites.Add(blog);
            }
            BlogsLoaded = true;
        }
示例#3
0
        /// <summary>
        /// This is the constructor that is used when command line parameters are used
        /// </summary>
        /// <param name="PhysicalPath"></param>
        /// <param name="VirtualPath"></param>
        /// <param name="Port"></param>
        /// <param name="DefaultPage"></param>
        /// <param name="AllowRemoteConnection"></param>
        /// <param name="LogPageRequests"></param>
        public SmallUIForm(string PhysicalPath, string VirtualPath, int Port, string DefaultPage, bool AllowRemoteConnection, bool LogPageRequests)
        {
            InitializeComponent();

            _webSite.PhysicalPath = PhysicalPath;
            _webSite.VirtualPath = VirtualPath;
            _webSite.Port = Port;
            _webSite.DefaultPage = DefaultPage;
            _webSite.LogPageRequests = LogPageRequests;

            _allowRemoteConnection = AllowRemoteConnection;

            txtPhysicalPath.Text = _webSite.PhysicalPath;
            txtVirtualPath.Text = _webSite.VirtualPath.Substring(1);
            txtPortNumber.Text = _webSite.Port.ToString();
            txtDefaultPage.Text = _webSite.DefaultPage;

            linkLabel.Text = _webSite.Url;
            chkAllowRemoteConnection.Checked = _allowRemoteConnection;
            chkLogPageRequests.Checked = _webSite.LogPageRequests;

            // Create a listener for ServerManager messages
            _webSites = new WebSites();
            _webSites.Add("FormSite", _webSite);
            _managerListener = new ServerManagerListener(Program.SERVER_MANAGER_BASE_PORT, this, _webSites);
            _managerListener.StartListening();

            // Create the help site and start the server unless another instance of the app has already done it
            _helpSite = Program.CreateHelpWebSite();

            if (!Program.PortIsInUse(_helpSite.Port, false) && (_helpSite.PhysicalPath != String.Empty))
            {
                _helpSite.WebServer = new Server(_helpSite.Port, _helpSite.VirtualPath, _helpSite.PhysicalPath, _helpSite.DefaultPage, false, false);
            }

            // Set the main window title
            this.Text = String.Format("{0} [{1}]", Program.ApplicationTitle, _webSite.Port.ToString());
        }