Esempio n. 1
0
        void CloseOpenedProject(bool save)
        {
            if (OpenedProject == null)
            {
                return;
            }

            Log.Debug("Closing project " + OpenedProject.ID);
            if (Capturer != null)
            {
                Capturer.Close();
            }
            if (Player != null)
            {
                Player.Dispose();
            }

            if (save)
            {
                SaveProject(OpenedProject, OpenedProjectType);
            }

            if (OpenedProject != null)
            {
                OpenedProject.Clear();
            }
            OpenedProject     = null;
            OpenedProjectType = ProjectType.None;
            guiToolkit.CloseProject();
            EmitProjectChanged();
        }
        async Task <bool> CloseOpenedProject(bool save, bool goHome = true)
        {
            if (Project == null)
            {
                return(false);
            }

            Log.Debug("Closing project " + Project.ShortDescription);

            if (Capturer != null)
            {
                Capturer.Close();
            }

            bool saveOk = true;

            if (save)
            {
                saveOk = SaveProject();
            }

            if (saveOk && goHome)
            {
                return(await App.Current.StateController.MoveToHome());
            }

            return(saveOk);
        }
Esempio n. 3
0
 public void Close()
 {
     if (currentPeriod != null)
     {
         StopPeriod();
     }
     /* stopping and closing capturer */
     if (Capturer != null)
     {
         try {
             Capturer.Close();
             Capturer.Error        -= OnError;
             Capturer.DeviceChange -= OnDeviceChange;
             Capturer.Dispose();
         } catch (Exception ex) {
             Log.Exception(ex);
         }
     }
     Capturer = null;
 }
Esempio n. 4
0
        private void CloseOpenedProject(bool save)
        {
            if (save)
            {
                SaveProject(OpenedProject, OpenedProjectType);
            }

            if (OpenedProjectType != ProjectType.FileProject)
            {
                Capturer.Close();
            }
            else
            {
                Player.Close();
            }

            if (OpenedProject != null)
            {
                OpenedProject.Clear();
            }
            OpenedProject     = null;
            OpenedProjectType = ProjectType.None;
            EmitProjectChanged();
        }