/// <inheritdoc /> public override IndexValue Parse(string text) { // UserId if (int.TryParse(text, out int id)) { return(new IndexValue(SharingDataTokenizer.TokenizeIdentity(id))); } // User by path try { var user = NodeHead.Get(text); if (user != null) { return(new IndexValue(SharingDataTokenizer.TokenizeIdentity(user.Id))); } } catch { // ignored } // User by username try { var user = User.Load(text); if (user != null) { return(new IndexValue(SharingDataTokenizer.TokenizeIdentity(user.Id))); } } catch { // ignored } return(new IndexValue(SharingDataTokenizer.TokenizeSharingToken(text))); }
/// <inheritdoc /> public override IndexValue Parse(string text) { return(Enum.TryParse(text, true, out SharingLevel level) ? new IndexValue(SharingDataTokenizer.TokenizeSharingLevel(level)) : new IndexValue(text)); }
/// <inheritdoc /> public override IndexValue Parse(string text) { return(Enum.TryParse(text, true, out SharingMode mode) ? new IndexValue(SharingDataTokenizer.TokenizeSharingMode(mode)) : new IndexValue(text)); }