示例#1
0
        void BTN_OpenProject_Click(object sender, EventArgs e)
        {
            PublicControls.SelectForm <Model.Project> form = new PublicControls.SelectForm <Model.Project>();
            List <Model.Project> list = Model.DataHelper.GetAllObject <Model.Project>();

            form.SetList <Model.Project>(list);
            if (form.ShowDialog() == DialogResult.OK)
            {
                Model.Project project = form.SelectedObject;
                this.CurrentProject = project;
                UpdateUI();
            }
        }
示例#2
0
        private void InitRows <T2>(IList <T2> list) where T2 : Model.BaseObject
        {
            PropertyInfo[] pis = typeof(T2).GetProperties();
            if (list != null && list.Count != 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    string[] values = SelectForm <T2> .GetAllValue <T2>(list[i]);

                    ListViewItem item = new ListViewItem(values);
                    item.Tag = list[i].Id;
                    LV_Main.Items.Add(item);
                }
            }
        }
示例#3
0
        void BTN_CurveEdit_Click(object sender, EventArgs e)
        {
            //NavigateTo<LoggingDataManager.RTL.>();
            PublicControls.SelectForm <Model.Curve> form = new PublicControls.SelectForm <Model.Curve>();
            form.TitleText = "选择曲线";
            List <Model.Curve> curveList = Model.DataHelper.GetAllObject <Model.Curve>();

            form.SetList <Model.Curve>(curveList);
            if (form.ShowDialog() == DialogResult.OK)
            {
                Model.Curve curve = form.SelectedObject;
                LoggingDataManager.RTL.GraphEditor panel = NavigateTo <LoggingDataManager.RTL.GraphEditor>();
                panel.SetCurve(curve);
                UpdateUI();
            }
        }
示例#4
0
        public void SetList <T1>(List <T1> list) where T1 : Model.BaseObject
        {
            listViewEx1.Items.Clear();
            listViewEx1.Columns.Clear();

            System.Reflection.PropertyInfo[] pis = typeof(T1).GetProperties();
            for (int i = 0; i < pis.Length; i++)
            {
                listViewEx1.Columns.Add(Model.BaseObject.GetRealName(pis[i]));
            }

            if (list != null && list.Count != 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    string[] values = SelectForm <T1> .GetAllValue <T1>(list[i]);

                    ListViewItem item = new ListViewItem(values);
                    item.Tag = list[i].Id;
                    listViewEx1.Items.Add(item);
                }
            }
        }