Exemple #1
0
        public IFileObject ResolveFile(string name)
        {
            if (name.Length > 0)
            {
                name = FormatPath(name);
            }
            Query query = new Query(TableName,
                                    new QueryConditionNode((QField)KeyFieldName,
                                                           Conditions.Equal, (QConst)name));
            IDictionary fileData = Dalc.LoadRecord(query);

            if (fileData != null)
            {
                return((IFileObject)FileSystemHelper.SetFileProperties(new DalcFileObject(this), fileData));
            }
            else
            {
                IFileObject fileObj = new DalcFileObject(name, FileType.Imaginary, this);
                if (name.Length == 0)
                {
                    fileObj.CreateFolder();
                }
                return(fileObj);
            }
        }
Exemple #2
0
        /// <summary>
        /// Method fills DalcFileContent instance by data from storage they exists
        /// </summary>
        /// <param name="fileContent">DalcFileContent instance</param>
        /// <param name="name">Filename</param>
        /// <returns></returns>
        public DalcFileContent GetContent(DalcFileContent fileContent, string name)
        {
            if (name.Length > 0)
            {
                name = FormatPath(name);
            }
            Query q = new Query(ContentTableName,
                                new QueryConditionNode((QField)KeyFieldName,
                                                       Conditions.Equal, (QConst)name));
            IDictionary contentData = Dalc.LoadRecord(q);

            if (contentData != null)
            {
                fileContent = FileSystemHelper.SetContentProperties(fileContent, contentData);
            }
            return(fileContent);
        }
Exemple #3
0
 public IDictionary LoadRecord(IDictionary <string, object> context)
 {
     return(Dalc.LoadRecord(PrepareQuery(context)));
 }