/// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                    m_sda = null;
                }
                var arl = Control as AtomicReferenceLauncher;
                if (arl != null)
                {
                    arl.ChoicesMade     -= RefreshTree;
                    arl.ViewSizeChanged -= OnViewSizeChanged;
                    var view = (AtomicReferenceView)arl.MainControl;
                    view.ViewSizeChanged -= OnViewSizeChanged;
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.

            base.Dispose(disposing);
        }
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            base.Dispose(disposing);

            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (m_vc != null)
                {
                    m_vc.Dispose();
                }
                m_sda.RemoveNotification(this);
            }
            m_vc  = null;
            m_fs  = null;
            m_sda = null;
        }
Exemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Executes in two distinct scenarios.
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing">true to release both managed and unmanaged resources; false
        /// to release only unmanaged resources.</param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        /// ------------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            System.Diagnostics.Debug.WriteLineIf(!disposing, "****************** Missing Dispose() call for " + GetType().Name + " ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                // m_innerFwTextBox is part of Controls collection and will be disposed there.
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_innerFwTextBox = null;
            m_sda            = null;

            base.Dispose(disposing);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected virtual void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (m_isDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }
            }
            m_cache = null;
            m_sda   = null;

            // Dispose unmanaged resources here, whether disposing is true or false.

            m_isDisposed = true;
        }
Exemplo n.º 5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Executes in two distinct scenarios.
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing">true to release both managed and unmanaged resources; false
        /// to release only unmanaged resources.</param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        /// ------------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                // m_innerFwTextBox is part of Controls collection and will be disposed there.
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_innerFwTextBox = null;
            m_sda            = null;

            base.Dispose(disposing);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected virtual void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (m_isDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                if (m_cache.CreateModifyManager == this)
                {
                    m_cache.CreateModifyManager = null;
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_sda        = null;
            m_cache      = null;        // ensures it can't be used again without crashing.
            m_mdc        = null;
            m_recentMods = null;

            m_isDisposed = true;
        }
Exemplo n.º 7
0
 private void Dispose(bool disposing)
 {
     System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType() + " ******");
     if (disposing)
     {
         m_sda.RemoveNotification(this);
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                if (m_button != null)
                {
                    m_button.MouseDown -= new MouseEventHandler(m_button_MouseDown);
                    m_button.GotFocus  -= new EventHandler(m_button_GotFocus);
                    m_button.LostFocus -= new EventHandler(m_button_LostFocus);
                }

                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                if (m_comboTextBox != null)
                {
                    m_comboTextBox.KeyPress  -= new KeyPressEventHandler(m_comboTextBox_KeyPress);
                    m_comboTextBox.KeyDown   -= new KeyEventHandler(m_comboTextBox_KeyDown);
                    m_comboTextBox.MouseDown -= new MouseEventHandler(m_comboTextBox_MouseDown);
                    m_comboTextBox.GotFocus  -= new EventHandler(m_comboTextBox_GotFocus);
                    m_comboTextBox.LostFocus -= new EventHandler(m_comboTextBox_LostFocus);
                }
                if (m_popupTree != null)
                {
                    m_popupTree.AfterSelect    -= new TreeViewEventHandler(m_tree_AfterSelect);
                    m_popupTree.BeforeSelect   -= new TreeViewCancelEventHandler(m_popupTree_BeforeSelect);
                    m_popupTree.Load           -= new EventHandler(m_tree_Load);
                    m_popupTree.VisibleChanged -= new EventHandler(m_popupTree_VisibleChanged);
                }

                if (m_popupTree != null && !m_popupTree.IsDisposed)
                {
                    m_popupTree.Dispose();
                }
            }
            m_button       = null;       // So OnLayout knows to do nothing.
            m_comboTextBox = null;
            m_popupTree    = null;
            m_sda          = null;

            base.Dispose(disposing);
        }
Exemplo n.º 9
0
 internal override void Dispose(bool beforeDestructor)
 {
     if (beforeDestructor)
     {
         if (m_sda != null)
         {
             m_sda.RemoveNotification(this);
             m_sda = null;
         }
     }
     base.Dispose(beforeDestructor);
 }
Exemplo n.º 10
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// If a test overrides this, it should call this base implementation.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void TestTearDown()
        {
            m_sda.RemoveNotification(m_notifiee);
            m_notifiee = null;

            while (m_actionHandler.CanUndo())
            {
                m_actionHandler.Undo();
            }
            m_actionHandler.Commit();

            base.TestTearDown();
        }
Exemplo n.º 11
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected virtual void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (m_isDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_updateTimer != null)
                {
                    m_updateTimer.Stop();
                    m_updateTimer.Tick -= new EventHandler(m_updateTimer_Elapsed);
                    m_updateTimer.Dispose();
                }

                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }
                m_mediator.RemoveColleague(this);
                ParserConnection cnx = Connection;
                if (cnx != null)
                {
                    // Remove ParserConnection from the PropertyTable.
                    m_mediator.PropertyTable.SetProperty("ParserConnection", null, false);
                    m_mediator.PropertyTable.SetPropertyPersistence("ParserConnection", false);
                    m_mediator.PropertyTable.SetProperty("ParserListener", null, false);
                    m_mediator.PropertyTable.SetPropertyPersistence("ParserListener", false);
                    cnx.Dispose();
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_sda         = null;
            m_mediator    = null;
            m_cache       = null;
            m_updateTimer = null;
            m_traceSwitch = null;

            m_isDisposed = true;
        }
Exemplo n.º 12
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected virtual void Dispose(bool disposing)
        {
            Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            // Must not be run more than once.
            if (m_isDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                // other clients may now parse
                // Dispose managed resources here.
                if (m_timer != null)
                {
                    m_timer.Stop();
                    m_timer.Tick -= m_timer_Tick;
                }
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }
                m_mediator.RemoveColleague(this);
                if (m_parserConnection != null)
                {
                    m_parserConnection.Dispose();
                }
                if (m_lock != null)
                {
                    m_lock.Dispose();
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_timer            = null;
            m_sda              = null;
            m_mediator         = null;
            m_cache            = null;
            m_traceSwitch      = null;
            m_lock             = null;
            m_parserConnection = null;

            m_isDisposed = true;
        }
Exemplo n.º 13
0
        protected override void Dispose(bool disposing)
        {
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                if (SplitCont != null && !SplitCont.IsDisposed &&
                    SplitCont.Panel2 != null && !SplitCont.Panel2.IsDisposed)
                {
                    SplitCont.Panel2.SizeChanged -= new EventHandler(SplitContPanel2_SizeChanged);
                }
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                if (m_tree != null && m_tree.Parent == null)
                {
                    m_tree.Dispose();
                }

                if (m_MSAPopupTreeManager != null)
                {
                    m_MSAPopupTreeManager.AfterSelect -= new TreeViewEventHandler(m_MSAPopupTreeManager_AfterSelect);
                    m_MSAPopupTreeManager.Dispose();
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_sda  = null;
            m_tree = null;
            m_MSAPopupTreeManager = null;
            m_persistProvider     = null;

            base.Dispose(disposing);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                if (m_tree != null && m_tree.Parent == null)
                {
                    m_tree.Dispose();
                }

                if (m_pOSPopupTreeManager != null)
                {
                    m_pOSPopupTreeManager.AfterSelect -= new TreeViewEventHandler(m_pOSPopupTreeManager_AfterSelect);
                    m_pOSPopupTreeManager.Dispose();
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_sda   = null;
            m_cache = null;
            m_tree  = null;
            m_pOSPopupTreeManager = null;
            m_persistProvider     = null;
            m_pos = null;

            base.Dispose(disposing);
        }
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Do this first, before setting m_fDisposing to true.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            // m_sda COM object block removed due to crash in Finializer thread LT-6124

            if (disposing)
            {
                // Dispose managed resources here.
                if (m_sda != null)
                {
                    m_sda.RemoveNotification(this);
                }

                if (m_cb != null)
                {
                    m_cb.CheckedChanged -= new EventHandler(OnChanged);
                    m_cb.GotFocus       -= new EventHandler(m_cb_GotFocus);
                    if (m_cb.Parent == null)
                    {
                        m_cb.Dispose();
                    }
                }
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_cb  = null;
            m_sda = null;

            base.Dispose(disposing);
        }
Exemplo n.º 17
0
        //public void AssertHasNotification(int hvo, int tag, int ivMin, int cvIns, int cvDel)
        //{
        //    Assert.IsTrue(m_calls.Contains(new NotifyChangeInfo(hvo, tag, ivMin, cvIns, cvDel)));
        //}

        //public void AssertHasExactlyOneNotification(int hvo, int tag, int ivMin, int cvIns, int cvDel)
        //{
        //    Assert.AreEqual(1, m_calls.Count);
        //    AssertHasNotification(hvo, tag, ivMin, cvIns, cvDel);
        //}

        #region IDisposable Members

        public void Dispose()
        {
            m_sda.RemoveNotification(this);
            GC.SuppressFinalize(this);
        }
Exemplo n.º 18
0
		protected override void UpdateDisplayFromDatabase()
		{
			m_sda = m_cache.MainCacheAccessor;
			m_sda.RemoveNotification(this);	// Just in case...
			m_sda.AddNotification(this);
		}
Exemplo n.º 19
0
        public void TestLexSenseSideEffects()
        {
            var       senseFactory = Cache.ServiceLocator.GetInstance <ILexSenseFactory>();
            ILexEntry entry = null;
            ILexSense sense, sense2 = null, sense3 = null, sense2_1 = null, sense2_2 = null, sense2_1_1 = null, sense2_2_1 = null;

            UndoableUnitOfWorkHelper.Do("Undo add senses", "Redo add senses", m_actionHandler, () =>
            {
                entry = Cache.ServiceLocator.GetInstance <ILexEntryFactory>().Create();
                sense = senseFactory.Create();
                entry.SensesOS.Add(sense);
                Assert.AreEqual("1", sense.LexSenseOutline.Text);
                sense2 = senseFactory.Create();
                entry.SensesOS.Add(sense2);
                Assert.AreEqual("2", sense2.LexSenseOutline.Text);
                sense3 = senseFactory.Create();
                entry.SensesOS.Add(sense3);
                Assert.AreEqual("3", sense3.LexSenseOutline.Text);

                sense2_1 = senseFactory.Create();
                sense2.SensesOS.Add(sense2_1);
                Assert.AreEqual("2.1", sense2_1.LexSenseOutline.Text);

                sense2_2 = senseFactory.Create();
                sense2.SensesOS.Add(sense2_2);
                Assert.AreEqual("2.2", sense2_2.LexSenseOutline.Text);

                sense2_1_1 = senseFactory.Create();
                sense2_1.SensesOS.Add(sense2_1_1);
                Assert.AreEqual("2.1.1", sense2_1_1.LexSenseOutline.Text);

                sense2_2_1 = senseFactory.Create();
                sense2_2.SensesOS.Add(sense2_2_1);
                Assert.AreEqual("2.2.1", sense2_2_1.LexSenseOutline.Text);
            });

            m_notifiee = new Notifiee();
            var mdc = m_sda.MetaDataCache;
            var lsoFlid = mdc.GetFieldId("LexSense", "LexSenseOutline", false);

            m_sda.AddNotification(m_notifiee);
            ILexSense senseInserted = null;

            UndoableUnitOfWorkHelper.Do("Undo add another sense", "Redo add another sense", m_actionHandler, () =>
            {
                senseInserted = senseFactory.Create();
                entry.SensesOS.Insert(1, senseInserted);
                Assert.AreEqual("2", senseInserted.LexSenseOutline.Text);
            });
            int nosFlid = mdc.GetFieldId("LexEntry", "NumberOfSensesForEntry", false);

            m_notifiee.CheckChangesWeaker(new[]
            {
                new ChangeInformationTest(entry.Hvo, nosFlid, 0, 0, 0),
                new ChangeInformationTest(entry.Hvo, LexEntryTags.kflidSenses, 1, 1, 0),
                new ChangeInformationTest(sense2.Hvo, lsoFlid, 0, "2".Length, "3".Length),
                new ChangeInformationTest(sense3.Hvo, lsoFlid, 0, "3".Length, "4".Length),
                new ChangeInformationTest(sense2_1.Hvo, lsoFlid, 0, "2.1".Length, "3.1".Length),
                new ChangeInformationTest(sense2_2.Hvo, lsoFlid, 0, "2.1".Length, "3.1".Length),
                new ChangeInformationTest(sense2_1_1.Hvo, lsoFlid, 0, "2.1.1".Length, "3.1.1".Length),
                new ChangeInformationTest(sense2_2_1.Hvo, lsoFlid, 0, "2.2.1".Length, "3.2.1".Length),
            }, "insert second sense in entry");
            m_sda.RemoveNotification(m_notifiee);
            Assert.AreEqual("3.1.1", sense2_1_1.LexSenseOutline.Text);

            m_notifiee = new Notifiee();
            m_sda.AddNotification(m_notifiee);
            UndoableUnitOfWorkHelper.Do("Undo remove sense", "Redo remove sense", m_actionHandler, () =>
                                        entry.SensesOS.Remove(senseInserted));
            m_notifiee.CheckChangesWeaker(new[]
            {
                new ChangeInformationTest(entry.Hvo, nosFlid, 0, 0, 0),
                new ChangeInformationTest(entry.Hvo, LexEntryTags.kflidSenses, 1, 0, 1),
                new ChangeInformationTest(sense2.Hvo, lsoFlid, 0, "2".Length, "3".Length),
                new ChangeInformationTest(sense3.Hvo, lsoFlid, 0, "3".Length, "4".Length),
                new ChangeInformationTest(sense2_1.Hvo, lsoFlid, 0, "2.1".Length, "3.1".Length),
                new ChangeInformationTest(sense2_2.Hvo, lsoFlid, 0, "2.1".Length, "3.1".Length),
                new ChangeInformationTest(sense2_1_1.Hvo, lsoFlid, 0, "2.1.1".Length, "3.1.1".Length),
                new ChangeInformationTest(sense2_2_1.Hvo, lsoFlid, 0, "2.2.1".Length, "3.2.1".Length),
            }, "delete second sense in entry");
            m_sda.RemoveNotification(m_notifiee);
            Assert.AreEqual("2.1.1", sense2_1_1.LexSenseOutline.Text);

            m_notifiee = new Notifiee();
            m_sda.AddNotification(m_notifiee);
            UndoableUnitOfWorkHelper.Do("Undo add another sense", "Redo add another sense", m_actionHandler, () =>
            {
                senseInserted = senseFactory.Create();
                sense2.SensesOS.Insert(1, senseInserted);
                Assert.AreEqual("2.2", senseInserted.LexSenseOutline.Text);
            });
            m_notifiee.CheckChangesWeaker(new[]
            {
                new ChangeInformationTest(entry.Hvo, nosFlid, 0, 0, 0),
                new ChangeInformationTest(sense2.Hvo, LexSenseTags.kflidSenses, 1, 1, 0),
                new ChangeInformationTest(sense2_2.Hvo, lsoFlid, 0, "2.2".Length, "2.3".Length),
                new ChangeInformationTest(sense2_2_1.Hvo, lsoFlid, 0, "2.2.1".Length, "2.3.1".Length),
            }, "insert subsense in sense");
            m_sda.RemoveNotification(m_notifiee);
            Assert.AreEqual("2.3.1", sense2_2_1.LexSenseOutline.Text);

            m_notifiee = new Notifiee();
            m_sda.AddNotification(m_notifiee);
            UndoableUnitOfWorkHelper.Do("Undo get rid of sense", "Redo get rid of sense", m_actionHandler, () =>
                                        sense2.SensesOS.Remove(senseInserted));
            m_notifiee.CheckChangesWeaker(new[]
            {
                new ChangeInformationTest(entry.Hvo, nosFlid, 0, 0, 0),
                new ChangeInformationTest(sense2.Hvo, LexSenseTags.kflidSenses, 1, 0, 1),
                new ChangeInformationTest(sense2_2.Hvo, lsoFlid, 0, "2.2".Length, "2.3".Length),
                new ChangeInformationTest(sense2_2_1.Hvo, lsoFlid, 0, "2.2.1".Length, "2.3.1".Length),
            }, "remove subsense from sense");
            m_sda.RemoveNotification(m_notifiee);
            Assert.AreEqual("2.2.1", sense2_2_1.LexSenseOutline.Text);
        }
Exemplo n.º 20
0
 /// <summary> Request removal from the list of objects to notify when properties change. </summary>
 /// <param name='nchng'> </param>
 public void RemoveNotification(IVwNotifyChange nchng)
 {
     m_baseSda.RemoveNotification(nchng);
 }
Exemplo n.º 21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="_nchng"></param>
 public void RemoveNotification(IVwNotifyChange _nchng)
 {
     m_sda.RemoveNotification(_nchng);
 }
Exemplo n.º 22
0
 void BasicIPASymbolSlice_Disposed(object sender, EventArgs e)
 {
     m_sda.RemoveNotification(this);
     m_IPAMapperDocument = null;
 }
Exemplo n.º 23
0
		protected override void UpdateDisplayFromDatabase()
		{
			m_sda = m_cache.DomainDataByFlid;
			m_sda.RemoveNotification(this);	// Just in case...
			m_sda.AddNotification(this);
		}
Exemplo n.º 24
0
 protected override void UpdateDisplayFromDatabase()
 {
     m_sda = m_cache.DomainDataByFlid;
     m_sda.RemoveNotification(this);             // Just in case...
     m_sda.AddNotification(this);
 }
Exemplo n.º 25
0
 public void Dispose()
 {
     m_sda.RemoveNotification(this);
 }
Exemplo n.º 26
0
 protected override void UpdateDisplayFromDatabase()
 {
     m_sda = m_cache.MainCacheAccessor;
     m_sda.RemoveNotification(this);             // Just in case...
     m_sda.AddNotification(this);
 }