void OnPositionChanged(object sender, PositionEventArgs e) { var position = e.Position; string message = string.Format("Latitude: {0} | Longitude: {1}", position.Latitude, position.Longitude); Debug.WriteLine(message); }
/// <summary> /// Fired when the focus enter in the specified cell. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public virtual void OnFocusEntered(PositionEventArgs e) { for (int i = 0; i < behaviorModels.Count; i++) { behaviorModels[i].OnFocusEntered(e); } }
protected virtual void OnPositionDelete(PositionEventArgs e) { if (PositionDelete != null) { PositionDelete(this, e); } }
protected virtual void OnPositionMakeInactive(PositionEventArgs e) { if (PositionMakeInactive != null) { PositionMakeInactive(this, e); } }
private async void Locator_PositionChanged(object sender, PositionEventArgs e) { MoveMap(e.Position); var advertisements = await AdvertisementLogic.GetAdvertisements(currentPosition.Latitude, currentPosition.Longitude); DisplayInMap(advertisements); }
protected virtual void OnPositionEdit(PositionEventArgs e) { if (PositionEdit != null) { PositionEdit(this, e); } }
private void OnPositionChanged(object sender, PositionEventArgs e) { Device.BeginInvokeOnMainThread(() => { App.CurrentPosition = e.Position; if (_didFinishedNavigation) { return; } if (e.Position.Latitude < _semanticLink.MinLatitude - 0.0001 || e.Position.Latitude > _semanticLink.MaxLatitude + 0.0001 || e.Position.Longitude < _semanticLink.MinLongitude || e.Position.Longitude > _semanticLink.MaxLongitude) { _didFinishedNavigation = true; var parameter = new NavigationParameters { { ResultPageViewModel.ParamCalculator, _caluculator }, { ResultPageViewModel.ParamSemanticLink, _semanticLink } }; _navigationService.NavigateAsync($"/{nameof(ResultPage)}", parameter); } else { _caluculator.PositionCollection.Add(e.Position); } }); }
private async void Current_PositionChanged(object sender, PositionEventArgs e) { CurrentLocation = e.Position; var nextStep = _currentWaypoints.OrderBy(w => w.Step).Last().Step + 1; _currentWaypoints.Add(new Waypoint { Step = nextStep, Latitude = CurrentLocation.Latitude, Longitude = CurrentLocation.Longitude, Timestamp = DateTimeOffset.UtcNow }); if (CurrentWaypoints.Any()) { var j = new Journey(); foreach (var w in CurrentWaypoints.OrderBy(w => w.Step).ToList()) { j.Waypoints.Add(w); } CurrentDistance = await j.CalculateDistance(); } else { CurrentDistance = 0; } HasMoved?.Invoke(this, EventArgs.Empty); }
private void Locator_PositionChanged(object sender, PositionEventArgs e) { var position = e.Position; dialogs.Toast($"{position.Latitude} | {position.Longitude}", TimeSpan.FromSeconds(1)); var location = new Xamarin.Forms.Maps.Position(position.Latitude, position.Longitude); var mapSpan = MapSpan.FromCenterAndRadius(location, Distance.FromMeters(100)); var lastPos = Model.Route.LastOrDefault(); if (lastPos == null || (lastPos != null && Distance.BetweenPositions(location, lastPos).Meters > 5)) { Model.AddPosition(location); viewMap.MapElements.Clear(); var route = new Polyline() { StrokeColor = Color.FromHex("#fc6203"), StrokeWidth = 10 }; foreach (var pos in Model.Route) { route.Geopath.Add(pos); } viewMap.MapElements.Add(route); } viewMap.MoveToRegion(mapSpan); }
private void HandOnMoved(object sender, PositionEventArgs positionEventArgs) { var current = positionEventArgs.NewPosition; var lastPrimaryValue = GetLastPrimaryValue(_last); var currentPrimaryValue = GetCurrentPrimaryValue(current); var currentSecundaryValue = GetCurrentSecundaryValue(current); if (!GestureHappening) { if (IsInStartArea(currentPrimaryValue, GetBeginLimit())) { _startedSecundaryValue = currentSecundaryValue; GestureHappening = true; } _last = current; return; } var dif = Math.Abs(currentSecundaryValue - _startedSecundaryValue); if (dif > SecundaryDirectionTolerance || !IsRightDirection(currentPrimaryValue, lastPrimaryValue)) { GestureHappening = false; _last = current; } if (IsInEndArea(currentPrimaryValue, GetEndLimit())) { OnSlideDetected(); GestureHappening = false; } _last = current; }
private void MouthOnMoved(object sender, PositionEventArgs positionEventArgs) { var x = positionEventArgs.NewPosition.Image.X; var y = positionEventArgs.NewPosition.Image.Y; var middleX = 300; var middleY = 270; var limit = 50; ShowArrow(Direction.None); if (x > middleX + limit) { ShowArrow(Direction.Right); } if (x < middleX - limit) { ShowArrow(Direction.Left); } if (y > middleY + limit) { ShowArrow(Direction.Down); } if (y < middleX - limit) { ShowArrow(Direction.Up); } }
internal async void OnBoardSquareTapped(object sender, PositionEventArgs e) { if (_model.GameInformation.NextToMove != _playerSide) { return; } var pieceAtSquare = _model.GetPieceAt(e.LogicalPosition); if (pieceAtSquare != null && pieceAtSquare.Side == _model.GameInformation.NextToMove) { SetSelection(pieceAtSquare, e.LogicalPosition); return; } if (_selectedPiece != null) { if (ValidMoves.Contains(e.LogicalPosition) || ValidAttacks.Contains(e.LogicalPosition)) { try { _model.ExecuteMove(await TurnFromPiecePositionChange(_selectedPiece, _selectedSquare.Value, e.LogicalPosition, true), true); SetVisiblePositionsForPlayer(); _board.IsSwitchPlayerEnabled = true; _board.IsGameBoardEnabled = false; SetSelection(null, null); } catch (OperationCanceledException) { // ignore touch return; } } } }
void MeshIsOver() { #if UNITY_5_6_OR_NEWER UpdateNavMesh(); //Nav mesh has been build. Clear the sources as we don't need them sources.Clear(); //Draw the nav mesh is possible (triangulation from navmesh has return an area) bool isDrawn = Draw(); #endif if (isDrawn) { PositionEventArgs args = new PositionEventArgs(); args.position = NavMeshPosition; args.valid = isDrawn; args.agentTypeID = agentTypeID; System.EventHandler <PositionEventArgs> handler = OnNavMeshReady; if (handler != null) { handler(this, args); } } else { Debug.LogWarning(ZEDLogMessage.Error2Str(ZEDLogMessage.ERROR.NAVMESH_NOT_GENERATED)); } isOver = true; }
private void Locator_PositionChanged(object sender, PositionEventArgs e) { var center = new Xamarin.Forms.Maps.Position(e.Position.Latitude, e.Position.Longitude); var span = new Xamarin.Forms.Maps.MapSpan(center, 2, 2); locationsMaps.MoveToRegion(span); }
private static void OnPositionChanged(object sender, PositionEventArgs e) { //If updating the UI, ensure you invoke on main thread var position = e.Position; var output = "Full: Lat: " + position.Latitude + " Long: " + position.Longitude; output += "\n" + $"Time: {position.Timestamp}"; output += "\n" + $"Heading: {position.Heading}"; output += "\n" + $"Speed: {position.Speed}"; output += "\n" + $"Accuracy: {position.Accuracy}"; output += "\n" + $"Altitude: {position.Altitude}"; output += "\n" + $"Altitude Accuracy: {position.AltitudeAccuracy}"; Debug.WriteLine(output); App.LocalDb.InsertOrReplace(new Models.Location() { Id = Guid.NewGuid(), UserId = Settings.CurrentUserId, Latitude = position.Latitude, Longitude = position.Longitude, Altitude = position.Altitude, EditDate = DateTime.Now, IsToSync = true }); Debug.WriteLine("Location Added!"); PositionChanged?.Invoke(sender, e); //MessagingCenter.Send(this, MessageKey.POSITION_CHANGED, e.Position); }
/// <summary> /// Raises the <see cref="E:Click"/> event. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public virtual void OnClick(PositionEventArgs e) { for (int i = 0; i < behaviorModels.Count; i++) { behaviorModels[i].OnClick(e); } }
/*public override bool CanReceiveFocus { * get { return true; } * }*/ public override void OnDoubleClick(PositionEventArgs e) { base.OnDoubleClick(e); ImportsGrid g = (ImportsGrid)e.Grid; g.FileDialog(e); }
/// <summary> /// Reset the original cursor /// </summary> /// <param name="e"></param> public virtual void ResetCursor(PositionEventArgs e) { if (e.Cell is ICellCursor) { e.Grid.GridCursor = System.Windows.Forms.Cursors.Default; } }
public void CrossGeolocator_Current_PositionChanged(object sender, PositionEventArgs e) { DurationString = DateTime.UtcNow.Subtract(_startTimeConst).ToString(); DurationLabel.Text = DurationString.ToString(); // TODO: // попробовать вынести с главного потока Device.BeginInvokeOnMainThread(() => { var positionGeolocator = e.Position; if ((positionGeolocator.Latitude != _previousPosition.Latitude) || (positionGeolocator.Longitude != _previousPosition.Longitude)) { var snappedPointDb = new SnappedPointDb { TrackId = _track.Id, Latitude = positionGeolocator.Latitude, Longitude = positionGeolocator.Longitude, Time = positionGeolocator.Timestamp.UtcDateTime }; App.SnappedPointDatabase.SaveItem(snappedPointDb); _snappedPointsCount += 1; _previousPosition = positionGeolocator; } }); }
/// <summary> /// Fired when the SetValue method is called. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public virtual void OnValueChanged(PositionEventArgs e) { for (int i = 0; i < behaviorModels.Count; i++) { behaviorModels[i].OnValueChanged(e); } }
void CrossGeolocator_Current_PositionChanged(object sender, PositionEventArgs e) { Device.BeginInvokeOnMainThread(() => { var position = e.Position; //Positions.Add(position); //count++; //labelGPSTrack.Text = string.Format("Time: {0} \nLat: {1} \nLong: {2} \nAltitude: {3} \nAltitude Accuracy: {4} \nAccuracy: {5} \nHeading: {6} \nSpeed: {7}", // position.Timestamp, position.Latitude, position.Longitude, // position.Altitude, position.AltitudeAccuracy, position.Accuracy, position.Heading, position.Speed); var khoangcach = 1e3 * DBSCAN.haversine_distance(new Coordinate(position.Latitude, position.Longitude), new Coordinate(PositionKeTiep.Latitude, PositionKeTiep.Longitude)); if (!KcNhoNhat.HasValue) { KcNhoNhat = khoangcach; } KcNhoNhat = khoangcach < KcNhoNhat ? khoangcach : KcNhoNhat; if (DaDenDiaDiem) { if (khoangcach > KcNhoNhat) { DaDiQuaDiaChiKeTiep = true; } } else if (KcNhoNhat <= KcChapNhan) { DaDenDiaDiem = !DaDenDiaDiem; } }); }
private void ItemOnMoved(object sender, PositionEventArgs positionEventArgs) { var point = positionEventArgs.NewPosition.World; if (Status == MovementStatus.Completed) { if (AutoRestart && !IsGoingRightDirection(point)) { Status = MovementStatus.Idle; } return; } if (Status == MovementStatus.Idle) { Status = MovementStatus.Working; StartPosition = point; LastPosition = point; return; } if (_pose != null && !_pose.Active) { return; } if (Check != null && !Check.Invoke()) { return; } if (!IsGoingRightDirection(point)) { Restart(); return; } if (IsMovementCompleted(point)) { Status = MovementStatus.Completed; OnCompleted(); return; } LastPosition = point; OnProgress(GetProgress(point)); }
private void CrossGeolocator_Current_PositionChanged(object sender, PositionEventArgs e) { Device.BeginInvokeOnMainThread(async() => { Models.Location local = new Models.Location(); Plugin.Geolocator.Abstractions.Position position = e.Position; if (Cposition != e.Position) { Cposition = e.Position; mainmap.MoveToRegion(MapSpan.FromCenterAndRadius(new Xamarin.Forms.Maps.Position(position.Latitude, position.Longitude), Distance.FromMiles(1)).WithZoom(2)); loader.IsVisible = false; mainmap.IsVisible = true; local.Lat = position.Latitude; local.Lng = position.Longitude; if (Trip.Key != null) { _firebaseDatabase.UpdateTripDriverLocation(Trip.Key, local); if (Trip.Status == "Started") { _firebaseDatabase.UpdateTripLocation(Trip.Key, local); } } } }); }
public void OnMouseLeave(PositionEventArgs e) { if (MouseLeave != null) { MouseLeave(this, e); } }
public void OnDoubleClick(PositionEventArgs e) { if (DoubleClick != null) { DoubleClick(this, e); } }
public void OnValueChanged(PositionEventArgs e) { if (ValueChanged != null) { ValueChanged(this, e); } }
public void OnMouseEnter(PositionEventArgs e) { if (MouseEnter != null) { MouseEnter(this, e); } }
public void OnFocusEntered(PositionEventArgs e) { if (FocusEntered != null) { FocusEntered(this, e); } }
public void OnFocusLeft(PositionEventArgs e) { if (FocusLeft != null) { FocusLeft(this, e); } }
public void OnClick(PositionEventArgs e) { if (Click != null) { Click(this, e); } }
void Locator_PositionChanged(object sender, PositionEventArgs e) { last_position = position; position = e.Position; DrawMarker(); //FindViewById<Button>(Resource.Id.switch_button).Text = position.Latitude.ToString(); }
/// <summary> /// Handles the double click event in the specified cell /// </summary> /// <param name="e">The cell position</param> public override void OnDoubleClick(PositionEventArgs e) { base.OnDoubleClick(e); if (e.Cell.DataModel != null && (e.Cell.DataModel.EditableMode & EditableModes.DoubleClick) == EditableModes.DoubleClick) { e.Cell.StartEdit(e.Position, null); } }
/// <summary> /// Raises the <see cref="E:Click"/> event. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public override void OnClick(PositionEventArgs e) { base.OnClick(e); if (Click != null) { Click(this, e); } }
/// <summary> /// Applies the tool tip text. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> protected virtual void ApplyToolTipText(PositionEventArgs e) { if (e.Cell is ICellToolTipText) { ICellToolTipText l_CellToolTip = (ICellToolTipText)e.Cell; string l_ToolTipText = l_CellToolTip.GetToolTipText(e.Position); if (l_ToolTipText != null && l_ToolTipText.Length > 0) { e.Grid.GridToolTipText = l_ToolTipText; } } }
/// <summary> /// Change the cursor with the cursor of the cell /// </summary> /// <param name="e">The cell position</param> public virtual void ApplyCursor(PositionEventArgs e) { if (e.Cell is ICellCursor) { ICellCursor l_CellCursor = (ICellCursor)e.Cell; System.Windows.Forms.Cursor l_Cursor = l_CellCursor.GetCursor(e.Position); if (l_Cursor != null) { e.Grid.GridCursor = l_Cursor; } else { e.Grid.GridCursor = System.Windows.Forms.Cursors.Default; } } }
/// <summary> /// Fires the mouse leave event in a specified cell /// </summary> /// <param name="e">The specified cell</param> public void OnMouseLeave(PositionEventArgs e) { if (MouseLeave != null) { MouseLeave(this, e); } }
/// <summary> /// Fires the value changed event in a specified cell /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public void OnValueChanged(PositionEventArgs e) { if (ValueChanged != null) { ValueChanged(this, e); } }
public override void OnDoubleClick(PositionEventArgs e) { base.OnDoubleClick(e); Point l_Current = e.Grid.PointToClient(System.Windows.Forms.Control.MousePosition); Rectangle l_CellRect = e.Grid.PositionToDisplayRect(e.Position); if ((ResizeMode & CellResizeModes.Width) == CellResizeModes.Width && IsInHorizontalResizeRegion(l_CellRect, l_Current)) { e.Grid.AutoSizeColumn(e.Position.Column, e.Grid.AutoSizeMinWidth); } else if ((ResizeMode & CellResizeModes.Height) == CellResizeModes.Height && IsInVerticalResizeRegion(l_CellRect, l_Current)) { e.Grid.AutoSizeRow(e.Position.Row, e.Grid.AutoSizeMinHeight); } }
/// <summary> /// Sort the current column /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> /// <param name="doAscending">if set to <c>true</c> sort in ascending order.</param> /// <param name="comparer">The comparer.</param> private void SortColumn(PositionEventArgs e, bool doAscending, IComparer comparer) { if (IsSortEnable(e) && e.Position.Row < e.Grid.RowsCount && e.Grid.ColumnsCount > 0) { Range l_RangeToSort; Range l_RangeHeader; if (rangeToSort != null) { l_RangeToSort = rangeToSort.GetRange(e.Grid); } else { // the range to sort is all the grid range without the rows < of the current row l_RangeToSort = new Range(e.Position.Row + 1, 0, e.Grid.RowsCount - 1, e.Grid.ColumnsCount - 1); } if (headerRange != null) { l_RangeHeader = headerRange.GetRange(e.Grid); } else { // the range header is all the grid range with the rows <= of the current row l_RangeHeader = new Range(0, 0, e.Position.Row, e.Grid.ColumnsCount - 1); } if (e.Grid.RowsCount > e.Grid.FixedRows && e.Grid.ColumnsCount > e.Grid.FixedColumns) { e.Grid.SortRangeRows(l_RangeToSort, e.Position.Column, doAscending, comparer); ICellSortableHeader l_CellSortable = (ICellSortableHeader)e.Cell; l_CellSortable.SetSortMode(e.Position, doAscending == true ? GridSortMode.Ascending : GridSortMode.Descending); // Remove the image from others for (int r = l_RangeHeader.Start.Row; r <= l_RangeHeader.End.Row; r++) { for (int c = l_RangeHeader.Start.Column; c <= l_RangeHeader.End.Column; c++) { Cells.ICellVirtual l_tmp = e.Grid.GetCell(r, c); if (l_tmp != null && l_tmp is ICellSortableHeader && c != e.Position.Column) { ((ICellSortableHeader)l_tmp).SetSortMode(new Position(r, c), GridSortMode.None); } } } } } }
/// <summary> /// Handles the mouse leave event in the current cell /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public override void OnMouseLeave(PositionEventArgs e) { base.OnMouseLeave(e); e.Cell.Invalidate(e.Position); // Invalidate the cell to refresh the header }
/// <summary> /// Fires the focus left event /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public void OnFocusLeft(PositionEventArgs e) { if (FocusLeft != null) { FocusLeft(this, e); } }
// On value changed public override void OnValueChanged( PositionEventArgs e ) { array.SetValue( e.Cell.GetValue( e.Position ), e.Position.Row - 1, e.Position.Column - 1 ); ( (GridArrayInt) e.Grid ).Colorize( ); ( (GridArrayInt) e.Grid ).OnValueChanged( e.Position.Column - 1, e.Position.Row - 1 ); }
private void OnPositionChanged (PositionEventArgs e) { var changed = PositionChanged; if (changed != null) changed (this, e); }
/// <inheritdoc/> private void OnListenerPositionChanged (object sender, PositionEventArgs e) { if (!IsListening) // ignore anything that might come in afterwards return; lock (this.positionSync) { this.lastPosition = e.Position; var changed = PositionChanged; if (changed != null) changed (this, e); } }
private void DispatcherPositionOpened(object sender, PositionEventArgs args) { PortfolioEventQueue.Enqueue(new OnPositionOpened(args.Portfolio, args.Position)); }
/// <summary> /// Reset the original cursor /// </summary> /// <param name="e">The cell position</param> public virtual void ResetCursor(PositionEventArgs e) { if (e.Cell is ICellCursor) { e.Grid.GridCursor = System.Windows.Forms.Cursors.Default; } }
/// <summary> /// Handles the mouse leave event /// </summary> /// <param name="e">The cell position</param> public override void OnMouseLeave(PositionEventArgs e) { base.OnMouseLeave(e); ResetCursor(e); }
/// <summary> /// Fires the mouse enter event in a specified cell /// </summary> /// <param name="e">The specified cell</param> public void OnMouseEnter(PositionEventArgs e) { if (MouseEnter != null) { MouseEnter(this, e); } }
// セッションの開始を通知する void sessionManager_SessionStart(object sender, PositionEventArgs e) { sessionState = SessionState.InSession; }
// On mouse click public override void OnClick( PositionEventArgs e ) { ( (GridArrayInt) e.Grid ).OnCellClicked( e.Position.Column - 1, e.Position.Row - 1 ); }
async void locator_PositionChanged (object sender, PositionEventArgs e) { try { if (Settings.panicActivated) { var position = await locator.GetPositionAsync (timeoutMilliseconds: 30000); var coords = new PanicGps (); coords.Id = Settings.panicId; //Eventos entre inicio e fim de um panico,gravados com mesmo Id //Guid.NewGuid().ToString(); coords.Lat = position.Latitude; coords.Long = position.Longitude; coords.Date = DateTime.Now; coords.Event = Settings.panicId; await PanicGps.CreateAsync (coords); } } catch (Exception ex) { await UserDialogs.Instance.AlertAsync ("MySafety", "Ocorreu um erro ao obter coordenadas.\n\r" + ex.Message); } }
private void OnPositionChanged(PositionEventArgs e) { var handler = this.PositionChanged; if (handler != null) handler(this, e); }
/// <summary> /// Handles the mouse enter event in the current cell. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public override void OnMouseEnter(PositionEventArgs e) { base.OnMouseEnter(e); ////e.Cell.Invalidate(e.Position);//Invalidate the cell to refresh the checkbox }
/// <summary> /// Handles the click event on the current cell /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public override void OnClick(PositionEventArgs e) { base.OnClick(e); if (IsSortEnable(e) && (resize == null || (resize.IsHeightResizing == false && resize.IsWidthResizing == false))) { ICellSortableHeader sortableHeaderCell = (ICellSortableHeader)e.Cell; SortStatus sortStatus = sortableHeaderCell.GetSortStatus(e.Position); if (sortStatus.EnableSort) { SortColumn(e, sortStatus.Mode != GridSortMode.Ascending, sortStatus.Comparer); } } }
/// <summary> /// Handles the click event on the current cell /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> public override void OnClick(PositionEventArgs e) { base.OnClick(e); }
/// <summary> /// Indicates whether sorting is enabled for the specified cell. /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionEventArgs"/> instance containing the event data.</param> /// <returns> /// <c>true</c> if is sort enabled for the specified cell; otherwise, <c>false</c>. /// </returns> private bool IsSortEnable(PositionEventArgs e) { if (e.Cell is ICellSortableHeader && doEnableSort) { ICellSortableHeader sortableHeaderCell = (ICellSortableHeader)e.Cell; SortStatus sortStatus = sortableHeaderCell.GetSortStatus(e.Position); return sortStatus.EnableSort; } else { return false; } }
/// <summary> /// Called when the file link from the grid is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OpenFile( object sender, PositionEventArgs e ) { OpenFileDialog fdlg = new OpenFileDialog( ); bool chosen = false; fdlg.Title = "Choose log file..."; fdlg.DefaultExt = "*.log"; while ( ! chosen ) { if ( fdlg.ShowDialog( ) == DialogResult.Cancel ) { return; } // validate if ( File.Exists( fdlg.FileName ) ) { // prompt for overwrite if ( MessageBox.Show( "The file you've choosen " + Environment.NewLine + Environment.NewLine + " ( " + fdlg.FileName + ")" + Environment.NewLine + Environment.NewLine + "already exists and it will be appended." + Environment.NewLine + "Press OK to continue using this file or Cancel to choose another one.", "Confirm append", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation ) == DialogResult.OK ) { chosen = true; } } } ( ( Link ) sender ).Value = fdlg.FileName; grid.AutoSizeView( true ); }
/// <summary> /// Handles the mouse enter event /// </summary> /// <param name="e">The cell position</param> public override void OnMouseEnter(PositionEventArgs e) { base.OnMouseEnter(e); ApplyCursor(e); }
public override void OnMouseLeave(PositionEventArgs e) { base.OnMouseLeave(e); e.Cell.Grid.GridCursor = null; isWidthResizing = false; isHeightResizing = false; }