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 StylesheetChanged(XElement node)
        {
            var    hashProps = new string[] { "Name", "FileName", "Properties" };
            string fileHash  = node.CalculateMD5Hash(hashProps);

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

            XElement name = node.Element("Name");

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

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

            var item = _fileService.GetStylesheetByName(name.Value);

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

            var uStyle = new uSyncStylesheet();
            var dbNode = uStyle.Export(item);
            var dbHash = dbNode.CalculateMD5Hash(hashProps);

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

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