LongoMatch.Services.ProjectsManager.OpenProjectID C# (CSharp) Method

OpenProjectID() private method

private OpenProjectID ( OpenProjectIDEvent e ) : void
e LongoMatch.Core.Events.OpenProjectIDEvent
return void
        void OpenProjectID(OpenProjectIDEvent e)
        {
            if (e.Project == null) {
                try {
                    e.Project = App.Current.DatabaseManager.ActiveDB.Retrieve<ProjectLongoMatch> (e.ProjectID);
                } catch (Exception ex) {
                    Log.Exception (ex);
                    App.Current.Dialogs.ErrorMessage (ex.Message);
                    return;
                }
            }

            if (!e.Project.IsLoaded) {
                try {
                    IBusyDialog busy = App.Current.Dialogs.BusyDialog (Catalog.GetString ("Loading project..."), null);
                    busy.ShowSync (e.Project.Load);
                } catch (Exception ex) {
                    Log.Exception (ex);
                    App.Current.Dialogs.ErrorMessage (Catalog.GetString ("Could not load project:") + "\n" + ex.Message);
                    return;
                }
            }

            // FIXME
            if (e.Project.IsFakeCapture) {
                /* If it's a fake live project prompt for a video file and
                 * create a new PreviewMediaFile for this project and recreate the thumbnails */
                Log.Debug ("Importing fake live project");
                App.Current.StateController.MoveTo (NewProjectState.NAME, e.Project);
                return;
            }

            if (e.Project.Description.FileSet.Duration == null) {
                Log.Warning ("The selected project is empty. Rediscovering files");
                for (int i = 0; i < e.Project.Description.FileSet.Count; i++) {
                    e.Project.Description.FileSet [i] = App.Current.MultimediaToolkit.DiscoverFile (e.Project.Description.FileSet [i].FilePath);
                }
            }

            e.Project.UpdateEventTypesAndTimers ();
            SetProject (e.Project, ProjectType.FileProject, new CaptureSettings ());
        }