Explorar o código

Added ToList method to the interface IListDataSource to return the source as IList.

BDisp %!s(int64=5) %!d(string=hai) anos
pai
achega
267c2d1090
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      Terminal.Gui/Views/ListView.cs

+ 11 - 0
Terminal.Gui/Views/ListView.cs

@@ -63,6 +63,12 @@ namespace Terminal.Gui {
 		/// <param name="item">Item index.</param>
 		/// <param name="value">If set to <c>true</c> value.</param>
 		void SetMark (int item, bool value);
+
+		/// <summary>
+		/// Return the source as IList.
+		/// </summary>
+		/// <returns></returns>
+		IList ToList ();
 	}
 
 	/// <summary>
@@ -574,5 +580,10 @@ namespace Terminal.Gui {
 			if (item >= 0 && item < count)
 				marks [item] = value;
 		}
+
+		public IList ToList ()
+		{
+			return src;
+		}
 	}
 }