public HttpResponseMessage PostMessage(NiawaWebMessage item) { item = repository.Add(item); if (_hub == null) { //get hub _hub = NiawaResourceProvider.RetrieveNiawaSRHub(); } if (_hub != null) { //send message _hub.Send(item.Id, item.Sender, item.Message); } else { //hub is not set Console.WriteLine("Could not send message to NiawaSRHub: hub is not set"); } //return item; var response = Request.CreateResponse<NiawaWebMessage>(HttpStatusCode.Created, item); string uri = Url.Link("DefaultApi", new { id = item.Id }); response.Headers.Location = new Uri(uri); return response; }
/// <summary> /// Instantiates a TreeModelNodeViewImpl. /// This contains the implementation of the Tree Model Node View. /// The Tree Model Node View is the detailed view (i.e. web page contents) of the tree model node (i.e. tree item). /// </summary> /// <param name="browser"></param> public TreeModelNodeViewImpl(NiawaSRHub webPageSR, string callerSessionID) { _webPageSR = webPageSR; _callerSessionID = callerSessionID; _createdDate = DateTime.Now; _cachedEvents = new List<TreeModelNodeControls.ITreeModelEvent>(); }
/// <summary> /// Instantiates a TreeModelNodeViewFactoryImpl. /// </summary> public TreeModelNodeViewFactoryImpl() { _webPageSR = NiawaResourceProvider.RetrieveNiawaSRHub(); }