/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="T:FindCollectorEnv"/> class. /// </summary> /// <param name="vc">The view constructor.</param> /// <param name="sda">Date access to get prop values etc.</param> /// <param name="hvoRoot">The root object to display.</param> /// <param name="frag">The fragment.</param> /// <param name="vwPattern">The find/replace pattern.</param> /// <param name="searchKiller">Used to interrupt a find/replace</param> /// <remarks>If the base environment is not null, it is used for various things, /// such as obtaining 'outer object' information.</remarks> /// ------------------------------------------------------------------------------------ public FindCollectorEnv(IVwViewConstructor vc, ISilDataAccess sda, int hvoRoot, int frag, IVwPattern vwPattern, IVwSearchKiller searchKiller) : base(null, sda, hvoRoot) { m_vc = vc; m_frag = frag; m_Pattern = vwPattern; m_searchKiller = searchKiller; m_textSourceInit = VwMappedTxtSrcClass.Create(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="T:FindReplaceCollectorEnvBase"/> class. /// </summary> /// <param name="vc">The view constructor.</param> /// <param name="sda">Date access to get prop values etc.</param> /// <param name="hvoRoot">The root object to display.</param> /// <param name="frag">The fragment.</param> /// <param name="vwPattern">The find/replace pattern.</param> /// <param name="searchKiller">Used to interrupt a find/replace</param> /// <remarks>If the base environment is not null, it is used for various things, /// such as obtaining 'outer object' information.</remarks> /// ------------------------------------------------------------------------------------ public FindReplaceCollectorEnvBase(IVwViewConstructor vc, ISilDataAccess sda, int hvoRoot, int frag, IVwPattern vwPattern, IVwSearchKiller searchKiller) : base(null, sda, hvoRoot) { m_vc = vc; m_frag = frag; m_Pattern = vwPattern; m_searchKiller = searchKiller; m_textSourceInit = VwMappedTxtSrcClass.Create(); }
/// <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 underlying issue. /// /// 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 + ". ****** "); // Method can be called several times, // but the main code must not be run more than once. if (IsDisposed) { return; } if (disposing) { } // Dispose unmanaged resources here, whether disposing is true or false. if (m_textSourceInit != null) { Marshal.ReleaseComObject(m_textSourceInit); m_textSourceInit = null; } IsDisposed = true; }