AvalonStudio.Projects.FileSystemProject.AddFile C# (CSharp) Method

AddFile() public method

public AddFile ( string fullPath ) : void
fullPath string
return void
        public void AddFile(string fullPath)
        {
            var folder = FindFolder(Path.GetDirectoryName(fullPath) + "\\");

            var sourceFile = File.FromPath(this, folder, fullPath.ToPlatformPath());
            SourceFiles.InsertSorted(sourceFile);

            if (folder != null)
            {
                if (folder.Location == Project.CurrentDirectory)
                {
                    Project.Items.InsertSorted(sourceFile);
                    sourceFile.Parent = Project;
                }
                else
                {
                    folder.Items.InsertSorted(sourceFile);
                    sourceFile.Parent = folder;
                }

                FileAdded?.Invoke(this, new EventArgs());
            }
        }