public void SaveMediaToLibrary(List <MediaItem> pMediaItems) { NHibernate.ISession dbSession = DatabaseInterface.DataSession; // MediaGroupCreater mediaGroupCreater = new MediaGroupCreater(); // retreive all stores and display them using (dbSession.BeginTransaction()) { foreach (MediaItem item in pMediaItems) { DigitalMediaLibrary dml = new DigitalMediaLibrary(); dml.Artist = item.Artist; dml.Album = item.Album; dml.FileName = item.FileName; dml.Frequency = item.Frequency; dml.Genre = item.Genre; dml.Kbps = item.Kbps; dml.Path = item.Path; dml.Title = item.Title; dml.Track = item.Track; dml.DeviceId = item.DeviceId; try { dbSession.Save(dml); } catch { } //mediaGroupCreater.AddMediaItem(dml); } try { dbSession.Transaction.Commit(); } catch (Exception ex) { DebugHandler.HandleException(ex); } //{ // DebugHandler.DebugPrint("Cannot save Media list: " + dmls.ErrorString); //} } }
private void DrawFrame() { try { //if (!_renderTarget.IsOccluded) //{ if (_currentView == null) { return; } _window.Renderer.BeginDraw(); _window.Renderer.Clear(Color.Black); _currentView.Render(_window.Renderer); _overlayViewControls.Render(_window.Renderer); //for (int i = _overlayViewControls.Count - 1; // i >= 0; // i--) //{ // _overlayViewControls[i].Render(_renderTarget); //} _window.Renderer.EndDraw(); _window.ProcessEvents(); //this.Invalidate(); //} } catch (Exception ex) { DebugHandler.HandleException(ex); _window.Renderer.Flush(); } }
private static void HandleLowLevelException(object sender, UnhandledExceptionEventArgs e) { DebugHandler.HandleException((Exception)e.ExceptionObject); }