示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Answer true if they are the 'same' finder (will find the same strings).
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        public virtual bool SameFinder(IStringFinder other)
        {
            CheckDisposed();

            LayoutFinder otherLf = other as LayoutFinder;

            if (otherLf == null)
            {
                return(false);
            }
            string colSpecLabel  = XmlUtils.GetManditoryAttributeValue(m_colSpec, "label");
            string otherLfLabel  = XmlUtils.GetManditoryAttributeValue(otherLf.m_colSpec, "label");
            string colSpecLabel2 = XmlUtils.GetOptionalAttributeValue(m_colSpec, "headerlabel");
            string otherLfLabel2 = XmlUtils.GetOptionalAttributeValue(otherLf.m_colSpec, "headerlabel");

            return(SameStrings(otherLf.m_layoutName, this.m_layoutName) &&
                   otherLf.m_sda == this.m_sda
                   // XmlUtils.NodesMatch() is too strict a comparison for identifying column configurations that will
                   // display the same value (e.g. we don't care about differences in width), causing us to
                   // lose the sort arrow when switching between tools sharing common columns (LT-2858).
                   // For now, just assume that columns with the same label will display the same value.
                   // If this proves too loose for a particular column, try implementing a sortmethod instead.
//				&& XmlUtils.NodesMatch(m_colSpec, otherLf.m_colSpec);
                   && (colSpecLabel == otherLfLabel ||
                       colSpecLabel == otherLfLabel2 ||
                       colSpecLabel2 == otherLfLabel ||
                       (colSpecLabel2 == otherLfLabel2) && otherLfLabel2 != null));
        }
示例#2
0
        /// <summary>
        /// Same if it is the same type for the same flid and DA.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public override bool SameFinder(IStringFinder other)
        {
            OwnIntPropFinder other2 = other as OwnIntPropFinder;

            if (other2 == null)
            {
                return(false);
            }
            return(other2.m_flid == this.m_flid && other2.m_sda == this.m_sda);
        }
示例#3
0
 /// <summary>
 /// Answer true if they are the 'same' finder (will find the same strings).
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public override bool SameFinder(IStringFinder other)
 {
     if (other is IntCompareFinder)
     {
         return(base.SameFinder(other));
     }
     else
     {
         return(false);
     }
 }
示例#4
0
        /// <summary>
        /// Answer true if they are the 'same' finder (will find the same strings).
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public override bool SameFinder(IStringFinder other)
        {
            if (other is SortMethodFinder)
            {
                var smf = other as SortMethodFinder;
                return(m_sMethodName == smf.m_sMethodName && base.SameFinder(other) &&
                       m_wsName == smf.m_wsName);
            }

            return(false);
        }
示例#5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Answer true if they are the 'same' finder (will find the same strings).
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        public virtual bool SameFinder(IStringFinder other)
        {
            var otherLf = other as LayoutFinder;

            if (otherLf == null)
            {
                return(false);
            }
            return(SameLayoutName(otherLf) &&
                   SameData(otherLf) &&
                   SameConfiguration(otherLf));
        }
示例#6
0
        /// <summary>
        /// Answer true if they are the 'same' finder (will find the same strings).
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public override bool SameFinder(IStringFinder other)
        {
            CheckDisposed();

            if (other is SortMethodFinder)
            {
                SortMethodFinder smf = other as SortMethodFinder;
                return(m_sMethodName == smf.m_sMethodName && base.SameFinder(other) &&
                       m_wsName == smf.m_wsName);
            }
            else
            {
                return(false);
            }
        }
示例#7
0
		/// ------------------------------------------------------------------------------------------
		/// <summary>
		/// Inits the XML.
		/// </summary>
		/// <param name="node">The node.</param>
		/// ------------------------------------------------------------------------------------------
		public override void InitXml(XmlNode node)
		{
			base.InitXml(node);
			m_finder = DynamicLoader.RestoreFromChild(node, "finder") as IStringFinder;
			m_matcher = DynamicLoader.RestoreFromChild(node, "matcher") as IMatcher;
		}
示例#8
0
		/// <summary>
		/// Normal constructor.
		/// </summary>
		/// <param name="finder"></param>
		/// <param name="matcher"></param>
		public FilterBarCellFilter(IStringFinder finder, IMatcher matcher)
		{
			m_finder = finder;
			m_matcher = matcher;
		}
示例#9
0
		/// <summary>
		/// Same if it is the same type for the same flid and DA.
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public override bool SameFinder(IStringFinder other)
		{
			OneIndirectAtomMlPropFinder other2 = other as OneIndirectAtomMlPropFinder;
			if (other2 == null)
				return false;
			return other2.m_flidAtom == this.m_flidAtom && other2.m_sda == this.m_sda
				&& other2.m_flidString == this.m_flidString && other2.m_ws == this.m_ws;
		}
示例#10
0
		/// <summary>
		/// Same if it is the same type for the same flid and DA, etc.
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public override bool SameFinder(IStringFinder other)
		{
			MultiIndirectMlPropFinder other2 = other as MultiIndirectMlPropFinder;
			if (other2 == null)
				return false;
			return SameVec(other2.m_flidVec, this.m_flidVec) && other2.m_sda == this.m_sda
				&& other2.m_flidString == this.m_flidString && other2.m_ws == this.m_ws;
		}
示例#11
0
		/// <summary>
		/// Same if it is the same type for the same flid and DA.
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public override bool SameFinder(IStringFinder other)
		{
			OwnMonoPropFinder other2 = other as OwnMonoPropFinder;
			if (other2 == null)
				return false;
			return other2.m_flid == this.m_flid && other2.m_sda == this.m_sda;
		}
示例#12
0
		/// <summary>
		/// Answer true if they are the 'same' finder (will find the same strings).
		/// </summary>
		/// <param name="other">The other.</param>
		/// <returns></returns>
		public abstract bool SameFinder(IStringFinder other);
示例#13
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:StringFinderCompare"/> class.
		/// </summary>
		/// <param name="finder">The finder.</param>
		/// <param name="subComp">The sub comp.</param>
		/// ------------------------------------------------------------------------------------
		public StringFinderCompare(IStringFinder finder, IComparer subComp)
		{
			m_finder = finder;
			m_subComp = subComp;
			m_fSortedFromEnd = false;
			m_fSortedByLength = false;
		}
示例#14
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Inits the XML.
		/// </summary>
		/// <param name="node">The node.</param>
		/// ------------------------------------------------------------------------------------
		public void InitXml(XmlNode node)
		{
			m_finder = DynamicLoader.RestoreFromChild(node, "finder") as IStringFinder;
			m_subComp = DynamicLoader.RestoreFromChild(node, "comparer") as IComparer;
			m_fSortedFromEnd = XmlUtils.GetOptionalBooleanAttributeValue(node, "sortFromEnd", false);
			m_fSortedByLength = XmlUtils.GetOptionalBooleanAttributeValue(node, "sortByLength", false);
		}
示例#15
0
		/// <summary/>
		protected virtual void Dispose(bool fDisposing)
		{
			Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType() + " *******");
			if (fDisposing && !IsDisposed)
			{
				// dispose managed and unmanaged objects
				var disposable = m_finder as IDisposable;
				if (disposable != null)
					disposable.Dispose();
			}
			m_finder = null;
			m_cache = null;
			m_colSpec = null;
			m_bv = null;
			m_app = null;
			IsDisposed = true;
		}
示例#16
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Answer true if they are the 'same' finder (will find the same strings).
		/// </summary>
		/// <param name="other">The other.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public virtual bool SameFinder(IStringFinder other)
		{
			var otherLf = other as LayoutFinder;
			if (otherLf == null)
				return false;
			return SameLayoutName(otherLf)
				&& SameData(otherLf)
				&& SameConfiguration(otherLf);
		}
示例#17
0
		/// <summary>
		/// Answer true if they are the 'same' finder (will find the same strings).
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public override bool SameFinder(IStringFinder other)
		{
			if (other is SortMethodFinder)
			{
				var smf = other as SortMethodFinder;
				return m_sMethodName == smf.m_sMethodName && base.SameFinder(other)
					&& m_wsName == smf.m_wsName;
			}

			return false;
		}
示例#18
0
		/// <summary>
		/// Answer true if they are the 'same' finder (will find the same strings).
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public override bool SameFinder(IStringFinder other)
		{
			CheckDisposed();

			if (other is SortMethodFinder)
			{
				SortMethodFinder smf = other as SortMethodFinder;
				return m_sMethodName == smf.m_sMethodName && base.SameFinder(other)
					&& m_wsName == smf.m_wsName;
			}
			else
			{
				return false;
			}
		}
示例#19
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Answer true if they are the 'same' finder (will find the same strings).
		/// </summary>
		/// <param name="other">The other.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public virtual bool SameFinder(IStringFinder other)
		{
			CheckDisposed();

			LayoutFinder otherLf = other as LayoutFinder;
			if (otherLf == null)
				return false;
			string colSpecLabel = XmlUtils.GetManditoryAttributeValue(m_colSpec, "label");
			string otherLfLabel = XmlUtils.GetManditoryAttributeValue(otherLf.m_colSpec, "label");
			string colSpecLabel2 = XmlUtils.GetOptionalAttributeValue(m_colSpec, "headerlabel");
			string otherLfLabel2 = XmlUtils.GetOptionalAttributeValue(otherLf.m_colSpec, "headerlabel");
			return SameStrings(otherLf.m_layoutName, this.m_layoutName)
				&& otherLf.m_sda == this.m_sda
				// XmlUtils.NodesMatch() is too strict a comparison for identifying column configurations that will
				// display the same value (e.g. we don't care about differences in width), causing us to
				// lose the sort arrow when switching between tools sharing common columns (LT-2858).
				// For now, just assume that columns with the same label will display the same value.
				// If this proves too loose for a particular column, try implementing a sortmethod instead.
//				&& XmlUtils.NodesMatch(m_colSpec, otherLf.m_colSpec);
				&& (colSpecLabel == otherLfLabel ||
					colSpecLabel == otherLfLabel2 ||
					colSpecLabel2 == otherLfLabel ||
					(colSpecLabel2 == otherLfLabel2) && otherLfLabel2 != null);
		}
示例#20
0
		/// <summary>
		/// Answer true if they are the 'same' finder (will find the same strings).
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public override bool SameFinder(IStringFinder other)
		{
			CheckDisposed();

			if (other is IntCompareFinder)
			{
				return base.SameFinder(other);
			}
			else
			{
				return false;
			}
		}
示例#21
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;

			if (disposing)
			{
				// Dispose managed resources here.
				// We didn't make these either, but we need to deal with them.
				// No. These belong to the RecordList.
				//if (m_finder != null && (m_finder is IDisposable))
				//	(m_finder as IDisposable).Dispose();
				//if (m_sorter != null && (m_sorter is IDisposable))
				//	(m_sorter as IDisposable).Dispose();
				//if (m_filter != null)
				//	(m_filter as IDisposable).Dispose();
				//if (m_matcher != null && m_matcher is IDisposable)
				//	(m_matcher as IDisposable).Dispose();
			}

			// Dispose unmanaged resources here, whether disposing is true or false.
			m_viewSpec = null;
			m_combo = null; // We didn't create it, so let whoever did dispose it.
			m_finder = null;
			m_sorter = null;
			m_filter = null;
			m_matcher = null;

			m_isDisposed = true;
		}
示例#22
0
		private void EnsureFinder()
		{
			if (m_finder == null)
				m_finder = LayoutFinder.CreateFinder(m_cache, m_colSpec, m_bv.BrowseView.Vc, m_app);
		}
示例#23
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;

			if (disposing)
			{
				// Dispose managed resources here.
				//if (m_subComp != null && m_subComp is IDisposable)
				//	(m_subComp as IDisposable).Dispose();
				//if (m_finder is IDisposable)
				//	(m_finder as IDisposable).Dispose();
				if (m_objToKey != null)
					m_objToKey.Clear();
			}

			// Dispose unmanaged resources here, whether disposing is true or false.
			m_subComp = null;
			m_finder = null;
			m_objToKey = null;

			m_isDisposed = true;
		}