Exemple #1
0
        public void UpdateFileContent(string fileName, string text)
        {
            SourceText newText = SourceText.From(text);

            foreach (var kv in this.projectDataMap)
            {
                var projectId = kv.Key;
                var docId     = this.GetDocumentId(projectId, fileName);
                if (docId != null)
                {
                    base.OnDocumentTextChanged(docId, newText, PreservationMode.PreserveIdentity);
                }
                var monoProject = GetMonoProject(projectId);
                if (monoProject != null)
                {
                    var pf = monoProject.GetProjectFile(fileName);
                    if (pf != null)
                    {
                        var mimeType = DesktopService.GetMimeTypeForUri(fileName);
                        if (TypeSystemService.CanParseProjections(monoProject, mimeType, fileName))
                        {
                            TypeSystemService.ParseProjection(new ParseOptions {
                                Project = monoProject, FileName = fileName, Content = new StringTextSource(text), BuildAction = pf.BuildAction
                            }, mimeType);
                        }
                    }
                }
            }
        }