示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            using (NDC.Push(MethodBase.GetCurrentMethod().Name)) {
                this.lblOperation.Text = "Ładuję obrazki";
                int count = 0;
                FolderBrowserDialog browserDialog = new FolderBrowserDialog();
                if (browserDialog.ShowDialog() == DialogResult.OK)
                {
                    count = Ctx.CollectImages(browserDialog.SelectedPath, (int)nudWidth.Value, (int)nudHeight.Value);
                }
                else
                {
                    //TODO: fix this
                    //this message is stupid
                    //MessageBox.Show(strings.DirectoryDoesNotExist);
                }

                log.DebugFormat("Count tiles {0}", count);
                if (count > 15)
                {
                    btnGo.Enabled       = true;
                    lblAddFirst.Visible = false;
                }
                else
                {
                    btnGo.Enabled       = false;
                    lblAddFirst.Visible = true;
                    lblAddFirst.Text    = strings.AddAtLeast15Tiles;
                }
                this.lblOperation.Text  = "Obrazki załadowane";
                this.pgbOperation.Value = 0;
                this.lblPercentage.Text = "0%";
            }
        }