예제 #1
0
 private void listbox_Choices_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     // Return OK for Item Double Clicked
     Feedback.CItem item = listbox_Choices.SelectedItem as Feedback.CItem;
     if (item != null && item.m_sDescription != "")
     {
         this.DialogResult = DialogResult.OK;
     }
 }
예제 #2
0
 private void radOptionSelected(int selectedOption)
 {
     if (selectedOption > m_descriptor.m_List.Count)
     {
         MPTVSeriesLog.Write("Selected an unavailable Option....");
         return;
     }
     Feedback.CItem item = m_descriptor.m_List[selectedOption];
     if (item != null)
     {
         if (item.m_sDescription != "")
         {
             this.Text = origTitle + " (" + item.m_sName + ")";
             this.textbox_Description.Text = item.m_sDescription;
         }
         SelectedItemRadOption = item;
         button_OK.Text        = m_descriptor.m_sbtnOKLabel;
     }
 }
예제 #3
0
        private void listbox_Choices_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Comment by Inker:
            // ahmm, this change would have needed communication and TESTING
            // the thing is you now can't see anymore what its searching for, not even before you select something
            // and another thing resulted from this....(chosen series was not accepted and instead always the first!!)
            // please be careful with changes that change what is returned from the interfaces!

            Feedback.CItem item = listbox_Choices.SelectedItem as Feedback.CItem;
            if (item != null)
            {
                if (item.m_sDescription != "")
                {
                    this.Text = origTitle + " (" + item.m_sName + ")";
                    this.textbox_Description.Text = item.m_sDescription;
                }
                button_OK.Text = m_descriptor.m_sbtnOKLabel;
            }
        }
예제 #4
0
        public Feedback.ReturnCode ChooseFromSelectionSync(Feedback.ChooseFromSelectionDescriptor descriptor)
        {
            ChooseFromSelectionDialog userSelection = new ChooseFromSelectionDialog(descriptor);
            DialogResult result = userSelection.ShowDialog();
            m_selected = userSelection.SelectedItem;
            switch (result)
            {
                case DialogResult.OK:
                    return Feedback.ReturnCode.OK;

                case DialogResult.Ignore:
                    return Feedback.ReturnCode.Ignore;

                case DialogResult.Cancel:
                default:
                    return Feedback.ReturnCode.Cancel;
            }
        }
예제 #5
0
        public ReturnCode ChooseFromSelectionSync(ChooseFromSelectionDescriptor descriptor)
        {
            try
            {
                IDialogbox dlg = (IDialogbox)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
                m_selected = null;
                if (dlg == null)
                    return ReturnCode.Cancel;

                dlg.Reset();
                if (descriptor.m_sItemToMatchLabel.Length == 0)
                    dlg.SetHeading(descriptor.m_sTitle);
                else
                    dlg.SetHeading(descriptor.m_sItemToMatchLabel + " " + descriptor.m_sItemToMatch);

                GUIListItem pItem = null;

                if (descriptor.m_sbtnSkipLabel.Length > 0)
                {
                    pItem = new GUIListItem(Translation.CFS_Skip);
                    dlg.Add(pItem);
                    pItem.ItemId = 0;

                }
                if (descriptor.m_sbtnIgnoreLabel.Length > 0)
                {
                    pItem = new GUIListItem(Translation.CFS_Skip_Never_Ask_Again);
                    dlg.Add(pItem);
                    pItem.ItemId = 1;
                }

                if (descriptor.m_List.Count == 0)
                {
                    pItem = new GUIListItem(Translation.CFS_No_Results_Found);
                    dlg.Add(pItem);
                    pItem.ItemId = 2;
                }
                else
                {
                    int nCount = 0;
                    foreach (CItem item in descriptor.m_List)
                    {
                        pItem = new GUIListItem(item.m_sName);
                        dlg.Add(pItem);
                        pItem.ItemId = 10 + nCount;
                        nCount++;
                    }
                }

                dlg.DoModal(GUIWindowManager.ActiveWindow);
                if (dlg.SelectedId == -1)
                {
                    return ReturnCode.Cancel;
                }
                else
                {
                    if (dlg.SelectedId == 1)
                    {
                        return ReturnCode.Ignore;
                    }
                    else if (dlg.SelectedId >= 10)
                    {
                        CItem DlgSelected = descriptor.m_List[dlg.SelectedId - 10];
                        m_selected = new CItem(descriptor.m_sItemToMatch, String.Empty, DlgSelected.m_Tag);
                        return ReturnCode.OK;
                    }
                    else
                        return ReturnCode.Cancel;
                }
            }
            catch (Exception ex)
            {
                MPTVSeriesLog.Write("The ChooseFromSelection Method has generated an error: " + ex.Message);
                m_selected = null;
                return ReturnCode.Cancel;
            }
            finally
            {
                this.m_Facade.Focus = true;
            }
        }
예제 #6
0
        public ReturnCode ChooseFromSelection(ChooseFromSelectionDescriptor descriptor, out CItem selected)
        {
            if (this.m_Facade == null)
            {
                selected = null;
                return ReturnCode.NotReady;
            }

            ReturnCode returnCode;
            if (m_localControlForInvoke.InvokeRequired)
            {
                returnCode = (ReturnCode)m_localControlForInvoke.Invoke(new ChooseFromSelectionDelegate(ChooseFromSelectionSync), new Object[] { descriptor });
            }
            else
                returnCode = ChooseFromSelectionSync(descriptor);
            selected = m_selected;
            return returnCode;
        }
예제 #7
0
 private void radOptionSelected(int selectedOption)
 {
     if (selectedOption > m_descriptor.m_List.Count)
     {
         MPTVSeriesLog.Write("Selected an unavailable Option....");
         return;
     }
     Feedback.CItem item = m_descriptor.m_List[selectedOption];
     if (item != null)
     {
         if (item.m_sDescription != "")
         {
             this.Text = origTitle + " (" + item.m_sName + ")";
             this.textbox_Description.Text = item.m_sDescription;
         }
         SelectedItemRadOption = item;
         button_OK.Text = m_descriptor.m_sbtnOKLabel;
     }
 }