Esempio n. 1
0
        private static void DynamicModuleUpdatingEventHandler(IDynamicModuleUpdatingEvent @event)
        {
            if (@event == null || @event.ChangedProperties == null || @event.Item == null || @event.Item.Types == null || @event.Item.Types.Length == 0)
            {
                return;
            }

            if (@event.ChangedProperties.ContainsKey("Status"))
            {
                var statusChange = @event.ChangedProperties["Status"];
                if ((DynamicModuleStatus)statusChange.NewValue == DynamicModuleStatus.Active && (int)statusChange.OldValue == (int)DynamicModuleStatus.NotInstalled)
                {
                    var transactionName = MvcWidgetInstaller.GetTransactionName(@event.Item);

                    foreach (var moduleType in @event.Item.Types)
                    {
                        MvcWidgetInstaller.Install(@event.Item, moduleType, transactionName);
                    }
                }
            }
        }
        private static void DynamicModuleUpdatingEventHandler(IDynamicModuleUpdatingEvent @event)
        {
            if (@event == null || @event.ChangedProperties == null || @event.Item == null || @event.Item.Types == null || @event.Item.Types.Length == 0)
                return;

            if (@event.ChangedProperties.ContainsKey("Status"))
            {
                var statusChange = @event.ChangedProperties["Status"];
                if ((DynamicModuleStatus)statusChange.NewValue == DynamicModuleStatus.Active && (int)statusChange.OldValue == (int)DynamicModuleStatus.NotInstalled)
                {
                    var transactionName = MvcWidgetInstaller.GetTransactionName(@event.Item);

                    foreach (var moduleType in @event.Item.Types)
                    {
                        MvcWidgetInstaller.Install(@event.Item, moduleType, transactionName);
                    }
                }
            }
        }