Ejemplo n.º 1
0
        private void aboutForm_Shown(object sender, EventArgs e)
        {
            //Force paint by calling Application.DoEvents();
            Application.DoEvents();

            bool lessCompilerUpdateAvailable = LessCompiler.IsCompilerUpdateAvailable();

            checkingForUpdatesLabel.Visible = false;

            if (lessCompilerUpdateAvailable)
            {
                if (MessageBox.Show(string.Format("WinLess uses the official LESS compiler, less.js, to compile your LESS files.\n\nA new version of less.js is available. Do you want to update less.js from {0} to {1}?", LessCompiler.GetCurrentCompilerVersion(), LessCompiler.GetAvailableCompilerVersion()), "Update LESS compiler?", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    //Show updatingLabel and force repaint by calling Application.DoEvents();
                    updatingLabel.Visible = true;
                    Application.DoEvents();

                    LessCompiler.UpdateCompiler();

                    Version newVersion = LessCompiler.GetCurrentCompilerVersion();
                    lessjsVersionLabel.Text = newVersion.ToString();

                    updatingLabel.Visible = false;

                    MessageBox.Show(string.Format("Succesfully updated less.js to version {0}", newVersion), "LESS compiler update");
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Compiles a list of selected LESS files
        /// </summary>
        private void CompileSelectedFiles()
        {
            // Retrieve list of files from data grid
            var files = (List <Models.File>)filesDataGridView.DataSource;

            // Compile files one by one
            foreach (Models.File file in files)
            {
                if (file.Enabled)
                {
                    LessCompiler.Compile(file.FullPath, file.OutputPath, file.Minify);
                }
            }
        }
Ejemplo n.º 3
0
 private void CheckForLessUpdates()
 {
     if (Program.Settings.CheckForLessUpdates)
     {
         if (LessCompiler.IsCompilerUpdateAvailable())
         {
             if (MessageBox.Show(string.Format("WinLess uses the official LESS compiler, less.js, to compile your LESS files.\n\nA new version of less.js is available. Do you want to update less.js from {0} to {1}?", LessCompiler.GetCurrentCompilerVersion(), LessCompiler.GetAvailableCompilerVersion()), "Update LESS compiler?", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 LessCompiler.UpdateCompiler();
                 MessageBox.Show(string.Format("Succesfully updated less.js to version {0}", LessCompiler.GetCurrentCompilerVersion()), "LESS compiler update");
             }
         }
     }
 }
Ejemplo n.º 4
0
 public AboutForm()
 {
     InitializeComponent();
     winlessVersionLabel.Text = GetApplicationVersion();
     lessjsVersionLabel.Text  = LessCompiler.GetCurrentCompilerVersion().ToString();
 }