예제 #1
0
        public bool Validate()
        {
            if (ExtensionText != null && NameText != null && !NameText.EndsWith(ExtensionText))
            {
                return(false);
            }

            if (NameText != null && PathText != null && !PathText.EndsWith(NameText))
            {
                return(false);
            }

            if (PathText != null)
            {
                FsNode parent = Parent;

                // Stop before the root node
                while (parent?.Parent != null)
                {
                    if (!PathText.StartsWith(parent.PathText))
                    {
                        return(false);
                    }

                    parent = parent.Parent;
                }
            }

            return(true);
        }