예제 #1
0
 public RedlineSearcher(RedlineML.ObjectModel.RedlineDocument RedlineDoc, List<RedlineML.ISummaryItem> changeSummaryItems, string searchText, SearchStyle searchStyle, bool ignoreCase, RedlineTextBuilder rtb, SortedList<int, int> changePosMap)
 {
     this.m_RedlineDoc = RedlineDoc;
     this.m_changeSummaryItems = changeSummaryItems;
     this.m_searchText = searchText;
     this.m_searchStyle = searchStyle;
     m_rtb = rtb;
     m_ignoreCase = ignoreCase;
     m_changePosMap = changePosMap;
 }
        private void searchCatalogExecute()
        {
            List <TECValve> results = new List <TECValve>();

            foreach (TECValve valve in catalog)
            {
                bool hasStyle    = SearchStyle == "" || valve.Style.ToUpper() == SearchStyle.ToUpper();
                bool hasCv       = SearchCv == 0.0 || valve.Cv >= SearchCv;
                bool hasSize     = SearchSize == 0.0 || valve.Size == SearchSize;
                bool hasPressure = SearchPressure == 0.0 || valve.PressureRating > SearchPressure;
                if (hasStyle && hasCv && hasSize && hasPressure)
                {
                    results.Add(valve);
                }
            }
            Results = results;
        }
예제 #3
0
 private void UpdateVisibility(SearchStyle style)
 {
     switch (style)
     {
         case SearchStyle.ChangesOnly:
         case SearchStyle.ChangesAndSurroundingText:
             theChangeList.Visibility = System.Windows.Visibility.Visible;
             theChangeTree.Visibility = System.Windows.Visibility.Hidden;
             break;
         case SearchStyle.OriginalDocumentText:
         case SearchStyle.ModifiedDocumentText:
         case SearchStyle.AllText:
             theChangeList.Visibility = System.Windows.Visibility.Hidden;
             theChangeTree.Visibility = System.Windows.Visibility.Visible;
             break;
         default:
             break;
     }
 }
예제 #4
0
        public override void Start(Reusables reusables)
        {
            drivingNodeList = new List <DrivingNode>();
            startStyle      = GetSearchStyle(startPoint);
            endStyle        = GetSearchStyle(endPoint);

            if (startStyle == SearchStyle.OnRoad && endStyle == SearchStyle.OnRoad)
            {
                RoadToRoad(startPoint, endPoint, reusables);
            }
            else if (startStyle == SearchStyle.OffRoad && endStyle == SearchStyle.OnRoad)
            {
                OffRoadToOnRoad(startPoint, endPoint, reusables);
            }
            else if (startStyle == SearchStyle.OnRoad && endStyle == SearchStyle.OffRoad)
            {
                OnRoadToOffRoad(startPoint, endPoint, reusables);
            }
            else if (startStyle == SearchStyle.OffRoad && endStyle == SearchStyle.OffRoad)
            {
                OffRoadToOffRoad(startPoint, endPoint, reusables);
            }

            //If we couldnt find it we will clear the list
            if (drivingNodeList.Count > 0)
            {
                if (drivingNodeList[0].GetLocationX() != endPoint.X || drivingNodeList[0].GetLocationY() != endPoint.Y)
                {
                    drivingNodeList.Clear();
                }
            }

            CalculateCorners();

            completed = true;
        }
예제 #5
0
		public void DoSearch(string searchText, SearchStyle searchStyle, bool ignoreCase)
		{
			RedlineSearcher rs = new RedlineSearcher(RedlineDoc, m_changeSummaryItems, searchText, searchStyle, ignoreCase, m_rtb, _changePosMap);
			SearchResult = rs.Execute();
		}