예제 #1
0
 public void Render(StringBuilder sb)
 {
     sb.AppendLine("<div id='pager'>");
     sb.AppendLine("<div id='lblPage'>" + tprov.GetString(lang, "history.lblPage") + "</div>");
     sb.AppendLine("<div id='pageLinks'>");
     buildHistoryLinks(sb);
     sb.AppendLine("</div>");
     sb.AppendLine("</div>");
     for (int i = 0; i != histChanges.Count; ++i)
     {
         ChangeItem ci = histChanges[i];
         histRenderChange(sb, ci, i != histChanges.Count - 1, lang, parser);
     }
 }
예제 #2
0
        /// <summary>
        /// Constructs updater form.
        /// </summary>
        /// <param name="fileToDelete">The file to delete when form is closed, or on crash.</param>
        public ZydeoUpdateForm(ScheduleFileToDeleteDelegate scheduleFileToDelete,
            bool serviceStartedForUI)
        {
            // Desginer code
            InitializeComponent();

            // Initialized text provider.
            tprov = new TextProvider(UpdateInfo.GetUILang());
            lblHeader.Text = tprov.GetString("AuHeader");

            // If we're in designer, done here
            if (Process.GetCurrentProcess().ProcessName == "devenv") return;

            // Remember file delete scheduling delegate.
            this.scheduleFileToDelete = scheduleFileToDelete;

            // We want 1px to be 1px at all resolutions
            pnlOuter.Padding = new Padding(1);

            // Set image and icon; Zydeo link text
            Assembly a = Assembly.GetExecutingAssembly();
            var img = Image.FromStream(a.GetManifestResourceStream("ZD.AU.Resources.installer1.bmp"));
            pictureBox1.BackgroundImage = img;
            Icon = new Icon(a.GetManifestResourceStream("ZD.AU.Resources.ZydeoSetup.ico"));
            llZydeoSite.Text = Magic.ZydeoSiteUrl;
            llZydeoSite.LinkArea = new LinkArea(0, llZydeoSite.Text.Length + 1);

            // Moveable by header; button event
            lblHeader.MouseDown += onHeaderMouseDown;
            lblHeader.MouseUp += onHeaderMouseUp;
            lblHeader.MouseMove += onHeaderMouseMove;
            btnClose.Click += onBtnClick;
            llZydeoSite.Click += onLinkClick;

            // Initial state: see if service is running; try to connect.
            if (!serviceStartedForUI) initOK = false;
            else initOK = doConnectToService();
            // May start with inevatible fail state
            if (initOK) doSetStateSafe(State.DLoading);
            else doSetStateSafe(State.InitFailed);
        }