Inheritance: IDisposable
示例#1
0
        public FileModel(FileAndType ft, object content, FileAndType original = null, IFormatter serializer = null)
        {
            OriginalFileAndType = original ?? ft;

            if (OriginalFileAndType.File.StartsWith("~/"))
            {
                Key = OriginalFileAndType.File;
            }
            else
            {
                Key = "~/" + OriginalFileAndType.File;
            }

            FileAndType    = ft;
            ModelWithCache = new ModelWithCache(content, serializer);
        }
示例#2
0
文件: FileModel.cs 项目: dotnet/docfx
        public FileModel(FileAndType ft, object content, FileAndType original = null, IFormatter serializer = null)
        {
            OriginalFileAndType = original ?? ft;

            if (OriginalFileAndType.File.StartsWith("~/"))
            {
                Key = OriginalFileAndType.File;
            }
            else
            {
                Key = "~/" + OriginalFileAndType.File;
            }

            FileAndType = ft;
            ModelWithCache = new ModelWithCache(content, serializer);
        }
示例#3
0
        public FileModel(FileAndType ft, object content, FileAndType original, IFormatter serializer, string key)
        {
            OriginalFileAndType = original ?? ft;
            Key = key;
            if (Key == null)
            {
                if (OriginalFileAndType.File.StartsWith("~/", StringComparison.Ordinal))
                {
                    Key = OriginalFileAndType.File;
                }
                else
                {
                    Key = "~/" + OriginalFileAndType.File;
                }
            }

            FileAndType    = ft;
            ModelWithCache = new ModelWithCache(content, serializer);
        }
示例#4
0
 public void Dispose()
 {
     ModelWithCache.Dispose();
 }
示例#5
0
 private static void OnLruRemoving(ModelWithCache m)
 {
     try
     {
         m.Serialize();
     }
     catch (Exception ex)
     {
         Logger.LogWarning($"Unable to serialize model, details:{ex.ToString()}", file: m.File);
     }
 }