/// <summary> /// Gets the next module if available. /// </summary> /// <returns>The next module.</returns> /// <param name="currentModule">Current module.</param> public Module GetNextModule(Module currentModule) { if (HasNextModule(currentModule)) { var index = Modules.IndexOf (currentModule) + 1; return Modules.ElementAt(index); } return null; }
/// <summary> /// Gets the previoust module if available. /// </summary> /// <returns>The previous module.</returns> /// <param name="currentModule">Current module.</param> public Module GetPreviousModule(Module currentModule) { if (HasPreviousModule(currentModule)) { var index = Modules.IndexOf(currentModule) - 1; return Modules.ElementAt(index); } return null; }
public ModuleAdapter(Activity context, Module[] items) : base() { this.context = context; this.items = items; }
/// <summary> /// Determines whether there is a next module available from the provided module /// </summary> /// <returns><c>true</c> if this level has a next module; otherwise, <c>false</c>.</returns> /// <param name="currentModule">Current module.</param> public bool HasNextModule(Module currentModule) { var index = Modules.IndexOf(currentModule); return Modules.Count - 1 > index; }
/// <summary> /// Determines whether there is a previous module available from the provided module /// </summary> /// <returns><c>true</c> if this level has a previous module; otherwise, <c>false</c>.</returns> /// <param name="currentModule">Current module.</param> public bool HasPreviousModule(Module currentModule) { var index = Modules.IndexOf(currentModule); return index > 0; }