Пример #1
0
        /// <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;
        }
Пример #2
0
        /// <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;
        }
Пример #3
0
 public ModuleAdapter(Activity context, Module[] items)
     : base()
 {
     this.context = context;
     this.items = items;
 }
Пример #4
0
 /// <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;
 }
Пример #5
0
 /// <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;
 }