Esempio n. 1
0
        private static IEnumerable <JsonConverter> GetRazorConverters()
        {
            var collection = new JsonConverterCollection();

            collection.RegisterRazorConverters();
            return(collection);
        }
Esempio n. 2
0
        public ProjectSnapshotHandleSerializationTest()
        {
            var converters = new JsonConverterCollection();

            converters.RegisterRazorConverters();
            Converters = converters.ToArray();
        }
Esempio n. 3
0
        public RazorConfigurationSerializationTest()
        {
            var converters = new JsonConverterCollection();

            converters.RegisterRazorConverters();
            Converters = converters.ToArray();
        }
Esempio n. 4
0
        public static void RegisterRazorLiveShareConverters(this JsonConverterCollection collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }

            if (collection.Contains(ProjectSnapshotHandleProxyJsonConverter.Instance))
            {
                // Already registered.
                return;
            }

            collection.Add(ProjectSnapshotHandleProxyJsonConverter.Instance);
            collection.RegisterRazorConverters();
        }
 public SerializationTest()
 {
     var languageVersion = RazorLanguageVersion.Experimental;
     var extensions = new RazorExtension[]
     {
         new SerializedRazorExtension("TestExtension"),
     };
     Configuration = RazorConfiguration.Create(languageVersion, "Custom", extensions);
     ProjectWorkspaceState = new ProjectWorkspaceState(new[]
     {
         TagHelperDescriptorBuilder.Create("Test", "TestAssembly").Build(),
     },
     LanguageVersion.LatestMajor);
     var converterCollection = new JsonConverterCollection();
     converterCollection.RegisterRazorConverters();
     Converters = converterCollection.ToArray();
 }
Esempio n. 6
0
 public static void RegisterOmniSharpRazorConverters(this JsonConverterCollection collection)
 {
     collection.RegisterRazorConverters();
     collection.Add(OmniSharpProjectSnapshotHandleJsonConverter.Instance);
 }