ACAT.Lib.Extension.AppAgents.Notepad.NotepadAgentBase.getFileNameFromWindow C# (CSharp) Method

getFileNameFromWindow() private method

Parses the title of the notepad window and extracts the file name from it
private getFileNameFromWindow ( ) : String
return String
        private String getFileNameFromWindow()
        {
            var info = WindowActivityMonitor.GetForegroundWindowInfo();
            if (info.FgProcess.ProcessName.Equals("notepad", StringComparison.InvariantCultureIgnoreCase))
            {
                String[] titleParts = info.Title.Split('-');
                if (titleParts != null && titleParts.Length > 0)
                {
                    return titleParts[0];
                }
            }

            return String.Empty;
        }