Beispiel #1
0
            public Document(ISymUnmanagedDocument doc)
            {
                document = doc;
                contents = new Lazy <string?>(() =>
                {
                    if (document.HasEmbeddedSource(out var isEmbedded) == 0 && isEmbedded)
                    {
                        var rawContents = document.GetEmbeddedSource().ToArray();
                        return(System.Text.Encoding.Default.GetString(rawContents));
                    }

                    return(File.Exists(Path)
                        ? File.ReadAllText(Path)
                        : null);
                });
            }