private void OnItemChanged(int id) { var item = _dataService.GetItem(id); if (NodesChanged != null) { NodesChanged(this, new TreeModelEventArgs(new TreePath(item), new object[] { item })); } }
private TcpMessage HandleUniqueItemQuery(TcpConnectedHost host, TcpMessage message) { if (!message.HasType(TcpRequestType.UniqueItemQuery)) { return(null); } if (!IsAuthenticated(host)) { throw AuthException.NotLoggedIn(); } var request = new ParamTcpMessage(message); var response = new ObjectTcpMessage <DbItem>(TcpRequestType.List); if (request.HasParam("id")) { var id = request.GetParamAsNullableInt("id"); if (id != null) { var item = _dataService.GetItem(id.Value); response.Add(item); return(response); } } return(TcpMessage.Error("Missing or badly formatted query parameters")); }
public override DbItem GetItem(int id) { if (!IsAuthenticated) { throw AuthException.NotLoggedIn(); } return(_dataService.GetItem(id)); }