Example #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewColumnConfig cc = null;
            Xdgk.UI.GridViewConfig c = new GridViewConfig();
            c.GridViewColumnConfigCollection.AddBoundField("放水季名称", YongShuiGuanLiDBI.DBNames.tblDuringWater.Name);

            cc = c.GridViewColumnConfigCollection.AddBoundField("开始日期", YongShuiGuanLiDBI.DBNames.tblDuringWater.BeginDT);
            cc.DataFormatString = "{0:MM}-{0:dd}";

            cc = c.GridViewColumnConfigCollection.AddBoundField("结束日期", YongShuiGuanLiDBI.DBNames.tblDuringWater.EndDT );
            cc.DataFormatString = "{0:MM}-{0:dd}";
            return c;
        }
Example #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     // TODO: 2011-6-16
     //
     GridViewConfig c = new GridViewConfig();
     c.GridViewColumnConfigCollection.AddBoundField(strings.WaterUserName, "WaterUserName");
     c.GridViewColumnConfigCollection.AddBoundField(strings.NeedBegin, YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedBeginDT);
     c.GridViewColumnConfigCollection.AddBoundField(strings.NeedEnd, YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedEndDT);
     c.GridViewColumnConfigCollection.AddBoundField(strings.NeedAmount, YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedAmount);
     c.GridViewColumnConfigCollection.AddBoundField(strings.DistributeBegin, YongShuiGuanLiDBI.DBNames.tblDistributeWater.DistributeBeginDT);
     c.GridViewColumnConfigCollection.AddBoundField(strings.DistributeEnd , YongShuiGuanLiDBI.DBNames.tblDistributeWater.DistributeEndDT );
     c.GridViewColumnConfigCollection.AddBoundField(strings.DistributeAmount, YongShuiGuanLiDBI.DBNames.tblDistributeWater.DistributeAmount );
     return c;
 }
Example #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static GridViewConfig CreateNeedDistributeGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();
            //c.GridViewColumnConfigCollection.AddBoundField("", "");

            c.GridViewColumnConfigCollection.AddBoundField(strings.WaterUserName, "WaterUserName");
            c.GridViewColumnConfigCollection.AddBoundField(strings.NeedBegin, "NeedBegin");
            c.GridViewColumnConfigCollection.AddBoundField(strings.NeedEnd, "NeedEnd");
            c.GridViewColumnConfigCollection.AddBoundField(strings.NeedAmount, "NeedAmount");
            c.GridViewColumnConfigCollection.AddBoundField(strings.DistributeAmount, "DistributeAmount");
            c.GridViewColumnConfigCollection.AddBoundField(strings.UsedAmount, "UsedAmount");

            return c;
        }
Example #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();
            c.GridViewColumnConfigCollection.AddBoundField(strings.WaterUserName , "WaterUserName");
            c.GridViewColumnConfigCollection.AddBoundField(strings.NeedBegin, YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedBeginDT);
            c.GridViewColumnConfigCollection.AddBoundField(strings.NeedEnd, YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedEndDT);
            c.GridViewColumnConfigCollection.AddBoundField(strings.NeedAmount, YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedAmount);
            c.GridViewColumnConfigCollection.AddBoundField(strings.Remark, YongShuiGuanLiDBI.DBNames.tblNeedWater.Remark);

            c.GridViewColumnConfigCollection.AddHyperLinkField("", strings.NewDistribute,
                new string[] { YongShuiGuanLiDBI.DBNames.tblNeedWater.NeedWaterID },
                "pDistributeItem.aspx?NeedWaterID={0}");

            return c;
        }
Example #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();

            c.GridViewColumnConfigCollection.AddBoundField(
                "名称", "Name");

            c.GridViewColumnConfigCollection.AddBoundField(
                "时间", "DT");

            c.GridViewColumnConfigCollection.AddBoundField(
                strings.RainFillWithUnit, "RainFill", GridViewColumnFormatString.FloatFormatString);

            return c;
        }
Example #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     string feeFormatString = "{0:f2}";
     GridViewConfig c = new GridViewConfig();
     c.GridViewColumnConfigCollection.AddBoundField(strings.WaterUserName,
         "WaterUserName");
     c.GridViewColumnConfigCollection.AddBoundField("开始时间",
         "Begin");
     c.GridViewColumnConfigCollection.AddBoundField("结束时间",
         "End");
     c.GridViewColumnConfigCollection.AddBoundField("单价",
         "Price", feeFormatString );
     c.GridViewColumnConfigCollection.AddBoundField("水量",
         "UsedAmount");
     c.GridViewColumnConfigCollection.AddBoundField("应缴水费",
         "UsedFee", feeFormatString );
     c.GridViewColumnConfigCollection.AddBoundField("实缴水费",
         "PayedFee", feeFormatString );
     c.GridViewColumnConfigCollection.AddBoundField("欠缴水费",
         "RemaindFee", feeFormatString);
     return c;
 }
Example #7
0
        private void List(GridViewConfig cgv, int io)
        {
            var gvc = new GridViewCamera();
            if (cgv != null)
            {
                gvc.Delay = cgv.Delay;
                gvc.SelectedIDs = cgv.ObjectIDs;
            }
            else
            {
                gvc.SelectedIDs = new List<GridViewItem>();
            }
            if (gvc.ShowDialog(this) == DialogResult.OK)
            {
                foreach (var gvi in gvc.SelectedIDs)
                {
                    gvi.Init(this);
                }
                cgv = gvc.SelectedIDs.Count > 0 ? new GridViewConfig(gvc.SelectedIDs, gvc.Delay) : null;

                if (Cg != null)
                {
                    var gi = Cg.GridItem.FirstOrDefault(p => p.GridIndex == io);
                    if (gi == null)
                    {
                        gi = new configurationGridGridItem { CycleDelay = gvc.Delay, GridIndex = io };
                        var lgi = Cg.GridItem.ToList();
                        lgi.Add(gi);
                        Cg.GridItem = lgi.ToArray();
                    }

                    gi.CycleDelay = gvc.Delay;

                    gi.Item = gvc.SelectedIDs.Select(i => new configurationGridGridItemItem {ObjectID = i.ObjectID, TypeID = i.TypeID}).ToArray();
                }
                _controls[io] = cgv;
                Invalidate();
            }
        }
Example #8
0
        void TmrUpdateLayoutElapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            lock(_objlock)
            {
                int del = 10;
                bool sr = false;
                if (!String.IsNullOrEmpty(Cg.ModeConfig))
                {
                    var cfg = Cg.ModeConfig.Split(',');
                    if (cfg.Length > 0)
                    {
                        del = Convert.ToInt32(cfg[0]);
                        if (cfg.Length >= 4)
                        {
                            Boolean.TryParse(cfg[3], out sr);
                        }
                    }
                }
                int i;
                for(int k=0;k<_controls.Count;k++)
                {
                    var c = _controls[k];
                    if (c == null || c.Hold) continue;
                    _controls[k].ObjectIDs[0].DeInit();
                    _controls[k] = null;
                }

                foreach(var cam in MainForm.Cameras)
                {
                    var ctrl = MainClass.GetCameraWindow(cam.id);

                    bool add = (Cg.ModeIndex == 1 && ctrl.LastMovementDetected > Helper.Now.AddSeconds(0 - del)) || (Cg.ModeIndex == 2 && ctrl.LastAlerted > Helper.Now.AddSeconds(0 - del));

                    if (add)
                    {
                        foreach (var c in _controls)
                        {
                            if (c != null && c.ObjectIDs.Any(o => o.ObjectID == cam.id && o.TypeID == 2))
                            {
                                add = false;
                            }
                        }
                        if (add)
                        {
                            i = 0;
                            while (_controls[i] != null && i < _maxItems)
                                i++;
                            if (i == _maxItems)
                                break;
                            _controls[i] = new GridViewConfig(new List<GridViewItem> { new GridViewItem("", cam.id, 2,this) }, 1000);

                        }
                    }
                }

                foreach (var mic in MainForm.Microphones)
                {
                    var ctrl = MainClass.GetVolumeLevel(mic.id);
                    //only want to display mics without associated camera controls
                    if (ctrl.CameraControl == null)
                    {

                        bool add = (Cg.ModeIndex == 1 && ctrl.LastSoundDetected > Helper.Now.AddSeconds(0 - del)) ||
                                    (Cg.ModeIndex == 2 && ctrl.LastAlerted > Helper.Now.AddSeconds(0 - del));
                        if (add)
                        {
                            foreach (var c in _controls)
                            {
                                if (c!=null && c.ObjectIDs.Any(o => o.ObjectID == mic.id && o.TypeID == 1))
                                {
                                    add = false;
                                }
                            }
                            if (add)
                            {
                                i = 0;
                                while (_controls[i] != null && i < _maxItems)
                                    i++;
                                if (i == _maxItems)
                                    break;
                                _controls[i] = new GridViewConfig(new List<GridViewItem> { new GridViewItem("", mic.id, 1, this) },1000);
                            }
                        }
                    }
                }

                i = _controls.Count(p => p != null);
                if (i == 0)
                {
                    _cols = 1;
                    _rows = 1;
                }
                else
                {
                    _cols = (int) Math.Sqrt(i);
                    _rows = (int) Math.Ceiling(i/(float) _cols);
                    if (sr)
                    {
                        if (_lastRestored < DateTime.UtcNow.AddSeconds(-5))
                        {
                            _lastRestored = DateTime.UtcNow;
                            _owner.ShowForm();
                        }
                    }
                }
            }
        }
Example #9
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="gv"></param>
 /// <param name="dataSource"></param>
 /// <param name="cfg"></param>
 private void ReBindGridViewDataSource(GridView gv, object dataSource, GridViewConfig cfg)
 {
     gv.Columns.Clear();
     Xdgk.UI.GridViewHelper h = new Xdgk.UI.GridViewHelper(gv);
     h.GridViewConfig = cfg;
     h.DataSource = dataSource;
     h.Bind();
 }
Example #10
0
        //#region H
        ///// <summary>
        /////
        ///// 
        ///// </summary>
        //private Xdgk.UI.GridViewHelper H
        //{
        //    get
        //    {
        //        if (_h == null)
        //        {
        //            _h = new Xdgk.UI.GridViewHelper(this.GridView1);
        //            if (!_h.IsSetGridViewConfig())
        //            {
        //                _h.GridViewConfig = GetGridViewConfig();
        //            }
        //        }
        //        return _h;
        //    }
        //} Xdgk.UI.GridViewHelper _h;
        //#endregion //H
        //#region GetGridViewConfig
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <returns></returns>
        //private GridViewConfig GetGridViewConfig()
        //{
        //    GridViewConfig c = new GridViewConfig();
        //    return c;
        //}
        //#endregion //GetGridViewConfig
        /// <summary>
        /// 
        /// </summary>
        /// <param name="tbl"></param>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig(DataTable tbl)
        {
            GridViewConfig cfg = new GridViewConfig();
            GridViewColumnConfig colCfg = cfg.GridViewColumnConfigCollection.AddBoundField(strings.DT, "DT");
            colCfg.DataFormatString = "{0:yyyy-MM-dd}";

            for (int i = 1; i < tbl.Columns.Count; i++)
            {
                DataColumn col = tbl.Columns[i];
                cfg.GridViewColumnConfigCollection.AddBoundField(col.ColumnName, col.ColumnName);
            }

            return cfg;
        }
Example #11
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig cfg = new GridViewConfig();
            cfg.AllowSorting = true;
            cfg.Caption = "Amount caption";

            //GridViewColumnConfig c1 = new GridViewColumnConfig();
            //c1.DataTextField = "Amount";
            //c1.HeaderText = "h-Amount";
            //c1.SortExpression = "Amount";
            //c1.GridViewColumnTypeEnum = GridViewColumnTypeEnum.BoundField;
            cfg.GridViewColumnConfigCollection.AddBoundField("a", "Amount");

            GridViewColumnConfig c2 = new GridViewColumnConfig();
            c2.DataTextField = "WaterUserName";
            c2.HeaderText = "名称";
            c2.SortExpression = "WaterUserName";
            cfg.GridViewColumnConfigCollection.Add(c2);

            return cfg;
        }
Example #12
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig(DataEnum de, DataTable dataSourceDataTable)
        {
            if( dataSourceDataTable == null )
            {
                throw new ArgumentNullException ("dataSourceDataTable");
            }

            GridViewConfig c = new GridViewConfig();
            c.GridViewColumnConfigCollection.AddBoundField(strings.ChannelName, "ChannelName");
            c.GridViewColumnConfigCollection.AddBoundField(strings.StationName, "StationName");
            c.GridViewColumnConfigCollection.AddBoundField(strings.DT , "DT");
            string t = string.Empty;
            switch (de)
            {
                case DataEnum.WL:
                    t = DataTableHelper.GetExistColumnName(dataSourceDataTable, "WL1", "AVGWL");
                    c.GridViewColumnConfigCollection.AddBoundField(strings.WLWithUnit , t);
                    break;

                case DataEnum.Flux:
                    t =  DataTableHelper.GetExistColumnName(dataSourceDataTable, "InstantFlux", "avgflux");
                    //c.GridViewColumnConfigCollection.AddBoundField(strings.InstantFlux , "InstantFlux");
                    GridViewColumnConfig columnConfig = c.GridViewColumnConfigCollection.AddBoundField(
                        strings.InstantFluxWithUnit, t, FormatStringManager.FloatValueFormatString);
                    break;

                case DataEnum.Amount:
                    t = DataTableHelper.GetExistColumnName(dataSourceDataTable, "DayAmount");
                    c.GridViewColumnConfigCollection.AddBoundField(strings.AmountWithUnit, t,
                        FormatStringManager.FloatValueFormatString);
                    break;
            }
            //
            //
            c.AllowSorting = true;
            return c;
        }
Example #13
0
 private GridViewConfig GetGridViewConfig()
 {
     GridViewConfig c = new GridViewConfig();
     c.GridViewColumnConfigCollection.AddBoundField("名称" ,"StationName");
     c.GridViewColumnConfigCollection.AddBoundField("开始时间", "BeginDT");
     c.GridViewColumnConfigCollection.AddBoundField("结束时间", "EndDT");
     c.GridViewColumnConfigCollection.AddBoundField("用水量", "UsedAmount");
     return c;
 }
Example #14
0
        private void GetInfoByLocation(Point p, out GridViewConfig cgv, out int bpi, out int io)
        {
            var row = -1;
            var col = -1;
            var x = p.X;
            var y = p.Y;
            io = 0;

            cgv = null;
            if (_maximised != null)
            {
                cgv = _maximised;
                row = 0;
                col = 0;
                int j = 0;
                foreach (var obj in _controls)
                {
                    if (obj != null && obj.Equals(cgv))
                    {
                        io = j;
                        break;
                    }
                    j++;
                }
            }
            else
            {

                for (var i = 1; i <= _cols; i++)
                {
                    if (i * (_itemwidth + Itempadding) - Itempadding / 2 > x)
                    {
                        col = i - 1;
                        break;
                    }
                }
                for (var i = 1; i <= _rows; i++)
                {
                    if (i * (_itemheight + Itempadding) - Itempadding / 2 > y)
                    {
                        row = i - 1;
                        break;
                    }
                }

                if (row != -1 && col != -1)
                {
                    cgv = _controls[row * _cols + col];
                    io = row * _cols + col;
                }

            }

            int rx = col * (_itemwidth + Itempadding);
            int ry = row * (_itemheight + Itempadding);

            int ox = x - rx;
            int oy = (ry + _itemheight) - y - 20;

            bpi = GetButtonIndexByLocation(new Point(ox, oy));
        }
Example #15
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetViewConfig()
 {
     Xdgk.UI.GridViewConfig c = new GridViewConfig();
     c.Width = 600;
     c.GridViewColumnConfigCollection.AddBoundField("站名", YongShuiGuanLiDBI.DBNames.vStationDevice.StationName );
     c.GridViewColumnConfigCollection.AddBoundField("类型", YongShuiGuanLiDBI.DBNames.vStationDevice.DeviceType);
     return c;
 }
Example #16
0
        private Rectangle GetButtonByIndex(int buttonIndex, ISpyControl ctrl, int modeIndex, GridViewConfig gvc, out Rectangle destRect)
        {
            Rectangle rSrc = Rectangle.Empty;
            bool b = ctrl!=null && ctrl.IsEnabled;
            switch (buttonIndex)
            {
                case 0:
                    rSrc = (modeIndex == 0) ? MainForm.RAdd : MainForm.RAddOff;
                    break;
                case 1:
                    rSrc = gvc.Hold ? MainForm.RHoldOn : MainForm.RHold;
                    break;
                case 2:
                    rSrc = (gvc.ObjectIDs.Count > 1) ? MainForm.RNext : MainForm.RNextOff;
                    break;
                case 5://settings
                    rSrc = MainForm.REdit;
                    break;
                case 6://web
                    rSrc = Helper.HasFeature(Enums.Features.Access_Media) ? MainForm.RWeb : MainForm.RWebOff;
                    break;
            }
            if (ctrl != null)
            {
                switch (buttonIndex)
                {
                    case 3: //power
                        rSrc = ctrl.CanEnable ? (b ? MainForm.RPowerOn : MainForm.RPower) : MainForm.RPowerOff;
                        break;
                    case 4: //record
                        rSrc = (ctrl.CanRecord && b)
                            ? (ctrl.Recording ? MainForm.RRecordOn : MainForm.RRecord)
                            : MainForm.RRecordOff;
                        break;
                    case 7: //grab
                        rSrc = (ctrl.CanGrab && b) ? MainForm.RGrab : MainForm.RGrabOff;
                        break;
                    case 8: //talk
                        rSrc = (ctrl.CanTalk && b) ? (ctrl.Talking ? MainForm.RTalkOn : MainForm.RTalk) : MainForm.RTalkOff;
                        break;
                    case 9: //listen
                        rSrc = (ctrl.CanListen && b)
                            ? (ctrl.Listening ? MainForm.RListenOn : MainForm.RListen)
                            : MainForm.RListenOff;
                        break;
                    case 10: //files
                        rSrc = ctrl.HasFiles ? MainForm.RFolder : MainForm.RFolderOff;
                        break;

                }
            }
            if (MainForm.Conf.BigButtons)
            {
                rSrc.X -= 2;
                rSrc.Width += 8;
                rSrc.Height += 8;
            }

            var bp = ButtonPanel;
            destRect = new Rectangle(bp.X + buttonIndex * (bp.Width/ButtonCount) + 5, Height - 25 - rSrc.Height - 6, rSrc.Width, rSrc.Height);
            return rSrc;
        }
Example #17
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private Xdgk.UI.GridViewConfig GetGridViewConfig()
        {
            GridViewConfig cfg = new GridViewConfig();
            cfg.Caption = "cap";
            cfg.GridViewColumnConfigCollection.AddBoundField(strings.StationName, YongShuiGuanLiDBI.DBNames.vDitchDataDay.StationName);
            cfg.GridViewColumnConfigCollection.AddBoundField(strings.DT, YongShuiGuanLiDBI.DBNames.vDitchDataDay.DT);

            cfg.GridViewColumnConfigCollection.AddBoundField(
                GetGridViewColumnNameByDataEnum (),
                GetWLOrAmountNameByDataEnum());
            //cfg.AllowPaging = true;
            //cfg.PageSize = 40;
            cfg.Width = this.GetGridViewWidth();

            return cfg;
        }
Example #18
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();
            c.Width = 400;

            c.GridViewColumnConfigCollection.AddEditDeleteCommandField("");
            c.GridViewColumnConfigCollection.AddBoundField("开始时间",
                "BeginString");
            c.GridViewColumnConfigCollection.AddBoundField("结束时间",
                "EndString");
            c.GridViewColumnConfigCollection.AddBoundField("流量公式",
                "FormulaString");

            return c;
        }
Example #19
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     GridViewConfig c = new GridViewConfig();
     c.Width = 400;
     c.GridViewColumnConfigCollection.AddBoundField("用户名", YongShuiGuanLiDBI.DBNames.tb_User.Name );
     c.GridViewColumnConfigCollection.AddBoundField("相关单位", "WaterUserName");
     //c.GridViewColumnConfigCollection.add
     c.GridViewColumnConfigCollection.AddHyperLinkField("", "编辑",
         new string[]{"UserID"},
         "pLoginItem.aspx?UserID={0}");
     return c;
 }
Example #20
0
        protected override void OnMouseDoubleClick(MouseEventArgs e)
        {
            if (_maximised!=null)
            {
                _maximised = null;
                return;
            }

            var row = -1;
            var col = -1;
            var x = e.Location.X;
            var y = e.Location.Y;

            for (var i = 1; i <= _cols; i++)
            {
                if (i * (_itemwidth + Itempadding) - Itempadding / 2 > x)
                {
                    col = i - 1;
                    break;
                }
            }
            for (var i = 1; i <= _rows; i++)
            {
                if (i * (_itemheight + Itempadding) - Itempadding / 2 > y)
                {
                    row = i - 1;
                    break;
                }
            }

            if (row != -1 && col != -1)
            {
                var io = row * _cols + col;
                int ry = row * (_itemheight + Itempadding);

                if ((ry + _itemheight) - y > 38)
                {
                    //only maximise if clicking above buttons
                    if (_controls[io].CurrentIndex > -1)
                        _maximised = _controls[io];
                }

            }
        }
Example #21
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();
            //c.GridViewColumnConfigCollection.AddBoundField("", "");
            c.AutoGenerateColumns = false;
            c.GridViewColumnConfigCollection.AddBoundField("日期", "Day");
            for (int i = 1; i <= 12; i++)
            {
                string f = string.Format("m{0}", i);
                string h = string.Format("{0}月", i);

                c.GridViewColumnConfigCollection.AddBoundField(h, f);
            }

            return c;
        }
Example #22
0
        private void DrawButton(Graphics gCam, int buttonIndex, ISpyControl ctrl, int modeIndex, GridViewConfig gvc, int x, int y)
        {
            Rectangle rDest;
            Rectangle rSrc = GetButtonByIndex(buttonIndex, ctrl, modeIndex, gvc, out rDest);

            if (rDest.X + rDest.Width < _itemwidth)
            {
                rDest.X = x + rDest.X;
                rDest.Y = y + 4;

                gCam.DrawImage(MainForm.Conf.BigButtons ? Properties.Resources.icons_big : Properties.Resources.icons,
                    rDest, rSrc, GraphicsUnit.Pixel);
            }
        }
Example #23
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();

            return c;
        }
Example #24
0
        public void Init()
        {
            if (_tmrUpdateList != null)
            {
                _tmrUpdateList.Elapsed -= TmrUpdateLayoutElapsed;
                _tmrUpdateList.Stop();
                _tmrUpdateList.Dispose();
                _tmrUpdateList = null;
            }

            _maxItems = 36;

            Text = Cg.name;
            _controls = new List<GridViewConfig>();
            switch (Cg.ModeIndex)
            {
                case 0:

                    _cols = Cg.Columns;
                    _rows = Cg.Rows;

                    _maxItems = _cols*_rows;
                    ClearControls();
                    AddItems();
                    break;
                case 1:
                case 2:
                    _cols = _rows = 1;

                    if (!String.IsNullOrEmpty(Cg.ModeConfig))
                    {
                        //add default camera
                        string[] cfg = Cg.ModeConfig.Split(',');
                        if (cfg.Length > 1)
                        {
                            if (cfg[1] != "")
                            {
                                var gvi = new GridViewItem("", Convert.ToInt32(cfg[1]), 2, this);
                                _controls[0] =
                                    new GridViewConfig(
                                        new List<GridViewItem> { gvi  }, 1000) {Hold = true};
                            }
                            if (cfg.Length > 2)
                            {
                                _maxItems = Convert.ToInt32(cfg[2]);
                            }
                        }

                    }
                    ClearControls();
                    _tmrUpdateList = new Timer(1000);
                    _tmrUpdateList.Elapsed += TmrUpdateLayoutElapsed;
                    _tmrUpdateList.Start();
                    break;
            }

            Program.AppIdle.ApplicationLoopDoWork += HandlerApplicationLoopDoWork;
        }
Example #25
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     GridViewConfig c = new GridViewConfig();
     c.AutoGenerateColumns = false;
     c.GridViewColumnConfigCollection.AddBoundField("站名", "StationName");
     c.GridViewColumnConfigCollection.AddBoundField("时间", "DT");
     c.GridViewColumnConfigCollection.AddBoundField(strings.GateHeightWithUnit, "height");
     c.GridViewColumnConfigCollection.AddBoundField(strings.GateBeforeWLWithUnit , "beforeWL");
     c.GridViewColumnConfigCollection.AddBoundField(strings.GateBehindWLWithUnit , "BehindWL");
     return c;
 }
Example #26
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private GridViewConfig GetGridViewConfig()
        {
            GridViewConfig c = new GridViewConfig();
            c.GridViewColumnConfigCollection.AddBoundField(strings.ChannelName,
                "ChannelName");
            c.GridViewColumnConfigCollection.AddBoundField(strings.StationName,
                "StationName");
            c.GridViewColumnConfigCollection.AddBoundField("修改时间",
                "ChangeDT");
            c.GridViewColumnConfigCollection.AddBoundField(strings.DT,
                "DT");
            c.GridViewColumnConfigCollection.AddBoundField("原值",
                "OldWL");
            c.GridViewColumnConfigCollection.AddBoundField("修改值",
                "NewWL");
            c.GridViewColumnConfigCollection.AddBoundField("修改人",
                "LoginName");

            return c;
        }
Example #27
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     GridViewConfig c = new GridViewConfig();
     c.GridViewColumnConfigCollection.AddBoundField(strings.StationName, YongShuiGuanLiDBI.DBNames.vDitchDataDay.StationName);
     c.GridViewColumnConfigCollection.AddBoundField(strings.DT, YongShuiGuanLiDBI.DBNames.vDitchDataDay.DT);
     c.GridViewColumnConfigCollection.AddBoundField(strings.Amount, YongShuiGuanLiDBI.DBNames.vDitchDataDay.DayAmount);
     return c;
 }
Example #28
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     GridViewConfig c = new GridViewConfig();
     c.AutoGenerateColumns = false;
     return c;
 }
Example #29
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private GridViewConfig GetGridViewConfig()
 {
     GridViewConfig c = new GridViewConfig();
     c.AllowSorting = true;
     c.GridViewColumnConfigCollection.AddBoundField(strings.StationName, "StationName");
     c.GridViewColumnConfigCollection.AddBoundField("开始时间", "BeginDT");
     c.GridViewColumnConfigCollection.AddBoundField("结束时间", "EndDT");
     c.GridViewColumnConfigCollection.AddBoundField(strings.AmountWithUnit, "UsedAmount");
     return c;
 }