Example #1
0
        public Toolbar()
        {
            m_connected     = true;
            m_callStatusDlg = null;
            InitializeComponent();


            //
            // signal
            //
            this.signal                   = new SignalLevelCtrl();
            this.signal.BackColor         = System.Drawing.Color.Transparent;
            this.signal.Location          = new System.Drawing.Point(24, 8);
            this.signal.Name              = "signal";
            this.signal.Size              = new System.Drawing.Size(35, 14);
            this.signal.TabIndex          = 7;
            this.signal.TabStop           = false;
            this.signal.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Toolbar_MouseDoubleClick);
            this.signal.MouseDown        += new System.Windows.Forms.MouseEventHandler(this.Toolbar_MouseDown);
            this.Controls.Add(this.signal);


            //
            // battery
            //
            this.battery                   = new BatteryLevelCtrl();
            this.battery.BackColor         = System.Drawing.Color.Transparent;
            this.battery.Location          = new System.Drawing.Point(20, 26);
            this.battery.Name              = "battery";
            this.battery.Size              = new System.Drawing.Size(43, 14);
            this.battery.TabIndex          = 6;
            this.battery.TabStop           = false;
            this.battery.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Toolbar_MouseDoubleClick);
            this.battery.MouseDownEvent   += new System.Windows.Forms.MouseEventHandler(this.Toolbar_MouseDown);
            this.Controls.Add(this.battery);

            Opacity = ApplicationSettings.Instance.ToolbarOpacity / 100d;

            Device.Instance.BluetoothConnectEvent    += new BluetoothConnectEventHandler(BlackBerry_BluetoothConnectEvent);
            Device.Instance.BluetoothDisconnectEvent += new BluetoothDisconnectEventHandler(BlackBerry_BluetoothDisconnectEvent);
            Device.Instance.MsgArrivedEvent          += new MsgArrivedEventHandler(BlackBerry_MsgArrivedEvent);
        }
Example #2
0
        public MainScreen()
        {
            /*
             * string[] args = Environment.GetCommandLineArgs();
             * if ( args.Length > 1 )
             * {
             * MessageBox.Show(args[1]);
             * this.Close();
             * return;
             * }
             * */



            this.displayQue = new List <IDisplayItem>();

            m_autoConnecting = false;
            m_pauseMsgs      = false;
            m_clipBoardData  = "";

            Device.Instance.BluetoothConnectEvent    += new BluetoothConnectEventHandler(OnBlackBerryConnectEvent);
            Device.Instance.BluetoothDisconnectEvent += new BluetoothDisconnectEventHandler(OnBlackBerryDisconnectEvent);
            Device.Instance.MsgArrivedEvent          += new MsgArrivedEventHandler(Instance_MsgArrivedEvent);

            m_toolbar = new Toolbar();
            Boolean toolBarVisable = ApplicationSettings.Instance.ToolBar.Visable;

            m_toolbar.showToolbar();
            if (!toolBarVisable)
            {
                m_toolbar.hideToolbar();
            }
            m_scriptControl = null;

            if (ApplicationSettings.Instance.EnableScript)
            {
                try
                {
                    m_scriptControl = new ScriptControlClass();
                    if (m_scriptControl != null)
                    {
                        m_scriptControl.Language = ApplicationSettings.Instance.ScriptLanguage;
                        m_scriptControl.AddObject("AlertWindow", this, true);
                        m_scriptControl.AddObject("BlackBerry", Device.Instance, true);
                    }
                    else
                    {
                        MessageBox.Show("Microsoft Scripting control is not installed.", "Blurts", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Microsoft Scripting control is not installed.", "Blurts", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            // setup file extension support

            /*
             * Registry.ClassesRoot.CreateSubKey(".blurts").SetValue("", "Blurts", Microsoft.Win32.RegistryValueKind.String);
             * Registry.ClassesRoot.CreateSubKey(@"Blurts\shell\open\command").SetValue("", Application.ExecutablePath + " \"%l\" ", Microsoft.Win32.RegistryValueKind.String);
             */



            if (!Directory.Exists(ApplicationSettings.Instance.LocalDataPath + @"\SMS"))
            {
                Directory.CreateDirectory(ApplicationSettings.Instance.LocalDataPath + @"\SMS");
            }

            HotKeysManager.Instance.SetHotKeys();



            InitializeComponent();


            //
            // signal
            //
            this.signal           = new SignalLevelCtrl();
            this.signal.BackColor = System.Drawing.Color.Transparent;
            this.signal.Location  = new System.Drawing.Point(440, 14);
            this.signal.Name      = "signal";
            this.signal.Size      = new System.Drawing.Size(35, 14);
            this.signal.TabIndex  = 9;
            this.signal.TabStop   = false;
            this.Controls.Add(this.signal);

            //
            // battery
            //
            this.battery           = new BatteryLevelCtrl();
            this.battery.BackColor = System.Drawing.Color.Transparent;
            this.battery.Location  = new System.Drawing.Point(436, 34);
            this.battery.Name      = "battery";
            this.battery.Size      = new System.Drawing.Size(43, 14);
            this.battery.TabIndex  = 8;
            this.battery.TabStop   = false;
            this.Controls.Add(this.battery);

            MainScreen_Resize(null, null);


            notifyIcon.Text = Application.ProductName + " - MLH Software";
        }