Set AvailableGestures and AvailableGesturesCount setters as private
Add Constructor overload that allows a lambda expression
Add Static constructor to allow building database from plain text
This commit is contained in:
mrvux 2015-04-24 12:37:54 +01:00
Родитель 7a60cfd864
Коммит 1f86b92232
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -21,8 +21,19 @@ namespace PreposeGestures
AvailableGestures = (IReadOnlyList<Gesture>)parsedPreposeCode.Gestures;
}
public IReadOnlyList<Gesture> AvailableGestures { get; set; }
public uint AvailableGesturesCount { get; set; }
public PreposeGesturesDatabase(Func<PreposeGestures.App> preposeGestureAppFunc)
{
parsedPreposeCode = preposeGestureAppFunc();
AvailableGestures = (IReadOnlyList<Gesture>)parsedPreposeCode.Gestures;
}
public static PreposeGesturesDatabase FromText(string text)
{
return new PreposeGesturesDatabase(() => PreposeGestures.App.ReadAppText(text));
}
public IReadOnlyList<Gesture> AvailableGestures { get; private set; }
public uint AvailableGesturesCount { get; private set; }
}
public sealed class DiscreteGestureResult : IDisposable