예제 #1
0
        private void objectListView1_ButtonClick(object sender, CellClickEventArgs e)
        {
            // "More" button
            if (e.ColumnIndex == moreInfoColumn.Index)
            {
                if (detailedView == null || detailedView.IsDisposed || detailedView.Disposing)
                {
                    detailedView = new DetailedViewForm();
                }

                if (detailedView != null && !detailedView.IsDisposed && !detailedView.Disposing)
                {
                    detailedView.Hide();
                    detailedView.ShowDetailsFor(((ServerMessage)e.Model));
                }
            }

            // "Ignore" button
            if (e.ColumnIndex == ignoreBtnColumn.Index)
            {
                DialogResult result = MessageBox.Show(
                    "Would you like ignore this alert PERMANENTLY?", "Ignore alert",
                    MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    client.IgnoreAlertPermanently((ServerMessage)e.Model);
                }
                else
                if (result == DialogResult.No)
                {
                    client.IgnoreAlertTemporary((ServerMessage)e.Model);
                }
            }
        }
 private void listDataGrid_CellDoubleClick(object sender, CellClickEventArgs e)
 {
     if (buttonsDeletePrintDetail.ButtonDetail.Enabled)
     {
         OnDataGridCellDoubleClick?.Invoke(sender, e);
     }
 }
예제 #3
0
        private void objList_CellClick(object sender, CellClickEventArgs e)
        {
            if (e.Column == null)
            {
                return;
            }

            if (e.HitTest.RowIndex == objList.Items.Count - 1 && e.ColumnIndex != 1 && e.ColumnIndex != 0)
            {
                CountryMD cty = (CountryMD)e.HitTest.RowObject;
                if (string.IsNullOrWhiteSpace(cty.Name))
                {
                    GetStatusBar().DisplayMessage(MessageType.Error, "国家名字不能为空!");
                    objList.EditSubItem(objList.GetItem(e.RowIndex), 1);
                    return;
                }
            }
            if (e.ColumnIndex == 1 && e.HitTest.HitTestLocation == HitTestLocation.Image)
            {
                frmCFL cfl = new frmCFL(objList.BOID);
                cfl.ReturnProc = CountryRetProc;
                cfl.MdiParent  = this.MdiParent;
                cfl.Show();
            }
        }
예제 #4
0
 /// <summary>
 /// Called when the user double clicks a cell in the room booking view. If the cell matches the HH:mm-regex, a new EditView is opened on the specified hour, with the logged in person and on the room on that row. Else the cell is marked as yellow until un-hovered
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void HandleCellDoubleClick(object sender, CellClickEventArgs e)
 {
     if (e.ColumnIndex > 4)
     {
         e.SubItem.BackColor = System.Drawing.Color.Yellow;
         if (e.ClickCount == 2 && this.LoggedInUser != null)
         {
             string itemText = e.SubItem.Text;
             if (Regex.IsMatch(itemText, "[0-9]{2}:[0-9]{2}"))
             {
                 // Updating logged in user
                 this.LoggedInUser = (Person) new DAL(this).Get(LoggedInUser).First();
                 Room    targetRoom = (Room)e.Model;
                 Booking b          = new Booking();
                 b.RoomId   = targetRoom.Id;
                 b.PersonId = this.LoggedInUser.Id;
                 DateTime parsedDate = DateTime.Parse(e.SubItem.Text);
                 DateTime startDate  = new DateTime(OnDateFilter.Year, OnDateFilter.Month, OnDateFilter.Day, parsedDate.Hour, parsedDate.Minute, 0);
                 b.Start_time = startDate;
                 b.End_time   = b.Start_time.AddHours(1);
                 EditView           ev             = new EditView(b, false);
                 EditViewController editController = new EditViewController(ev, guiMainController: this, disableBookingTimePicker: true);
                 ev.Show();
             }
         }
         else if (this.LoggedInUser == null)
         {
             this.NotifyExceptionToView("Vänligen logga in för att boka rum");
         }
     }
 }
예제 #5
0
 private void sfDataGrid1_CellClick(object sender, CellClickEventArgs e)
 {
     isKeyDown = true;
     GetCurrentRecordData();
     InitializeChart();
     InitLiveChart();
 }
예제 #6
0
        private void ss1_CellClick(object sender, CellClickEventArgs e)
        {
            int iPlatecnt = 0;


            if (ss1_Sheet1.RowCount > 0 && ss2_Sheet1.RowCount > 0 && e.RowHeader.ToString() != "删除")
            {
                btn_cancel_Click(btn_cancel, e);
                if (ss1_Sheet1.Cells[e.Row, iss1_plate_no].Text.Trim().Length < 10)
                {
                    sxt_select_cnt.NumValue = iPlatecnt;
                    return;
                }
                else
                {
                    for (int iRow = e.Row; iRow >= 0; iRow--)
                    {
                        if (ss1.ActiveSheet.Cells[iRow, iss1_plate_no].Text.Trim() == "" || ss1.ActiveSheet.RowHeader.Rows[iRow].Label == "删除")//将钢板移动到空的垛层
                        {
                            sxt_select_cnt.NumValue = iPlatecnt;
                            break;
                        }
                        iPlatecnt++;
                    }
                }
            }
        }
예제 #7
0
        private void treeView_CellClick(object sender, CellClickEventArgs e)
        {
            if (e.Column == null || e.Item == null)
            {
                return;
            }

            if (e.ModifierKeys == Keys.Alt)
            {
                if (e.Model is IPtrAccessor ptr)
                {
                    viewModel.SelectedChunks = new List <CR2WExportWrapper>()
                    {
                        ptr.Reference
                    };
                    //OnChunkRequest?.Invoke(this, new SelectChunkArgs() {Chunk =  } );
                    return;
                }
            }

            if (e.Column.AspectName == nameof(IEditableVariable.REDValue))
            {
                treeView.StartCellEdit(e.Item, olvColumn4.Index);
            }
        }
예제 #8
0
        private void olvInstalledCars_ButtonClick(object sender, CellClickEventArgs e)
        {
            if (e.Column == col2Remove)
            {
                if (e.SubItem.Text == "")
                {
                    olvInstalledCars.SelectedIndex = e.RowIndex;
                    return;
                }
                RemoveCar(e.RowIndex);
            }
            if (e.Column == col2Settings)
            {
                Car c = (Car)e.Model;

                if (c.nr == null)
                {
                    MessageBox.Show(Loc.String(72));
                    return;
                }

                FormCarSettings fcs = new FormCarSettings();
                fcs.CurrentCar = c;
                fcs.UseAudio   = rbrcit.UseAudio;
                if (fcs.ShowDialog(this) == DialogResult.OK)
                {
                    rbrcit.DesiredCarList[e.RowIndex] = fcs.CurrentCar;
                    olvInstalledCars.SetObjects(rbrcit.DesiredCarList);
                    UpdateApplyButton();
                }
            }
        }
예제 #9
0
        private void TableStatistics_CellClick(object sender, CellClickEventArgs e)
        {
            var tag = TableStatistics.ActiveSheet.Cells[e.Row, e.Column].Tag;

            if (Convert.ToString(tag) == "#")
            {
                return;
            }

            switch (e.Column)
            {
            case 5:
                TableStatistics.ActiveSheet.Rows.Add(e.Row, 1);
                NeedSynchronous = true;
                break;

            case 6:
                var value = TableStatistics.ActiveSheet.Cells[e.Row, e.Column].Value;
                if (MessageBox.Show("确定要删除吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    TableStatistics.ActiveSheet.Rows.Remove(e.Row, 2);
                    NeedSynchronous = true;
                }
                break;
            }
        }
예제 #10
0
        private void TableModules_CellClick(object sender, CellClickEventArgs e)
        {
            switch (e.Column)
            {
            case 1:
                var cell   = this.TableModules.ActiveSheet.Cells[e.Row, e.Column];
                var idCell = this.TableModules.ActiveSheet.Cells[e.Row, 0];
                if (Convert.ToString(cell.Tag) == "#")
                {
                    return;
                }

                var id = new Guid(Convert.ToString(idCell.Tag));

                if (MessageBox.Show("删除后将不可恢复, 是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var result = StatisticsHelperClient.RemoveStatisticsReference(CurrentStatistics.ID, id);
                    if (string.IsNullOrEmpty(result))
                    {
                        this.ComboModules_SelectedIndexChanged(this, EventArgs.Empty);
                        MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(result, "删除错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;
            }
        }
예제 #11
0
        private void materialListView1_ButtonClick(object sender, CellClickEventArgs e)
        {
            new Thread(() =>
            {
                var pack = e.Model as AcceptedPacket;
                try
                {
                    IPHostEntry ip = Dns.GetHostEntry(pack.Destination);

                    materialListView1.BeginInvoke(new Action(() =>
                    {
                        try
                        {
                            pack.Host = ip.HostName;
                            materialListView1.UpdateObject(pack);
                            materialListView1.RefreshObject(e.Model);
                        }
                        catch (SocketException)
                        {
                            pack.Host = "Not found";
                            materialListView1.UpdateObject(pack);
                            materialListView1.RefreshObject(e.Model);
                        }
                    }));
                }
                catch (SocketException)
                {
                    pack.Host = "Not found";
                    materialListView1.UpdateObject(pack);
                    materialListView1.RefreshObject(e.Model);
                }
            }).Start();
        }
예제 #12
0
        private void OnCellClick(object sender, CellClickEventArgs cellClickEventArgs)
        {
            var col = cellClickEventArgs.Column;
            var o   = cellClickEventArgs.Model as DatabaseEntity;


            if (col == _olvFavourite && o != null)
            {
                if (_activator.FavouritesProvider.IsFavourite(o))
                {
                    _activator.FavouritesProvider.RemoveFavourite(this, o);
                }
                else
                {
                    _activator.FavouritesProvider.AddFavourite(this, o);
                }

                try
                {
                    _tlv.RefreshObject(o);
                }
                catch (ArgumentException)
                {
                }
            }
        }
예제 #13
0
        private void objectListView1_CellClick(object sender, CellClickEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }

            if (e.ColumnIndex == 4)
            {
                Guest nGuest = (Guest)this.objectListView1.GetModelObject(e.RowIndex);
                if (nGuest.CheckIn)
                {
                    nGuest.CheckIn = false;
                    this.mCheckIns--;
                }
                else
                {
                    nGuest.CheckIn = true;
                    this.mCheckIns++;
                }
                this.objectListView1.RefreshObject(nGuest);
                RefreshGuestsCount();
            }
            else
            {
                Guest   nGuest   = (Guest)this.objectListView1.GetModelObject(e.RowIndex);
                Display nDisplay = new Display(nGuest);
                nDisplay.Show();
            }
        }
        private void fpSpread1_CellDoubleClick(object sender, CellClickEventArgs e)
        {
            ModuleSetting item = null;

            if (module != null)
            {
                if (module.ModuleSettings != null)
                {
                    foreach (ModuleSetting ms in module.ModuleSettings)
                    {
                        if (ms.DocColumn == this.fpSpread1.ActiveSheet.Cells[e.Row, 2].Value.ToString() &&
                            ms.CellName == (this.fpSpread1.ActiveSheet.Cells[e.Row, 1].Value ?? "").ToString())
                        {
                            item = ms;
                        }
                    }
                }
            }
            ModuleSettingDialog dlg = new ModuleSettingDialog(item, moduleID);

            if (DialogResult.OK == dlg.ShowDialog())
            {
                BindModuleSetting();
            }
        }
예제 #15
0
 private void listSearchView_CellClick(object sender, CellClickEventArgs e)
 {
     if (e.ClickCount > 1)
     {
         SynchronizeSelection();
     }
 }
예제 #16
0
        private void ss1_CellClick(object sender, CellClickEventArgs e)
        {
            if (ss1.ActiveSheet.RowCount <= 0)
            {
                return;
            }


            Color rowColor = ss1.ActiveSheet.Cells[e.Row, e.Column].BackColor;
            Color color1   = ColorTranslator.FromHtml("#FFE6E6");
            Color color2   = ColorTranslator.FromHtml("#E6E6FF");

            if (!rowColor.Equals(color1) && !rowColor.Equals(color2))
            {
                Gf_IsFormLoad("CGA2061C");
                CGA2061C CGA2061C = new CGA2061C();
                CGA2061C.MdiParent = GeneralCommon.MDIMain;
                CGA2061C.Show();
                CGA2061C.sdt_in_plt_date.RawDate  = this.sdt_in_plt_date.RawDate;
                CGA2061C.sdt_out_plt_date.RawDate = this.sdt_out_plt_date.RawDate;
                CGA2061C.txt_plt.Text             = "B1";
                CGA2061C.txt_act_stlgrd.Text      = this.ss1.ActiveSheet.Cells[e.Row, 27].Value.ToString();
                CGA2061C.txt_thk.Text             = this.ss1.ActiveSheet.Cells[e.Row, 1].Value.ToString();
                CGA2061C.txt_thk_to.Text          = this.ss1.ActiveSheet.Cells[e.Row, 1].Value.ToString();
                CGA2061C.txt_wid.Text             = this.ss1.ActiveSheet.Cells[e.Row, 2].Value.ToString();
                CGA2061C.txt_wid_to.Text          = this.ss1.ActiveSheet.Cells[e.Row, 2].Value.ToString();
                CGA2061C.Form_Ref();
                CGA2061C.WindowState = FormWindowState.Maximized;
            }
        }
예제 #17
0
        private void OnCell_Click(object sender, CellClickEventArgs e)
        {
            GameData game = null;

            if (e.IsRevealAction)
            {
                game = this.Service.RevealCell(this.UserName, this.GameId, e.Cell.Row, e.Cell.Col);
            }
            else
            {
                switch (e.Cell.Mark)
                {
                case CellMarkType.CellMarkType_None:
                    game = this.Service.MarkCell(this.UserName, this.GameId, e.Cell.Row, e.Cell.Col, CellMarkType.CellMarkType_Flag);
                    break;

                case CellMarkType.CellMarkType_Flag:
                    game = this.Service.MarkCell(this.UserName, this.GameId, e.Cell.Row, e.Cell.Col, CellMarkType.CellMarkType_Question);
                    break;

                case CellMarkType.CellMarkType_Question:
                    game = this.Service.MarkCell(this.UserName, this.GameId, e.Cell.Row, e.Cell.Col, CellMarkType.CellMarkType_None);
                    break;
                }
            }

            this.UpdateGame(game, false);
        }
예제 #18
0
 private void olvInstalledCars_CellClick(object sender, CellClickEventArgs e)
 {
     if (e.Column == col2Sound)
     {
         if (!rbrcit.UseAudio)
         {
             MessageBox.Show(Loc.String(71));
             return;
         }
         Car c = (Car)e.Model;
         if (c.nr == null)
         {
             MessageBox.Show(Loc.String(72));
             return;
         }
         OpenFileDialog ofd = new OpenFileDialog();
         ofd.Title            = string.Format(Loc.String(73), c.manufacturer, c.name);
         ofd.Filter           = Loc.String(74);
         ofd.InitialDirectory = Application.StartupPath + "\\Audio\\Cars";
         if (ofd.ShowDialog(this) == DialogResult.OK)
         {
             FileInfo fi = new FileInfo(ofd.FileName);
             c.userSettings.engineSound        = fi.Name.Replace(fi.Extension, "");
             rbrcit.DesiredCarList[e.RowIndex] = c;
             olvInstalledCars.SetObjects(rbrcit.DesiredCarList);
             UpdateApplyButton();
         }
     }
 }
예제 #19
0
        private void fpView_CellDoubleClick(object sender, CellClickEventArgs e)
        {
            if (shtView.RowCount <= 0)
            {
                return;
            }
            if (e.Button == MouseButtons.Left)
            {
                //if (!e.ColumnHeader)
                //    miEditItem.PerformClick();

                if (!e.ColumnHeader)
                {
                    BOMNode node = shtView.Rows[e.Row].Tag as BOMNode;
                    if (node.IsExpanded)
                    {
                        node.Collapse(true);
                        CollapseNode(node);
                    }
                    else
                    {
                        node.Expand();
                        ExpandNode(node);
                    }
                }
            }
        }
예제 #20
0
 private void txnListView_CellClick(object sender, CellClickEventArgs e)
 {
     if (e.Column == olvColumnIsUserFlagged)
     {
         ToggleFlagsRows(e.Item.AsEnumerable(), appState.LatestMerged);
     }
 }
예제 #21
0
 private async void olvPokemonList_ButtonClick(object sender, CellClickEventArgs e)
 {
     try
     {
         var pokemon = e.Model as PokemonObject;
         var cName   = olvPokemonList.AllColumns[e.ColumnIndex].AspectToStringFormat;
         if (cName.Equals("Transfer"))
         {
             // ReSharper disable once PossibleNullReferenceException
             TransferPokemon(new List <PokemonData> {
                 pokemon.PokemonData
             });
         }
         else if (cName.Equals("Power Up"))
         {
             // ReSharper disable once PossibleNullReferenceException
             PowerUpPokemon(new List <PokemonData> {
                 pokemon.PokemonData
             });
         }
         else if (cName.Equals("Evolve"))
         {
             // ReSharper disable once PossibleNullReferenceException
             EvolvePokemon(new List <PokemonData> {
                 pokemon.PokemonData
             });
         }
     }
     catch (Exception ex)
     {
         Logger.Write(ex.ToString(), LogLevel.Error);
         await ReloadPokemonList();
     }
 }
예제 #22
0
 private void OnCellClick(object sender, CellClickEventArgs e)
 {
     if (e.ClickCount == 2 && e.Model != null)
     {
         ArrayInstancesCommand.Display(Data, this);
     }
 }
예제 #23
0
 internal void fOlvSpecialOrders_CellClick(object sender, CellClickEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         Process.Start($"https://www.previewsworld.com/Catalog/{((SpecialOrder)e.Model).Diamdno}");
     }
 }
예제 #24
0
 private void ListDataGrid_CellDoubleClick(object sender, CellClickEventArgs e)
 {
     if (crudcButtons.ButtonUbah.Enabled)
     {
         OnDataGridCellDoubleClick?.Invoke(sender, e);
     }
 }
예제 #25
0
        private void fpSpread1_CellDoubleClick(object sender, CellClickEventArgs e)
        {
            QualifySetting item = null;

            if (module != null)
            {
                if (module.QualifySettings != null)
                {
                    foreach (QualifySetting ms in module.QualifySettings)
                    {
                        if (ms.CellName == this.fpSpread1.ActiveSheet.Cells[e.Row, 0].Value.ToString())
                        {
                            item = ms;
                        }
                    }
                }
            }
            CellSelector cs = new CellSelector(moduleID, "", Guid.Empty);

            if (cs.ShowDialog() == DialogResult.OK)
            {
                item.CellName = cs.CellName;
                item.SheetID  = cs.SheetID;
                BindQualifySetting();
            }
        }
예제 #26
0
        private void listBox1_CellClick(object sender, CellClickEventArgs e)
        {
            if (e.ClickCount >= 2)
            {
                Selected = olvObjects.SelectedObject as T;

                if (Selected == null)
                {
                    return;
                }

                //double clicking on a row when several others are selected should not make it the only selected item
                if (AllowMultiSelect)
                {
                    //instead it should just add it to the multi selection
                    MultiSelected.Add(Selected);
                    buildGroupsRequired = true;

                    UpdateButtonEnabledness();
                    return;
                }

                MultiSelected = new HashSet <T>(new[] { Selected });
                DialogResult  = DialogResult.OK;
                this.Close();
            }
        }
예제 #27
0
        private void arrCtl_CellClick(object sender, CellClickEventArgs e)
        {
            Array values = new DefaultParser(_arrayLoader).GetValues((Expression)e.Data);
            Color color  = ((SolidColorBrush)mainPanel.Background).Color;

            ((ArrayControl)sender).ShowArrayPopup((UIElement)e.Source, values, e.ToolTipPrefix, color);
        }
예제 #28
0
        //private void ss1_CellClick(object sender, CellClickEventArgs e)
        //{
        //    if (ss1.Sheets[0].Rows.Count <= 0)
        //    {
        //        return;
        //    }

        //    //if (ss1.ActiveSheet.RowHeader.Cells[e.Row, 0].Text.Trim() == "修改")
        //    //{
        //    //   // ss1.ActiveSheet.RowHeader.Cells[e.Row, 0].Text = "";
        //    //    isRefer = true;
        //    //    SpreadCommon.Gp_Sp_Cancel(GeneralCommon.M_CN1, (Collection)Proc_Sc[i_ScCurrSeq]);
        //    //    isRefer = false;
        //    //}
        //    //else

        //    if (TXT_DEL_RES_CD.Text != "" )
        //    {
        //        switch (e.Column)
        //        {
        //            case SS1_DEL_RES_CD1:
        //                ss1.ActiveSheet.Cells[e.Row, SS1_DEL_RES_CD1].Text = TXT_DEL_RES_CD.Text;
        //                ss1.ActiveSheet.RowHeader.Cells[e.Row, 0].Text = "修改";
        //                break;

        //        }
        //    }
        //}
        protected void ss_CellDoubleClick(object sender, CellClickEventArgs e)
        {
            ////base.ss_CellDoubleClick(sender, e);
            //// 重写行新增事件
            //// 声明变量
            //string sqlStr = "select to_char(sysdate,'YYYYMMDDHH24MISS') FROM DUAL";
            //// 新建数据库连接
            //ADODB.Recordset AdoRs = new ADODB.Recordset();
            //// 检查数据库连接状态
            //if (GeneralCommon.M_CN1.State == 0)
            //    if (GeneralCommon.GF_DbConnect() == false) return;
            //// 打开数据库连接
            //AdoRs.Open(sqlStr, GeneralCommon.M_CN1, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockReadOnly, -1);
            //// 取得系统时间
            //string TimeStr = AdoRs.Fields[0].Value.ToString();
            //// 对取得系统时间做格式转换
            //TimeStr = GeneralCommon.Gf_GetDateStr(TimeStr);
            //// 点到活动单元格自动带出系统时间
            //if (ss1.ActiveSheet.RowHeader.Cells.Get(e.Row, 0).Text == "增加" && ss1.ActiveSheet.ActiveCell.Column.Tag.ToString() == "DT")
            //{
            //    // 第四列双击时间显示
            //    if (e.Column == SS1_OCCR_DATE_STR)
            //        ss1.ActiveSheet.Cells[ss1.ActiveSheet.ActiveRowIndex, SS1_OCCR_DATE_STR].Text = TimeStr;
            //    // 第五列双击时间显示
            //    if (e.Column == SS1_OCCR_DATE_END)
            //        ss1.ActiveSheet.Cells[ss1.ActiveSheet.ActiveRowIndex, SS1_OCCR_DATE_END].Text = TimeStr;
            //}
            string TimeStr = DateTime.Now.ToString("HHmm");

            if (e.Column == SS1_OCCR_DATE_END)
            {
                ss1.ActiveSheet.Cells[e.Row, SS1_OCCR_DATE_END].Text = TimeStr.Substring(0, 2) + ":" + TimeStr.Substring(2);
                ss1.ActiveSheet.RowHeader.Cells[e.Row, 0].Text       = "修改";
            }
        }
예제 #29
0
        private void ButtonClick(object sender, CellClickEventArgs cellClickEventArgs)
        {
            if (cellClickEventArgs.Column == olvEditInPopup)
            {
                var col = cellClickEventArgs.Model as IColumn;
                if (col != null)
                {
                    var dialog = new SetSQLDialog(col.SelectSQL, new RDMPCombineableFactory());

                    var querySyntaxSource = col as IHasQuerySyntaxHelper ?? _aggregate;

                    var autoComplete = new AutoCompleteProviderWin(querySyntaxSource.GetQuerySyntaxHelper());
                    autoComplete.Add(col);
                    autoComplete.Add(_aggregate);

                    autoComplete.RegisterForEvents(dialog.QueryEditor);

                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        col.SelectSQL = dialog.Result;
                        Save(col);
                    }
                }
            }
        }
예제 #30
0
        private void tvConnections_NodeMouseSingleClick(object sender, CellClickEventArgs e)
        {
            try
            {
                if (e.ClickCount > 1)
                {
                    return;
                }
                var clickedNode = e.Model as ConnectionInfo;

                if (clickedNode == null)
                {
                    return;
                }
                if (clickedNode.GetTreeNodeType() != TreeNodeType.Connection && clickedNode.GetTreeNodeType() != TreeNodeType.PuttySession)
                {
                    return;
                }
                if (Settings.Default.SingleClickOnConnectionOpensIt)
                {
                    ConnectionInitiator.OpenConnection(SelectedNode);
                }

                if (Settings.Default.SingleClickSwitchesToOpenConnection)
                {
                    ConnectionInitiator.SwitchToOpenConnection(SelectedNode);
                }
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddExceptionStackTrace("tvConnections_NodeMouseClick (UI.Window.ConnectionTreeWindow) failed", ex);
            }
        }
예제 #31
0
 /// <summary>
 /// Capture cell double click event to not allow user to go into edit mode
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void fpSpread1_CellDoubleClick(object sender, CellClickEventArgs e)
 {
     e.Cancel = true;
 }
예제 #32
0
 /// <summary>
 /// Capture cell click event to not allow user to select any cells
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void fpSpread1_CellClick(object sender, CellClickEventArgs e)
 {
     if ((e.Row == 3 && e.Column == 3) || (e.Column == 1 && e.Row == 1))
       {
     e.Cancel = false;
       }
       else
       {
     e.Cancel = true;
       }
 }