Exemplo n.º 1
0
 /// <summary>
 /// Sets a new GUI state.
 /// </summary>
 /// <param name="newState">The new GUI state object.</param>
 internal void SetGUIState(GUIState newState)
 {
     currentState = newState;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a new MainForm object.
        /// </summary>
        public MainForm(SoftphoneEngine softphoneEngine)
        {
            InitializeComponent();
            this.softphoneEngine = softphoneEngine;
            WireUpSoftphoneEngineEvents();
            string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            this.Text += (" " + version);
            CreateToolTips();

            cobTransport.SelectedIndex = 0;
            cobSRTPmode.SelectedIndex = 0;

            var numKeys = new List<Button>();
            numKeys.Add(btnKeypad1);
            numKeys.Add(btnKeypad2);
            numKeys.Add(btnKeypad3);
            numKeys.Add(btnKeypad4);
            numKeys.Add(btnKeypad5);
            numKeys.Add(btnKeypad6);
            numKeys.Add(btnKeypad7);
            numKeys.Add(btnKeypad8);
            numKeys.Add(btnKeypad9);
            numKeys.Add(btnKeypad0);
            numKeys.Add(btnKeypadSharp);
            numKeys.Add(btnKeypadAsterisk);
            NumKeys = numKeys;

            Button[] phoneLineSelectors = new Button[6];
            phoneLineSelectors[0] = btnPhoneLine1;
            phoneLineSelectors[1] = btnPhoneLine2;
            phoneLineSelectors[2] = btnPhoneLine3;
            phoneLineSelectors[3] = btnPhoneLine4;
            phoneLineSelectors[4] = btnPhoneLine5;
            phoneLineSelectors[5] = btnPhoneLine6;
            PhoneLineSelectors = phoneLineSelectors;

            ItsDisplay = tbDialNumber;
            currentState = new NoLineAndNoCall(this);
            MWILogic = new MWILogic(lblMessageWaitingIndication, this.BackColor);
            MWILogic.Reset();

            lbPhoneLines.SelectedValueChanged += (lbPhoneLines_SelectedValueChanged);
            lbPhoneCalls.SelectedValueChanged += (lbPhoneCalls_SelectedValueChanged);

            AcceptOnRegisterButton();

            //tbUserId.Text = tbDisplayName.Text = tbRegisterPassword.Text = tbRegisterName.Text = "884";
            //tbDomainServer.Text = "192.168.112.101";
        }