/// <summary> /// Gets the interactor associated with a given control, if there is one. /// </summary> /// <param name="control">The control.</param> /// <param name="interactor">The interactor.</param> /// <returns>True if an interactor exists.</returns> public bool TryGetInteractor(Control control, out FormsInteractor interactor) { interactor = _interactors .FirstOrDefault(x => control.Equals(x.Control)); return(interactor != null); }
/// <summary> /// Gets the interactor associated with a given control. Creates a new interactor if none was found. /// </summary> /// <param name="control">The control.</param> /// <returns>The interactor.</returns> public FormsInteractor GetInteractor(Control control) { FormsInteractor interactor; if (!TryGetInteractor(control, out interactor)) { interactor = new FormsInteractor(control); _interactors.Add(interactor); IsModified = true; } return(interactor); }
/// <summary> /// Gets the interactor associated with a given control, if there is one. /// </summary> /// <param name="control">The control.</param> /// <param name="interactor">The interactor.</param> /// <returns>True if an interactor exists.</returns> public bool TryGetInteractor(Control control, out FormsInteractor interactor) { interactor = _interactors .FirstOrDefault(x => control.Equals(x.Control)); return interactor != null; }
/// <summary> /// Gets the interactor associated with a given control. Creates a new interactor if none was found. /// </summary> /// <param name="control">The control.</param> /// <returns>The interactor.</returns> public FormsInteractor GetInteractor(Control control) { FormsInteractor interactor; if (!TryGetInteractor(control, out interactor)) { interactor = new FormsInteractor(control); _interactors.Add(interactor); IsModified = true; } return interactor; }