private void CreateNewConsequence(TriggerType mode, Template template)
        {
            if (template == null)
                return;

            SubProfile userProfile = Profile.GetSubProfile("user");
            if (userProfile == null)
            {
                userProfile = SubProfile.Create("user");
                Profile.AddSubProfile("user", userProfile);
            }

            XElement unwrappedTemplate = template.GetUsableTemplateDefinition();
            if (unwrappedTemplate != null)
            {
                ACalculator calculator = userProfile.AddConsequenceFromDefinition(unwrappedTemplate);
                calculator.SortOrder = -1;

                // Switch to a compatible mode
                if (!calculator.TriggersOn.Contains(this.CurrentMode))
                    if (calculator.TriggersOn.Contains(TriggerType.Repeating))
                        this.CurrentMode = TriggerType.PerDay;
                else
                    if (calculator.TriggersOn.Contains(TriggerType.OneTime))
                        this.CurrentMode = TriggerType.OneTime;

                // Create a prototype request in order to load the Details View in edit mode
                Money prototypeAmount = this.CurrentAmount;
                if (prototypeAmount == null)
                    prototypeAmount = 100;
                ConsequenceRequest prototypeRequest = new ConsequenceRequest(prototypeAmount, this.CurrentMode);
                ConsequenceResult prototypeResult = calculator.Calculate(prototypeRequest);
                DisplayConsequenceDetails(prototypeResult);
            }
        }