示例#1
0
        private void Window_Closed(object sender, EventArgs e)
        {
            //Close all booth windows
            foreach (var i in this.BoothList.Items)
            {
                var vm = i as BoothViewModel;
                if (vm != null)
                {
                    vm.CloseBoothWindowPermanently();
                }
            }

            //Get an instance of the scope manager.  This should also create the first instance,
            //which should also configure all of the oscilloscopes.
            var scopeManager = ScopeManager.GetInstance();

            //Stop streaming on all scopes
            foreach (PicoScope s in scopeManager.Scopes)
            {
                s.ShutdownOscilloscope();
            }

            //Close all file streams from the booth save manager
            BoothSaveManager b = BoothSaveManager.GetInstance();

            b.CloseAllStreams();
        }
示例#2
0
        /// <summary>
        /// Returns the singleton instance of the booth save manager
        /// </summary>
        /// <returns>BoothSaveManager object</returns>
        public static BoothSaveManager GetInstance()
        {
            if (_instance == null)
            {
                lock (syncRoot)
                {
                    if (_instance == null)
                    {
                        _instance = new BoothSaveManager();
                    }
                }
            }

            return(_instance);
        }