Example #1
0
        private async void fileView_CellDoubleClick(object sender, GridCellMouseEventArgs e)
        {
            if (e.Item == null)
            {
                return;
            }

            await OpenSelectedFiles();
        }
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            User cmcsUser = Dbers.GetInstance().SelfDber.Get <User>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            if (cmcsUser != null)
            {
                this.CurrUser = cmcsUser;
                BindDataRes();
            }
        }
        private void superGridControl2_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            SysModule sysModule = Dbers.GetInstance().SelfDber.Get <SysModule>(superGridControl2.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl2.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            if (sysModule != null)
            {
                this.CurrSysModule = sysModule;
                BindDataRes();
            }
        }
 private void MainGrid_CellDoubleClick(object sender, GridCellMouseEventArgs e)
 {
     if (ViewModel.Items.Count > 0)
     {
         if (ViewModel.SelectedItem != null)
         {
             ViewModel.Load(ViewModel.SelectedItem.FullPath);
         }
     }
 }
Example #5
0
 private void M_gv_CellClick(object sender, GridCellMouseEventArgs e)
 {
     if (e.Row > -1)
     {
         if (e.Item is DeviceItem i)
         {
             i.Selected = !i.Selected;
         }
     }
 }
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            if (e.GridCell.GridRow.Index == -1)
            {
                return;
            }
            e.GridCell.GridRow.IsSelected = true;
            SuperGridControl supergridcontrol = (SuperGridControl)sender;

            Id = supergridcontrol.GetCell(e.GridCell.GridRow.RowIndex, 11).Value.ToString();
        }
Example #7
0
        private void GridView_CellDoubleClick(object sender, GridCellMouseEventArgs e)
        {
            var gridView = (GridView)sender;

            if (gridView.SelectedItem == null)
            {
                return;
            }

            Close(((ChoosePluginElement)gridView.SelectedItem).Plugin);
        }
Example #8
0
 private void CellClickHandler(object sender, GridCellMouseEventArgs e)
 {
     if (e.Column == 1)
     {
         ToggleSelectedStatus(e.Item as TreeGridItem);
     }
     else if (e.Column == 5)
     {
         OpenWikiLink(e.Item as TreeGridItem);
     }
 }
Example #9
0
        public override void OnMouseDown(GridCellMouseEventArgs args, sw.DependencyObject hitTestResult, swc.DataGridCell cell)
        {
            if (cell?.IsEditing == true && !hitTestResult.GetVisualParents().TakeWhile(r => !(r is swc.DataGridCell)).OfType <swc.TextBox>().Any())
            {
                // commit editing when clicking on anything other than the text box
                ContainerHandler?.Grid.CommitEdit();
                args.Handled = true;
            }

            base.OnMouseDown(args, hitTestResult, cell);
        }
        private void superGridControl2_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            SysResource entity = Dbers.GetInstance().SelfDber.Get <SysResource>(superGridControl2.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl2.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            switch (superGridControl2.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            {
            case "clmEdit":
                Frm_Resource_Oper frmEdit = new Frm_Resource_Oper(entity);
                frmEdit.ShowDialog();
                BindData();
                break;
            }
        }
 void GrdFolder_CellDoubleClick(object sender, GridCellMouseEventArgs e)
 {
     if (e.Item != null)
     {
         if (e.Item is IParent)
         {
             this.Browser.SelectedFolder = (IParent)e.Item;
         }
         else if (e.Item is FileEntry)
         {
             this.Browser.TempFileManager.ViewFile((FileEntry)e.Item);
         }
     }
 }
Example #12
0
        public override void OnMouseUp(GridCellMouseEventArgs args, DependencyObject hitTestResult, DataGridCell cell)
        {
            // check/uncheck right away, otherwise it takes three clicks to change the value..
            if (!cell.IsReadOnly)
            {
                var checkBox = hitTestResult.GetVisualParents().TakeWhile(r => !(r is swc.DataGridCell)).OfType <swc.CheckBox>().FirstOrDefault();
                if (checkBox != null)
                {
                    var value = checkBox.IsChecked ?? false;
                    checkBox.IsChecked = !value;

                    args.Handled = true;
                }
            }
            base.OnMouseUp(args, hitTestResult, cell);
        }
Example #13
0
        private void On_CellClick(object sender, GridCellMouseEventArgs e)
        {
            // test if color
            if (e.GridColumn is null)
            {
                return;
            }
            if (e.GridColumn.HeaderText == "Color")
            {
                var model = e.Item as ParticleConduitModel;

                // Native
                var color = model.Color;
                Dialogs.ShowColorDialog(ref color);
                model.Color = color;

                // Eto
                // TODO: implement
            }

            // test if image
            if (e.GridColumn.HeaderText == "Image")
            {
                var model = e.Item as ParticleConduitModel;
                // Allow the user to select a bitmap file
                var fd = new Rhino.UI.OpenFileDialog {
                    Filter = "Image Files (*.bmp;*.png;*.jpg)|*.bmp;*.png;*.jpg"
                };
                if (!fd.ShowOpenDialog())
                {
                    return;
                }

                // Verify the file that was selected
                System.Drawing.Image image;
                try
                {
                    image = System.Drawing.Image.FromFile(fd.FileName);
                }
                catch (Exception)
                {
                    return;
                }

                model.Bitmap = new System.Drawing.Bitmap(image);
            }
        }
Example #14
0
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            if (e.GridCell.ColumnIndex == -1 || e.GridCell.GridRow.Index == -1)
            {
                return;
            }

            //CmcsBuyFuelTransport entity = Dbers.GetInstance().SelfDber.Get<CmcsBuyFuelTransport>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());
            //if (entity == null)
            //	return;
            //switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            //{
            //	case "clmPic":
            //		//抓拍图片
            //		break;
            //}
        }
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            if (e.GridCell.ColumnIndex == -1 || e.GridCell.GridRow.Index == -1)
            {
                return;
            }

            SuperGridControl      sgc    = (SuperGridControl)sender;
            CmcsTrainWeightRecord entity = Dbers.GetInstance().SelfDber.Get <CmcsTrainWeightRecord>(sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, 13).Value.ToString());

            if (entity == null)
            {
                return;
            }
            String newid = sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, 13).Value.ToString();

            switch (sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, e.GridCell.ColumnIndex).NullString)
            {
            case "抓拍":
                if (Dbers.GetInstance().SelfDber.Entities <CmcsTrainWatch>(String.Format(" where TrainWeightRecordId='{0}'", newid)).Count > 0)
                {
                    FrmWeightBridgeLoad_Pic frm1 = new FrmWeightBridgeLoad_Pic(newid);
                    if (frm1.ShowDialog() == DialogResult.OK)
                    {
                    }
                }
                else
                {
                }
                break;

            case "装车线":
                if (Dbers.GetInstance().SelfDber.Entities <CmcsTrainLine>(String.Format(" where TrainWeightRecordId='{0}'", newid)).Count > 0)
                {
                    FrmWeightBridgeLoad_Line frm = new FrmWeightBridgeLoad_Line(newid);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                    }
                }
                else
                {
                }
                break;
            }
        }
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            SysModule sysModule = Dbers.GetInstance().SelfDber.Get <SysModule>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            if (sysModule != null)
            {
                this.CurrSysModule = sysModule;
                BindDataRes();
            }

            switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            {
            case "clmEdit":
                Frm_Module_Oper frmEdit = new Frm_Module_Oper(sysModule);
                frmEdit.ShowDialog();
                BindData();
                break;
            }
        }
Example #17
0
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            CmcsUser entity = Dbers.GetInstance().SelfDber.Get <CmcsUser>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            {
            case "clmShow":
                FrmUserInfo_Oper frmShow = new FrmUserInfo_Oper(entity.Id, eEditMode.查看);
                if (frmShow.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmEdit":
                FrmUserInfo_Oper frmEdit = new FrmUserInfo_Oper(entity.Id, eEditMode.修改);
                if (frmEdit.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmDelete":
                // 查询正在使用该供应商的车数
                if (MessageBoxEx.Show("确定要删除该配置信息?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        Dbers.GetInstance().SelfDber.Delete <CmcsUser>(entity.Id);
                    }
                    catch (Exception)
                    {
                        MessageBoxEx.Show("该配置信息正在使用中,禁止删除!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    BindData();
                }
                break;
            }
        }
Example #18
0
 public virtual void OnMouseUp(GridCellMouseEventArgs args, sw.DependencyObject hitTestResult, swc.DataGridCell cell)
 {
 }
Example #19
0
 private void CellDoubleClickHandler(object sender, GridCellMouseEventArgs e)
 {
     ToggleSelectedStatus(e.Item as TreeGridItem);
 }
 private void MainGrid_CellClick(object sender, GridCellMouseEventArgs e)
 {
     //ViewModel.SelectedItem = e.Item as IDataViewModel;
 }
Example #21
0
 /// <summary>
 /// Raises the cell double click event.
 /// </summary>
 public void OnCellDoubleClick(Grid widget, GridCellMouseEventArgs e)
 {
     using (widget.Platform.Context)
         widget.OnCellDoubleClick(e);
 }
Example #22
0
 internal void OnMouseUp(GridCellMouseEventArgs args, sw.DependencyObject hitTestResult, swc.DataGridCell cell)
 {
     DataCellHandler?.OnMouseUp(args, hitTestResult, cell);
 }
Example #23
0
 private void _grid_CellMouseDown(object sender, GridCellMouseEventArgs e)
 {
     HideTooltip();
 }
Example #24
0
 private void grid_CellMouseUp(object sender, GridCellMouseEventArgs e)
 {
     TraceUtil.TraceCurrentMethodInfoIf(traceDebug, this, e);
     AppendOutput("CellMouseUp", e);
 }