public OpenedFile CreateFile(FilePath filePath, byte[] contents)
 {
     File.WriteAllBytes(filePath.FullPath, contents);
     var file = new FileServiceOpenedFile(_extensionHost, filePath);
     _openedFiles.Add(file);
     OnFileCreated(new FileEventArgs(file));
     return file;
 }
Example #2
0
        public OpenedFile CreateFile(FilePath filePath, byte[] contents)
        {
            File.WriteAllBytes(filePath.FullPath, contents);
            var file = new FileServiceOpenedFile(_extensionHost, filePath);

            _openedFiles.Add(file);
            OnFileCreated(new FileEventArgs(file));
            return(file);
        }
        public OpenedFile OpenFile(FilePath filePath)
        {
            var file = GetOpenedFile(filePath);
            if (file == null)
            {
                file = new FileServiceOpenedFile(_extensionHost, filePath);

                if (_extensionHost.CurrentSolution != null)
                {
                    var projectFile = _extensionHost.CurrentSolution.FindProjectFile(file.FilePath);
                    if (projectFile != null)
                    {
                        file.Dependencies.AddRange(projectFile.Dependencies);
                    }
                }

                _openedFiles.Add(file);
                OnFileOpened(new FileEventArgs(file));
            }
            return file;
        }
Example #4
0
        public OpenedFile OpenFile(FilePath filePath)
        {
            var file = GetOpenedFile(filePath);

            if (file == null)
            {
                file = new FileServiceOpenedFile(_extensionHost, filePath);

                if (_extensionHost.CurrentSolution != null)
                {
                    var projectFile = _extensionHost.CurrentSolution.FindProjectFile(file.FilePath);
                    if (projectFile != null)
                    {
                        file.Dependencies.AddRange(projectFile.Dependencies);
                    }
                }

                _openedFiles.Add(file);
                OnFileOpened(new FileEventArgs(file));
            }
            return(file);
        }