コード例 #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();
        }
コード例 #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();
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
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);
        }
コード例 #6
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();
        }
コード例 #7
0
ファイル: frmMain.cs プロジェクト: happy-star/asterisk-cti
        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();
        }