Beispiel #1
0
        public virtual void WaitForChanged(IDocumentEngine engine)
        {
            Engine            = engine;
            Prefixs           = new string[] { "Backup.", "Temp." };
            DocumentExtention = engine.Option.Extention.Replace("*", "");
            Extentions        = new string[] {
                DocumentExtention,
                ".md",
                ".html",
                ".txt"
            };

            engine.Logger?.Debug(ScopeType.Writer, $"Watch Directory : {engine.Provider.BaseDirectory}");

            var watcher = new FileSystemWatcher(engine.Provider.BaseDirectory);

            watcher.NotifyFilter = NotifyFilters.Attributes |
                                   NotifyFilters.CreationTime |
                                   NotifyFilters.FileName |
                                   //NotifyFilters.LastAccess |
                                   NotifyFilters.LastWrite |
                                   NotifyFilters.Size |
                                   NotifyFilters.Security;
            watcher.Filter                = engine.Option.Extention;
            watcher.InternalBufferSize    = 8192 * 5;
            watcher.IncludeSubdirectories = true;
            watcher.EnableRaisingEvents   = true;
            watcher.Changed              += delegate(object sender, FileSystemEventArgs e)
            {
                if (!IsLocked)
                {
                    if (e.ChangeType == WatcherChangeTypes.Changed)
                    {
                        OnChangeDocument(e);
                    }
                }
            };
        }
Beispiel #2
0
        public DocumentWriter(IDocumentEngine engine, string typeOf)
        {
            Ensure.NotNullOrEmpty(typeOf, "TypeOf is empty");

            TypeOf         = typeOf;
            Engine         = engine;
            Meta           = engine.GetTypeMeta(typeOf);
            IsPartialStore = Engine.Option.SupportPartialStorage;

            if (IsPartialStore)
            {
                PartialStoreLimit = Engine.Option.SupportPartialStorageSize;
            }

            Transaction = Engine.GetThreadTransaction();

            if (Transaction == null)
            {
                Transaction = Engine.BeginInternalTransaction();
            }

            Transaction.EnterTypeOfLock(typeOf);
        }
Beispiel #3
0
 public DocumentReader(IDocumentEngine engine, string typeOf, params object[] primaryOf)
 {
     Engine = engine;
     Query  = new DocumentQuery(typeOf, primaryOf);
 }
Beispiel #4
0
 public DocumentReader(IDocumentEngine engine, string typeOf)
 {
     Engine = engine;
     Query  = new DocumentQuery(typeOf);
 }
Beispiel #5
0
 public DocumentReader(IDocumentEngine engine)
 {
     Engine = engine;
     Query  = new DocumentQuery();
 }
Beispiel #6
0
 public ObjectiksOf(IDbConnection connection, DocumentOption options = null)
 {
     Engine = Core.Get(new DocumentProvider(connection), options);
 }
Beispiel #7
0
 public ObjectiksOf(DocumentProvider documentProvider, DocumentOption options = null)
 {
     Engine = Core.Get(documentProvider, options);
 }
Beispiel #8
0
 public ObjectiksOf(string baseDirectory, DocumentOption options = null)
 {
     Engine = Core.Get(new DocumentProvider(baseDirectory), options);
 }
Beispiel #9
0
 public ObjectiksOf()
 {
     Engine = Core.Get();
 }
 public void Parse(IDocumentEngine engine, DocumentMeta meta, Document document, DocumentStorage storage)
 {
 }
 public HtmlElementHelperModel(IDataManageEngine dataManageHelper, IUnitOfWork unitOfWork, IApplicationPageEngine applicationPageEngine,
                               e_FormAction formAction, IDynamicCodeEngine dynamicCodeEngine, IDocumentEngine documentEngine,
                               List <QueryModel> listFormQueryModel, string apiSessionID, bool isEncrypted)
 {
     this.ResultOperation       = new ResultOperation();
     this.FormAction            = formAction;
     this.DataManageHelper      = dataManageHelper;
     this.UnitOfWork            = unitOfWork;
     this.applicationPageEngine = applicationPageEngine;
     this.DynamicCodeEngine     = dynamicCodeEngine;
     this.DocumentEngine        = documentEngine;
     this.ListFormQueryModel    = listFormQueryModel;
     this.ApiSessionId          = apiSessionID;
     this.IsEncrypted           = isEncrypted;
 }