GetRemovablesFromProcess() статический приватный Метод

Returns a list of removables for a given process
static private GetRemovablesFromProcess ( string process, List rules ) : List
process string
rules List
Результат List
        private static string CleanWindowTitle(string process, string websiteTitle)
        {
            var removables = BaseRules.GetRemovablesFromProcess(process, BaseRules.WebsiteRules);

            // remove programname from title
            if (removables != null && removables.Count > 0)
            {
                foreach (var r in removables)
                {
                    websiteTitle = Regex.Replace(websiteTitle, r, "").Trim();
                }
            }
            return(websiteTitle.Trim());
        }
Пример #2
0
        public static string CleanWindowTitle(string process, string title)
        {
            // run basis cleaning
            title = BaseRules.RunBasisArtifactTitleCleaning(title);

            var removables = BaseRules.GetRemovablesFromProcess(process, BaseRules.ArtifactRules);

            // remove programname from title
            if (removables != null && removables.Count > 0)
            {
                foreach (var r in removables)
                {
                    title = Regex.Replace(title, r, "").Trim();
                }
            }

            // remove path
            if (title.Contains("/") || title.Contains("\\"))
            {
                title = GetFileNameFromPath(title);
            }

            return(title.Trim());
        }