Exemplo n.º 1
0
        public FolderMonitorEdit([NotNull] FoundFolder hint)
        {
            InitializeComponent();

            codeFinderControl = new TheTvdbCodeFinder("")
            {
                Dock = DockStyle.Fill
            };
            codeFinderControl.SelectionChanged      += CodeChanged;
            codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderControl);
            pnlCF.ResumeLayout();

            if (hint.CodeKnown)
            {
                codeFinderControl.SetHint(hint.TVDBCode.ToString());
            }
            else
            {
                string s = hint.Folder.FullName;
                int    p = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar);
                codeFinderControl.SetHint(string.IsNullOrWhiteSpace(hint.RefinedHint)
                    ? s.Substring(p + 1)
                    : hint.RefinedHint);
            }
            Code = -1;
        }
Exemplo n.º 2
0
        public AutoAddShow(string hint)
        {
            InitializeComponent();
            ShowItem   = new ShowItem();
            codeFinder = new TheTvdbCodeFinder("")
            {
                Dock = DockStyle.Fill
            };
            codeFinder.SetHint(hint);
            codeFinder.SelectionChanged += MTCCF_SelectionChanged;
            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinder);
            pnlCF.ResumeLayout();
            ActiveControl = codeFinder; // set initial focus to the code entry/show finder control

            cbDirectory.SuspendLayout();
            cbDirectory.Items.Clear();
            foreach (string folder in TVSettings.Instance.LibraryFolders)
            {
                cbDirectory.Items.Add(folder.TrimEnd(Path.DirectorySeparatorChar.ToString()));
            }

            if (TVSettings.Instance.DefShowAutoFolders && TVSettings.Instance.DefShowUseDefLocation)
            {
                cbDirectory.Text = TVSettings.Instance.DefShowLocation.TrimEnd(Path.DirectorySeparatorChar.ToString());
            }
            else
            {
                cbDirectory.SelectedIndex = 0;
            }

            cbDirectory.ResumeLayout();

            originalHint = hint;
        }
Exemplo n.º 3
0
        public AutoAddShow(string hint)
        {
            InitializeComponent();
            ShowItem   = new ShowItem();
            codeFinder = new TheTvdbCodeFinder("")
            {
                Dock = DockStyle.Fill
            };
            codeFinder.SetHint(hint);
            codeFinder.SelectionChanged += MTCCF_SelectionChanged;
            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinder);
            pnlCF.ResumeLayout();
            ActiveControl = codeFinder; // set initial focus to the code entry/show finder control

            cbDirectory.SuspendLayout();
            cbDirectory.Items.Clear();
            cbDirectory.Items.AddRange(TVSettings.Instance.LibraryFolders.ToArray());
            cbDirectory.SelectedIndex = 0;
            cbDirectory.ResumeLayout();

            originalHint = hint;
        }