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

PromptCloseProject() private method

private PromptCloseProject ( CloseOpenedProjectEvent e ) : bool
e CloseOpenedProjectEvent
return bool
        bool PromptCloseProject(CloseOpenedProjectEvent e)
        {
            if (OpenedProject == null)
                return true;

            if (OpenedProjectType == ProjectType.FileProject) {
                bool ret;
                ret = App.Current.Dialogs.QuestionMessage (
                    Catalog.GetString ("Do you want to close the current project?"), null).Result;
                if (ret) {
                    CloseOpenedProject (true);
                    return true;
                }
                return false;
            } else {
                EndCaptureResponse res;

                // Check if we need to show or not the stop and save button
                bool isCapturing;
                if (Capturer.Periods == null || Capturer.Periods.Count == 0)
                    isCapturing = false;
                else
                    isCapturing = true;

                res = guiToolkit.EndCapture (isCapturing);

                /* Close project wihtout saving */
                if (res == EndCaptureResponse.Quit) {
                    CaptureFinished (true, true, false);
                    return true;
                } else if (res == EndCaptureResponse.Save) {
                    CaptureFinished (false, false, true);
                    return true;
                } else {
                    /* Continue with the current project */
                    return false;
                }
            }
        }