コード例 #1
0
ファイル: Main.cs プロジェクト: Nagru/Manga-Organizer
 /// <summary>
 /// Show the tutorial form
 /// </summary>
 private void msTutorial_Click(object sender, EventArgs e)
 {
     Tutorial fmTut = new Tutorial();
     fmTut.ShowDialog();
     fmTut.Dispose();
 }
コード例 #2
0
ファイル: Main.cs プロジェクト: Nagru/Manga-Organizer
        /// <summary>
        /// Sets DB contents into program once loaded
        /// </summary>
        private void Database_Display()
        {
            //open tutorial on first run
            if ((bool)SQL.GetSetting(SQL.Setting.NewUser)) {
                //Run tutorial on first execution
                SQL.UpdateSetting(SQL.Setting.NewUser, false);
                Tutorial fmTut = new Tutorial();
                fmTut.Show();

                //set runtime sensitive default locations
                SQL.UpdateSetting(SQL.Setting.SavePath, Environment.CurrentDirectory);
                SQL.UpdateSetting(SQL.Setting.RootPath, Environment.CurrentDirectory);
            }

            #region Set Form Position

            Rectangle rctForm = (Rectangle)SQL.GetSetting(SQL.Setting.FormPosition);
            if (rctForm.Size != null) {
                Location = rctForm.Location;
                Size = rctForm.Size;
            }

            //ensure it's displayed
            bool bDisplayed = false;
            foreach (Screen sc in Screen.AllScreens) {
                if (sc.WorkingArea.Contains(Location)) {
                    bDisplayed = true;
                    break;
                }
            }
            if (!bDisplayed) {
                CenterToScreen();
            }

            #endregion Set Form Position

            //get user settings
            frTxBx_Notes.Text = (string)SQL.GetSetting(SQL.Setting.Notes);
            lvManga.GridLines = (bool)SQL.GetSetting(SQL.Setting.ShowGrid);
            PicBx_Cover.BackColor = (Color)SQL.GetSetting(SQL.Setting.BackgroundColour);
            if (!(bool)SQL.GetSetting(SQL.Setting.ShowDate)) {
                lvManga.Columns[4].Width = 0;
            }
            if ((bool)SQL.GetSetting(SQL.Setting.ShowCovers)) {
                msClearCurrentCover.Visible = true;
                lvManga.View = View.LargeIcon;
                coverQueue.LoadCovers = true;
            }

            //set up tags, types, and artists
            RefreshAutocomplete();

            //start cover & metadata image thread
            coverQueue.StartThread(main:this);
            metadataQueue.StartThread(main:this);

            Reset();
            ResizeLV();
            UpdateLV();

            Cursor = Cursors.Default;
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: emmauss/Manga-Organizer
		/// <summary>
		/// Sets DB contents into program once loaded
		/// </summary>
		private void Database_Display()
		{
			//run tutorial on first run
			if (SQL.GetSetting(SQL.Setting.NewUser) == "1") {
				//Run tutorial on first execution
				SQL.UpdateSetting(SQL.Setting.NewUser, 0);
				Tutorial fmTut = new Tutorial();
				fmTut.Show();

				//set runtime sensitive default locations
				SQL.UpdateSetting(SQL.Setting.SavePath, Environment.CurrentDirectory);
				SQL.UpdateSetting(SQL.Setting.RootPath, Environment.CurrentDirectory);
			}

			//check user settings

			#region Set Form Position

			string sPos = SQL.GetSetting(SQL.Setting.FormPosition);
			if (!string.IsNullOrWhiteSpace(sPos)) {
				int[] aiForm = sPos.Split(',').Select(x => int.Parse(x)).ToArray();
				Location = new Point(
					aiForm[0] > -1 ? aiForm[0] : 0
					, aiForm[1] > -1 ? aiForm[1] : 0
				);
				Width = aiForm[2];
				Height = aiForm[3];
			}

			//ensure it's displayed
			bool bDisplayed = false;
			foreach (Screen sc in Screen.AllScreens) {
				if (sc.WorkingArea.Contains(Location)) {
					bDisplayed = true;
					break;
				}
			}
			if (!bDisplayed) {
				CenterToScreen();
			}

			#endregion Set Form Position

			frTxBx_Notes.Text = SQL.GetSetting(SQL.Setting.Notes);
			lvManga.GridLines = SQL.GetSetting(SQL.Setting.ShowGrid) == "1";
			PicBx_Cover.BackColor = Color.FromArgb(int.Parse(SQL.GetSetting(SQL.Setting.BackgroundColour)));
			if (SQL.GetSetting(SQL.Setting.ShowDate) == "0")
				lvManga.Columns[4].Width = 0;

			//set up tags, types, and artists
			RefreshAutocomplete();

			Reset();
			UpdateLV();
			ResizeLV();
			Cursor = Cursors.Default;

			//start auto-metadata thread
			thMetadata = new Thread(AutoMetadata);
			thMetadata.IsBackground = true;
			thMetadata.Start();

			//start cover image thread
			thLoadCovers = new Thread(PopulateIcons);
			thLoadCovers.IsBackground = true;
			thLoadCovers.Start();
		}