Ejemplo n.º 1
0
        public frmExplorer(AppSettings appsettings)
        {
            // Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
            InitializeComponent();
            this.childs = new ArrayList();
            this.optset = (LocalAppSettings)appsettings;
            UpdateInterfaceFromConfg();

            BindExplorerEvents();

            this.localizator         = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
            this.UpdateComboWidth();
            this.BringToFront();
        }
Ejemplo n.º 2
0
        public frmExplorer(AppSettings appsettings)
        {
            // Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
            InitializeComponent();
            this.childs = new ArrayList();
            this.optset = (LocalAppSettings)appsettings;
            UpdateInterfaceFromConfg();

            BindExplorerEvents();

            this.localizator = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
            this.UpdateComboWidth();
            this.BringToFront();
        }
Ejemplo n.º 3
0
        public frmCallerId(AppSettings appsettings, string callerid)
        {
            InitializeComponent();
            this.optset = (LocalAppSettings)appsettings;
            Stream s   = this.GetType().Assembly.GetManifestResourceStream("AstCTIClient.callerid.gif");
            Bitmap bmp = new Bitmap(s);

            this.Region              = BitmapToRegion.Convert(bmp, bmp.GetPixel(0, 0), TransparencyMode.ColorKeyTransparent);
            this.Click              += new EventHandler(frmCallerId_Click);
            this.lblCallerId.Text    = callerid;
            this.lblCallerName.Text  = "";
            this.Speed               = 10;
            this.MouseEnter         += new EventHandler(frmCallerId_MouseEnter);
            this.MouseLeave         += new EventHandler(frmCallerId_MouseLeave);
            this.localizator         = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
        }
Ejemplo n.º 4
0
        public frmSettings(LocalAppSettings appsettings)
        {
            this.optset = appsettings;

            InitializeComponent();
            this.txtCtiServerPort.LostFocus += new EventHandler(CheckNumericAndDefault);
            this.txtCtiServerTimeout.LostFocus += new EventHandler(CheckNumericAndDefault);
            this.txtCalleridTimeout.LostFocus += new EventHandler(CheckNumericAndDefault);
            this.txtCalleridFadeoutSpeed.LostFocus += new EventHandler(CheckNumericAndDefault);
            this.txtMysqlPort.LostFocus += new EventHandler(CheckNumericAndDefault);
            this.localizator = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
            LoadLocales();
            LoadLanguageDirectory(this.localizator.ResourcePath);
            SetFont();

            this.SetAppSettings();

            this.cbLanguage.SelectedValueChanged += new EventHandler(cbLanguage_SelectedValueChanged);
        }
Ejemplo n.º 5
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            try
            {
                frmSettings  frm = new frmSettings(this.optset);
                DialogResult res = frm.ShowDialog(this);
                sm.AppSettingsObject = frm.Settings;
                sm.WriteConfig();
                sm.ReadConfig();
                this.optset = (LocalAppSettings)sm.AppSettingsObject;
                frm.Dispose();
                this.BringToFront();
                this.txtUsername.Text  = optset.Username;
                this.txtPassword.Text  = optset.Password;
                this.lblExtension.Text = optset.PhoneExt;

                this.UpdateOutboundContextes();

                this.localizator.Culture = this.optset.Language;
                this.localizator.Localize(this);
                UpdateTooltips();
                this.FormSetFont();

                if (this.noOpTimer != null)
                {
                    this.noOpTimer.Interval = this.optset.SocketTimeout;
                }
                // this should refresh the socketmanager
                if (this.socketmanager != null)
                {
                    this.socketmanager.Host = this.optset.Host;
                    this.socketmanager.Port = this.optset.Port;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 6
0
        public frmSettings(LocalAppSettings appsettings)
        {
            this.optset = appsettings;

            InitializeComponent();
            this.txtCtiServerPort.LostFocus        += new EventHandler(CheckNumericAndDefault);
            this.txtCtiServerTimeout.LostFocus     += new EventHandler(CheckNumericAndDefault);
            this.txtCalleridTimeout.LostFocus      += new EventHandler(CheckNumericAndDefault);
            this.txtCalleridFadeoutSpeed.LostFocus += new EventHandler(CheckNumericAndDefault);
            this.txtMysqlPort.LostFocus            += new EventHandler(CheckNumericAndDefault);
            this.localizator         = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
            LoadLocales();
            LoadLanguageDirectory(this.localizator.ResourcePath);
            SetFont();


            this.SetAppSettings();


            this.cbLanguage.SelectedValueChanged += new EventHandler(cbLanguage_SelectedValueChanged);
        }
Ejemplo n.º 7
0
        public frmMain()
        {
            InitializeComponent();
            Stream s   = this.GetType().Assembly.GetManifestResourceStream("AstCTIClient.mainform.gif");
            Bitmap bmp = new Bitmap(s);

            this.DoubleBuffered              = true;
            this.Region                      = BitmapToRegion.Convert(bmp, bmp.GetPixel(0, 0), TransparencyMode.ColorKeyTransparent);
            this.notifyIcon1.Visible         = false;
            this.MouseDown                  += new MouseEventHandler(frmMain_MouseDown);
            this.notifyIcon1.DoubleClick    += new EventHandler(notifyIcon1_DoubleClick);
            this.txtPassword.LostFocus      += new EventHandler(txtPassword_LostFocus);
            this.txtUsername.LostFocus      += new EventHandler(txtUsername_LostFocus);
            this.txtPhoneNumber.TextChanged += new EventHandler(txtPhoneNumber_TextChanged);
            this.cboOutboundContextes.SelectedIndexChanged += new EventHandler(cboOutboundContextes_SelectedIndexChanged);
            this.socketmanager     = null;
            this.parser            = null;
            this.protocolStatus    = PROTOCOL_STATES.STATUS_UNKNOWN;
            this.lblLineState.Text = "";
            sm = new SettingsManager.SettingsManager();
            this.CheckRegistrySettings();

            try
            {
                if (optset == null)
                {
                    sm.AppSettingsObject = new LocalAppSettings();
                    sm.ReadConfig();
                    optset = (LocalAppSettings)sm.AppSettingsObject;
                }

                if (this.parser == null)
                {
                    this.parser         = new ProtocolParser();
                    this.parser.Parsed += new ProtocolParser.OnParsed(parser_Parsed);
                }
                if (this.socketmanager == null)
                {
                    this.socketmanager               = new SocketManager(this.optset.Host, this.optset.Port);
                    this.socketmanager.Connected    += new SocketManager.OnConnected(socketmanager_Connected);
                    this.socketmanager.Disconnected += new SocketManager.OnDisconnected(socketmanager_Disconnected);
                    this.socketmanager.DataArrival  += new SocketManager.OnDataArrival(socketmanager_DataArrival);
                    this.socketmanager.SocketError  += new SocketManager.OnSocketError(socketmanager_SocketError);
                }
                this.noOpTimer          = new System.Windows.Forms.Timer();
                this.noOpTimer.Tick    += new EventHandler(noOpTimer_Tick);
                this.noOpTimer.Interval = this.optset.SocketTimeout;
                this.UpdateOutboundContextes();
                this.txtUsername.Text  = optset.Username;
                this.txtPassword.Text  = optset.Password;
                this.lblExtension.Text = optset.PhoneExt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            this.localizator         = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
            UpdateTooltips();
            this.FormSetFont();
        }
Ejemplo n.º 8
0
        public frmMain()
        {
            InitializeComponent();
            Stream s = this.GetType().Assembly.GetManifestResourceStream("AstCTIClient.mainform.gif");
            Bitmap bmp = new Bitmap(s);
            this.DoubleBuffered = true;
            this.Region = BitmapToRegion.Convert(bmp, bmp.GetPixel(0, 0), TransparencyMode.ColorKeyTransparent);
            this.notifyIcon1.Visible = false;
            this.MouseDown += new MouseEventHandler(frmMain_MouseDown);
            this.notifyIcon1.DoubleClick += new EventHandler(notifyIcon1_DoubleClick);
            this.txtPassword.LostFocus += new EventHandler(txtPassword_LostFocus);
            this.txtUsername.LostFocus += new EventHandler(txtUsername_LostFocus);
            this.txtPhoneNumber.TextChanged += new EventHandler(txtPhoneNumber_TextChanged);
            this.cboOutboundContextes.SelectedIndexChanged += new EventHandler(cboOutboundContextes_SelectedIndexChanged);
            this.socketmanager = null;
            this.parser = null;
            this.protocolStatus = PROTOCOL_STATES.STATUS_UNKNOWN;
            this.lblLineState.Text = "";
            sm = new SettingsManager.SettingsManager();
            this.CheckRegistrySettings();

            try
            {
                if (optset == null)
                {
                    sm.AppSettingsObject = new LocalAppSettings();
                    sm.ReadConfig();
                    optset = (LocalAppSettings)sm.AppSettingsObject;
                }

                if (this.parser == null)
                {
                    this.parser = new ProtocolParser();
                    this.parser.Parsed += new ProtocolParser.OnParsed(parser_Parsed);
                }
                if (this.socketmanager == null)
                {
                    this.socketmanager = new SocketManager(this.optset.Host, this.optset.Port);
                    this.socketmanager.Connected += new SocketManager.OnConnected(socketmanager_Connected);
                    this.socketmanager.Disconnected += new SocketManager.OnDisconnected(socketmanager_Disconnected);
                    this.socketmanager.DataArrival += new SocketManager.OnDataArrival(socketmanager_DataArrival);
                    this.socketmanager.SocketError += new SocketManager.OnSocketError(socketmanager_SocketError);
                }
                this.noOpTimer = new System.Windows.Forms.Timer();
                this.noOpTimer.Tick += new EventHandler(noOpTimer_Tick);
                this.noOpTimer.Interval = this.optset.SocketTimeout;
                this.UpdateOutboundContextes();
                this.txtUsername.Text = optset.Username;
                this.txtPassword.Text = optset.Password;
                this.lblExtension.Text = optset.PhoneExt;
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.ToString());
            }

            this.localizator = new Localizator();
            this.localizator.Culture = this.optset.Language;
            this.localizator.Localize(this);
            UpdateTooltips();
            this.FormSetFont();
        }
Ejemplo n.º 9
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            try
            {

                frmSettings frm = new frmSettings(this.optset);
                DialogResult res = frm.ShowDialog(this);
                sm.AppSettingsObject = frm.Settings;
                sm.WriteConfig();
                sm.ReadConfig();
                this.optset = (LocalAppSettings)sm.AppSettingsObject;
                frm.Dispose();
                this.BringToFront();
                this.txtUsername.Text = optset.Username;
                this.txtPassword.Text = optset.Password;
                this.lblExtension.Text = optset.PhoneExt;

                this.UpdateOutboundContextes();

                this.localizator.Culture = this.optset.Language;
                this.localizator.Localize(this);
                UpdateTooltips();
                this.FormSetFont();

                if (this.noOpTimer != null)
                {
                    this.noOpTimer.Interval = this.optset.SocketTimeout;
                }
                // this should refresh the socketmanager
                if (this.socketmanager != null)
                {
                    this.socketmanager.Host = this.optset.Host;
                    this.socketmanager.Port = this.optset.Port;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }