UnityEditor.RenameOverlay.EatInvalidChars C# (CSharp) Method

EatInvalidChars() private method

private EatInvalidChars ( ) : void
return void
        private void EatInvalidChars()
        {
            if (this.isRenamingFilename)
            {
                Event current = Event.current;
                if ((GUIUtility.keyboardControl == this.m_TextFieldControlID) && (current.GetTypeForControl(this.m_TextFieldControlID) == EventType.KeyDown))
                {
                    string msg = "";
                    string invalidFilenameChars = EditorUtility.GetInvalidFilenameChars();
                    if (invalidFilenameChars.IndexOf(current.character) > -1)
                    {
                        msg = "A file name can't contain any of the following characters:\t" + invalidFilenameChars;
                    }
                    if (msg != "")
                    {
                        current.Use();
                        this.ShowMessage(msg);
                    }
                    else
                    {
                        this.RemoveMessage();
                    }
                }
                if (current.type == EventType.Repaint)
                {
                    Rect screenRect = this.GetScreenRect();
                    if (!Mathf.Approximately(this.m_LastScreenPosition.x, screenRect.x) || !Mathf.Approximately(this.m_LastScreenPosition.y, screenRect.y))
                    {
                        this.RemoveMessage();
                    }
                    this.m_LastScreenPosition = screenRect;
                }
            }
        }