public Tuple <String, int?> GetSymbolLocationAndLine(ItemSize symbol)
        {
            if ((symbol.Location == null) || (symbol.Location.Contains(":") == false))
            {
                return(new Tuple <string, int?>("<Unknown>", null));
            }

            string fileName = Path.GetFullPath(symbol.Location.Substring(0, symbol.Location.LastIndexOf(':')));

            int  fileLine      = -1;
            bool fileLineValid = int.TryParse(symbol.Location.Substring(symbol.Location.LastIndexOf(':') + 1), out fileLine);

            if (fileLineValid)
            {
                return(new Tuple <String, int?>(fileName, fileLine));
            }
            else
            {
                return(new Tuple <String, int?>(fileName, null));
            }
        }
예제 #2
0
        private bool FilterSymbolEntries(Object currentEntry)
        {
            ItemSize currentItem = (currentEntry as ItemSize);
            bool     isMatch     = false;

            try
            {
                if (DataSizeViewerPackage.Options.UseRegExFiltering)
                {
                    isMatch = (new Regex(mFilterString)).IsMatch(currentItem.Name);
                }
                else
                {
                    isMatch = currentItem.Name.Contains(mFilterString);
                }
            }
            catch { }

            return(isMatch &&
                   ((mShowDataSegment && currentItem.Storage.Contains("Data")) ||
                    (mShowTextSegment && currentItem.Storage.Contains("Text"))));
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Color foregroundColor = Colors.Black;

            ItemSize symbolInfo = value as ItemSize;

            if (symbolInfo != null)
            {
                if (symbolInfo.Storage.Contains("Data"))
                {
                    foregroundColor = symbolInfo.LocationExists ?
                                      DataSizeViewerPackage.Options.DataSymbolColor :
                                      DataSizeViewerPackage.Options.UnavailableDataSymbolColor;
                }
                else
                {
                    foregroundColor = symbolInfo.LocationExists ?
                                      DataSizeViewerPackage.Options.TextSymbolColor :
                                      DataSizeViewerPackage.Options.UnavailableTextSymbolColor;
                }
            }

            return(new SolidColorBrush(foregroundColor));
        }