Esempio n. 1
0
 public uSyncEngine()
 {
     ContentType = new uSyncContentType();
     DataType    = new uSyncDataType();
     Dictionary  = new uSyncDictionary();
     Language    = new uSyncLanguage();
     Macro       = new uSyncMacro();
     MediaType   = new uSyncMediaType();
     Stylesheet  = new uSyncStylesheet();
     Template    = new uSyncTemplate();
     Content     = new uSyncContent();
     Media       = new uSyncMedia();
 }
Esempio n. 2
0
        public static bool TemplateChanged(XElement node)
        {
            var    hashProps = new string[] { "Name", "Alias", "Master" };
            string fileHash  = node.CalculateMD5Hash(hashProps);

            if (string.IsNullOrWhiteSpace(fileHash))
            {
                return(true);
            }

            XElement alias = node.Element("Alias");

            if (alias == null)
            {
                return(true);
            }

            if (_fileService == null)
            {
                _fileService = ApplicationContext.Current.Services.FileService;
            }

            var item = _fileService.GetTemplate(alias.Value);

            if (item == null)
            {
                return(true);
            }

            var    uT     = new uSyncTemplate();
            var    dbNode = uT.Export(item);
            string dbHash = dbNode.CalculateMD5Hash(hashProps);

            LogHelper.Debug <ChangeTracker>("Comparing: [{0}] to [{1}]",
                                            () => fileHash, () => dbHash);

            return(!fileHash.Equals(dbHash));
        }