Beispiel #1
0
        public void MainSubForm_Resize(object sender, EventArgs e)
        {
            P_IconPath.Height       = P_SpecificFolder.Height = P_SeasonsEpsSubs.Height = P_TotEps.Height = (int)(P_Main.Height / 8.5);
            P_Options.Height        = P_NameStyle.Height = (int)(P_Main.Height / 4.25);
            P_RB_L.Width            = P_NS.Width / 2;
            RB_Style1.Height        = RB_Style3.Height = P_RB_L.Height / 2;
            CB_ShowSeason.Width     = CB_IncSubs.Width = CB_CleanFolders.Width = CB_CustomName.Width = P_Options_Checkboxes.Width / 3;
            P_Top_Checkboxes.Height = P_Options_Checkboxes.Height / 2;
            TB_FolderPath.Width     = TB_SeriesName.Width = P_TB_FolderPath.Width * 85 / 100;
            TB_FolderPath.Center(P_TB_FolderPath);
            TB_SeriesName.Center(P_TB_SeriesName);
            B_Browse.Center(P_B_Browse);
            if (O_IncludeSubs)
            {
                P_TotEps.Center(P_SeasonsEpsSubs);
            }
            B_Continue.Location = new Point((P_Buttons.Width - B_Continue.Width) * 7 / 10, (16 + P_Buttons.Height - B_Continue.Height) / 2);
            B_Rename.Location   = new Point((P_Buttons.Width - B_Continue.Width) * 3 / 10, (16 + P_Buttons.Height - B_Continue.Height) / 2);
            PB_Refresh.Location = new Point((P_B_Browse.Location.X - PB_Refresh.Width - TB_FolderPath.Width - P_TB_FolderPath.Location.X - TB_FolderPath.Location.X) / 2 + P_TB_FolderPath.Location.X + TB_FolderPath.Width + TB_FolderPath.Location.X, (P_Refresh.Height - PB_Refresh.Height) / 2);

            //Custom Name
            RB_CName.Height  = P_CustomName.Height / 2;
            TB_CN_1.Width    = TB_CN_2.Width = TB_CN_3.Width = (int)(RB_CName.Width * .85 - L_CN_1.Width - L_CN_2.Width - L_CN_3.Width - L_CN_4.Width - 15) / 3;
            L_CN_1.Location  = new Point((P_CustomName.Width - L_CN_1.Width - TB_CN_1.Width - L_CN_2.Width - TB_CN_2.Width - (MovieMode ? 0 : L_CN_3.Width + L_CN_4.Width + TB_CN_3.Width)) / 2, P_CustomName.Height * 2 / 10);
            TB_CN_1.Location = new Point(L_CN_1.Location.X + L_CN_1.Width, L_CN_1.Location.Y - 5);
            L_CN_2.Location  = new Point(TB_CN_1.Location.X + TB_CN_1.Width + 5, L_CN_1.Location.Y);
            TB_CN_2.Location = new Point(L_CN_2.Location.X + L_CN_2.Width, L_CN_1.Location.Y - 5);
            L_CN_3.Location  = new Point(TB_CN_2.Location.X + TB_CN_2.Width + 5, L_CN_1.Location.Y);
            TB_CN_3.Location = new Point(L_CN_3.Location.X + L_CN_3.Width, L_CN_1.Location.Y - 5);
            L_CN_4.Location  = new Point(TB_CN_3.Location.X + TB_CN_3.Width + 5, L_CN_1.Location.Y);
        }
Beispiel #2
0
        private void TB_FolderPath_TextChanged(object sender, EventArgs e)
        {
            if (TB_FolderPath.Text.EndsWith("\\") && !Directory.Exists(TB_FolderPath.Text.RemoveAt(TB_FolderPath.Text.Length - 1)))
            {
                DisableTextChange = true; TB_FolderPath.Text = LastSpecificPathText[1] + "\\"; TB_FolderPath.Select(TB_FolderPath.Text.Length, 0); DisableTextChange = false;
            }
            if (!DisableTextChange && (TB_FolderPath.Text.EndsWith("\\") || !Directory.Exists(TB_FolderPath.Text)) && TB_FolderPath.Text.ToLower() != LastSpecificPathText[0].ToLower())
            {
                try
                {
                    LastSpecificPathText[0] = TB_FolderPath.Text;
                    var SelectIndex     = TB_FolderPath.SelectionStart;
                    var NextDirectories = Directory.GetDirectories(Directory.GetParent(TB_FolderPath.Text).FullName);
                    var NextDirectory   = NextDirectories.Where(x => x.ToLower().StartsWith(TB_FolderPath.Text.ToLower())).FirstOrDefault();
                    if (NextDirectory != null)
                    {
                        TB_FolderPath.Text = NextDirectory; TB_FolderPath.Select(SelectIndex, NextDirectory.Length - SelectIndex);
                    }
                }
                catch (Exception) { }
            }
            LastSpecificPathText[1] = TB_FolderPath.Text;
            CurrentFormState        = GetFormState();
            if (TB_FolderPath.Text == "" || (Directory.Exists(TB_FolderPath.Text) && Directory.GetParent(TB_FolderPath.Text) != null))
            {
                Form1.ClearError();

                RefreshFolder();

                if (!MovieMode)
                {
                    if (TB_FolderPath.Text.DirectoryName().ToLower().Contains("season"))
                    {
                        TB_SeriesName.Text = NameExtractor.GetSeriesName(TB_FolderPath.Text.Parent().DirectoryName());
                    }
                    else
                    {
                        TB_SeriesName.Text = NameExtractor.GetSeriesName(TB_FolderPath.Text.DirectoryName());
                    }
                }
            }
            else
            {
                if (Directory.Exists(TB_FolderPath.Text) && Directory.GetParent(TB_FolderPath.Text) == null)
                {
                    Form1.ShowError("Directory can not be Drive Root");
                }
                CurrentFormState = FormState.Busy;
            }
        }