public FrmUser()
 {
     InitializeComponent();
     _userModel = new UserModel();
     _userModel.Attach(this);
     _userControl = new User_Control(_userModel);
 }
示例#2
0
        public MainWindow(User_Model model, User_Control control)
        {
            InitializeComponent();

            // 实例化baseinfopage
            baseinfopage           = new BaseInfoPage(model, control);
            BaseInofrFrame.Content = baseinfopage;

            //// 实例化configpage
            //configpage = new ConfigPage(model, control);
            //configFrame.Content = configpage;

            // 实例化textoutpage
            textoutpage       = new TextOutPage(model, control);
            EditFrame.Content = textoutpage;

            //// 卫星信噪比
            //sates_signal_strengthpage = new Msshistogram("SateLites Strength" , model, control);
            //SatelliteFrame.Content = sates_signal_strengthpage;

            //// 星位图
            //msimetorsitespage = new MsimeteorSites(model, control);
            //MeteorSitesFrame.Content = msimetorsitespage;

            // 创建线程
            UpdateThread = new Thread(new ThreadStart(UpdateUI_Thread));
            UpdateThread.IsBackground = true;
            UpdateThread.Start();
        }
示例#3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="model">数据模型</param>
        /// <param name="control">控制模型</param>
        public BaseInfoPage(User_Model model, User_Control control)
        {
            InitializeComponent();

            // 设置模型
            mModel = model;
            // 设置控制器
            mControl = control;

            // 加载波特率列表
            combox_baudRate.ItemsSource = mModel.BaudRateArry;
            // 默认为38400的波特率
            combox_baudRate.SelectedIndex = User_Model.BAUDRATEARRY_38400_POS;

            // 初始化列表
            mDataInfoLabelList = new List <Label>();

            // 初始化信息列表
            InitBaseInfoList();

            // 设置默认图标
            btn_connect_com.Content = "Connect";

            // 取得当前可用的串口
            string[] str_availcoms = mModel.GetOnlineComName();

            if (str_availcoms != null)
            {
                commbox_com.ItemsSource = str_availcoms;
                //设置默认选中第一个
                commbox_com.SelectedIndex = 0;
            }
            ;
        }
示例#4
0
        /*-----------------------------------------------------------------------------------
         * PublicFuc
         * -------------------------------------------------------------------------------------*/
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="strTitle">标题</param>
        /// <param name="list">待绘制的数据源</param>
        public Msshistogram(string title, User_Model model, User_Control control)
        {
            InitializeComponent();

            strTitle = title;
            mControl = control;
            mModel   = model;

            mDataList = mModel.MCustomDataModel.SateLiteInfoList;
            Panel_Init();
        }
示例#5
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (User_Control.editUser(frmAdministration.selectedUsernameforEdit, tbUsername.Text, tbNames.Text, tbPassword.Text, comboboxAdmin.SelectedItem.ToString()) == true)
     {
         MessageBox.Show("User successfuly changed, please click refresh!");
         this.Close();
     }
     else
     {
         MessageBox.Show("Username already exists!");
     }
 }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="model">用户模型</param>
        public MsimeteorSites(User_Model model, User_Control control)
        {
            InitializeComponent();

            // 设置模型和控制器
            mControl = control;
            mModel   = model;

            // 设置数据源
            mDataList = mModel.MCustomDataModel.SateLiteInfoList;

            // 初始化布局
            Panel_Init();
        }
示例#7
0
        /// <summary>
        /// 构造函数,程序启动入口
        /// </summary>
        public App()
        {
            // 初始化数据模型
            mModel = new User_Model();

            // 初始化控制器
            mControl = new User_Control(mModel);

            // 初始化界面
            mMainWindow = new MainWindow(mModel, mControl);

            // 添加控制器委托
            mControl.User_Control_Event += mControlEventDeal;

            // 显示窗口
            mMainWindow.Show();
        }
示例#8
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="control">控制模型</param>
        /// <param name="mode">数据模型</param>
        public ConfigPage(User_Model mode, User_Control control)
        {
            InitializeComponent();
            // 设置模型
            mModel = mode;
            // 设置控制器
            mControl = control;

            // 初始化mButton列表
            mButtonList[CustomDataModel.GPS_REV_STATE_GP_AVAILABLE]  = ControlGP;
            mButtonList[CustomDataModel.GPS_REV_STATE_GB_AVAILABLE]  = ControlGB;
            mButtonList[CustomDataModel.GPS_REV_STATE_GGA_AVAILABLE] = ControlGGA;
            mButtonList[CustomDataModel.GPS_REV_STATE_RMC_AVAILABLE] = ControlRMC;
            mButtonList[CustomDataModel.GPS_REV_STATE_GAS_AVAILABLE] = ControlGAS;
            mButtonList[CustomDataModel.GPS_REV_STATE_GSV_AVAILABLE] = ControlGSV;
            mButtonList[MBUTTON_NUM_MAX - 1] = ControlDebug;
        }
示例#9
0
        private void tsDelete_Click(object sender, EventArgs e)
        {
            if (listboxUsers.SelectedIndex != -1)
            {
                DialogResult deleteOK = MessageBox.Show("Are you sure you want to delete selected record?", "Warning", MessageBoxButtons.YesNo);
                if (deleteOK == DialogResult.Yes)
                {
                    if (User_Control.DeleteUser(listboxUsers.SelectedItem.ToString()) == true)
                    {
                        MessageBox.Show("User successfuly deleted!");
                    }
                }
            }
            else
            {
                MessageBox.Show("Please select username!");
            }

            RefreshUsers();
        }
示例#10
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="control"></param>
 /// <param name="model"></param>
 public TextOutPage(User_Model model, User_Control control)
 {
     InitializeComponent();
     mControl = control;
     mModel   = model;
 }