public bool DocNameExist(string name) { if (DocDict != null) { name = name.ToUpper(); return(DocDict.ContainsKey(name)); } return(false); }
public Task <IDocument> CreateDocumentAsync(string name, CancellationToken ct) { string path = System.IO.Path.Combine(AbsolutePath, name); LocalDiskDocument ldd = DocDict.Select(x => x.Value).Where(x => x.AbsolutePath == path).FirstOrDefault(); if (ldd == null) { ldd = LocalDiskDocument.RequestTracked(new FileInfo(path), Chain, FileSystem, _Parent, ColDict, DocDict); } return(Task.FromResult <IDocument>(ldd)); }
public void Test_DocDict_4() { using (var app = new AzosApplication(null, BASE_CONF)) { var doc = new DocDict(); doc.IMin = 1000; doc.DDict = new Dictionary <string, DocCompositeField> { { "x", null }, { "y", null }, { "a", new DocCompositeField { D1 = new DocDirectField { S1 = "key" } } }, { "b", new DocCompositeField { D1 = new DocDirectField { S1 = "key" } } } }; Aver.IsNull(doc.Validate(app)); } }
public void Test_DocDict_3() { using (var app = new AzosApplication(null, BASE_CONF)) { var doc = new DocDict(); doc.IMin = 1000; doc.DDict = new Dictionary <string, DocCompositeField> { { "a", new DocCompositeField { D1 = new DocDirectField { S1 = "kwerweey" } } }, { "b", new DocCompositeField { D1 = new DocDirectField { S1 = "key" } } } }; var ve = doc.Validate(app); Aver.IsNotNull(ve); if (ve is FieldValidationException fve) { Console.WriteLine(fve.Message); Aver.IsTrue(fve.Message.Contains("list")); } else { Aver.Fail("Not a FVExcp"); } doc.DDict["a"].D1.S1 = "key"; ve = doc.Validate(app); Aver.IsNull(ve); } }
public void Test_DocDict_2() { using (var app = new AzosApplication(null, BASE_CONF)) { var doc = new DocDict(); doc.IMin = -100; doc.DDict = new Dictionary <string, DocCompositeField> { { "a", new DocCompositeField { D1 = new DocDirectField { S1 = "key" } } }, { "b", new DocCompositeField { D1 = new DocDirectField { S1 = "key" } } } }; var ve = doc.Validate(app); Aver.IsNotNull(ve); if (ve is FieldValidationException fve) { fve.Message.See(); Aver.IsTrue(fve.Message.Contains("min")); } else { Aver.Fail(Constants.ERR_NOT_FVEXCP); } doc.IMin = 5000; ve = doc.Validate(app); Aver.IsNull(ve); } }
internal override void RemoveFromDict() { DocDict?.Remove(RelativePath); }