Exemple #1
0
        private static IEnumerable <JsonConverter> GetRazorConverters()
        {
            var collection = new JsonConverterCollection();

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

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

            converters.RegisterRazorConverters();
            Converters = converters.ToArray();
        }
Exemple #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();
 }
Exemple #6
0
 public static void RegisterOmniSharpRazorConverters(this JsonConverterCollection collection)
 {
     collection.RegisterRazorConverters();
     collection.Add(OmniSharpProjectSnapshotHandleJsonConverter.Instance);
 }