示例#1
0
        private static bool AreSystemRequirementsOK()
        {
#if DEBUG
            Stopwatch timer = new Stopwatch();
            timer.Start();
#endif
            bool result = true;

            // Check if Umbraco setup is finished
            if (Util.GetAdminUser() == null)
            {
                result = false;
            }

            // Check if Umbraco version is greater than or equal to 6.1.6
            if (Util.IsUmbraco616OrHigher() == false)
            {
                throw new Exception("Current umbraco version is not supported. Only v6.1.6 and above are supported.");
            }


#if DEBUG
            timer.Stop();
            StopwatchLogger.AddToLog(string.Format("Total elapsed time for method 'AreSystemRequirementsOK': {0}ms.", timer.ElapsedMilliseconds));
            timer.Restart();
#endif
            return(result);
        }
示例#2
0
        /// <summary>
        /// Main mathod for synchronizing document types
        /// </summary>
        public void Synchronize()
        {
            DocumentTypes.Clear();
            DocumentTypesId.Clear();
            DocumentTypesComparisonSummary.Clear();


#if DEBUG
            Stopwatch timer = new Stopwatch();
            timer.Start();
#endif
            // Check which document types have been changed
            // Does not check relations between document types (allowed childs and allowable parents) since it engages similar resources as
            // method for updating relations
            DocumentTypesComparisonSummary = DocumentTypeComparer.PreviewDocumentTypeChanges(out _hadDefaultValues);

            // store node id for existing document types in dictionary (to avoid unnecessary API calls)
            foreach (var dtItem in DocumentTypesComparisonSummary.Where(dt => dt.DocumentTypeStatus != Status.New))
            {
                if (DocumentTypesId.ContainsKey(dtItem.Alias) == false)
                {
                    DocumentTypesId.Add(dtItem.Alias, dtItem.DocumentTypeId);
                }
            }

#if DEBUG
            timer.Stop();
            StopwatchLogger.AddToLog(string.Format("Total elapsed time for method 'DocumentTypeManager.Synchronize' - only preview of type changes: {0}ms.", timer.ElapsedMilliseconds));
            timer.Restart();
#endif

            this.SynchronizeDocumentTypes(typeof(DocumentTypeBase));

#if DEBUG
            timer.Stop();
            StopwatchLogger.AddToLog(string.Format("Total elapsed time for method 'DocumentTypeManager.SynchronizeDocumentTypes': {0}ms.", timer.ElapsedMilliseconds));
            timer.Restart();
#endif

            this.SynchronizeChildNodes(typeof(DocumentTypeBase));

#if DEBUG
            timer.Stop();
            StopwatchLogger.AddToLog(string.Format("Total elapsed time for method 'DocumentTypeManager.SynchronizeChildNodes': {0}ms.", timer.ElapsedMilliseconds));
            timer.Restart();
#endif

            if (this._hadDefaultValues) // if there were default values set subscribe to Creating event in which we'll set default values.
            {
                // Subscribe to Creating event
                ContentService.Creating += ContentServiceOnCreating;
            }
        }
示例#3
0
        public static void SynchronizeUserControls()
        {
#if DEBUG
            Stopwatch timer = new Stopwatch();
            timer.Start();
#endif
            WebUserControlsManager userControlsManager = new WebUserControlsManager();
            userControlsManager.Synchronize();

#if DEBUG
            timer.Stop();
            StopwatchLogger.AddToLog(string.Format("Total elapsed time for method 'SynchronizeUserControls': {0}ms.", timer.ElapsedMilliseconds));
            timer.Restart();
#endif
        }
示例#4
0
        public static void SynchronizeMemberTypes()
        {
#if DEBUG
            Stopwatch timer = new Stopwatch();
            timer.Start();
#endif
            MemberTypeManager memberTypeManager = new MemberTypeManager();
            memberTypeManager.Synchronize();

#if DEBUG
            timer.Stop();
            StopwatchLogger.AddToLog(string.Format("Total elapsed time for method 'SynchronizeMemberTypes': {0}ms.", timer.ElapsedMilliseconds));
            timer.Restart();
#endif
        }