コード例 #1
0
 public void CustomRoute(string uiPath, Assembly resourceAssembly, string resourceName)
 {
     CustomRoutes[uiPath] = new CustomResourceDescriptor
     {
         UiPath           = uiPath,
         ResourceAssembly = resourceAssembly,
         ResourceName     = resourceName,
     };
 }
コード例 #2
0
        private Stream GetCustomResourceStream(CustomResourceDescriptor resourceDescriptor)
        {
            var resourceName = resourceDescriptor.ResourceName;
            var stream = resourceDescriptor.ResourceAssembly.GetManifestResourceStream(resourceName);
            if (stream == null)
                throw new FileNotFoundException("Ensure the Build Action is set to \"Embedded Resource\"", resourceName);

            return stream;
        }
コード例 #3
0
        private Stream GetCustomResourceStream(CustomResourceDescriptor resourceDescriptor)
        {
            var resourceName = resourceDescriptor.ResourceName;
            var stream       = resourceDescriptor.ResourceAssembly.GetManifestResourceStream(resourceName);

            if (stream == null)
            {
                throw new FileNotFoundException("Ensure the Build Action is set to \"Embedded Resource\"", resourceName);
            }

            return(stream);
        }
コード例 #4
0
ファイル: SwaggerUiConfig.cs プロジェクト: jorbor/Swashbuckle
 public void CustomRoute(string uiPath, Assembly resourceAssembly, string resourceName)
 {
     CustomRoutes[uiPath] = new CustomResourceDescriptor
     {
         UiPath = uiPath,
         ResourceAssembly = resourceAssembly,
         ResourceName = resourceName,
     };
 }