Exemplo n.º 1
0
 /// <summary>
 /// Initializes macro editor for macro rule, loads its default value.
 /// </summary>
 private void InitMacroSettings()
 {
     if ((Rule != null) && !RequestHelper.IsPostBack())
     {
         macroEditor.Text = RuleHelper.GetMacroConditionFromRule(Rule);
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Check whether all macros in macro rule are optimized.
    /// Shows warning when not.
    /// </summary>
    private void CheckMacros()
    {
        var macroCondition = RuleHelper.GetMacroConditionFromRule(Rule);

        if (string.IsNullOrEmpty(macroCondition))
        {
            return;
        }

        var macroTree = CachedMacroRuleTrees.GetParsedTree(macroCondition);

        if ((macroTree == null) || !MacroRuleTreeAnalyzer.CanTreeBeTranslated(macroTree))
        {
            ShowWarning(ResHelper.GetString("om.macros.macro.slow"));
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// Check whether all macros in macro rule are optimized.
    /// Shows warning when not.
    /// </summary>
    private void CheckMacros()
    {
        var macroCondition = RuleHelper.GetMacroConditionFromRule(Rule);

        if (string.IsNullOrEmpty(macroCondition))
        {
            return;
        }

        var macroTree = CachedMacroRuleTrees.GetParsedTree(macroCondition);

        if ((macroTree == null) || !MacroRuleTreeAnalyzer.CanTreeBeTranslated(macroTree))
        {
            var text = string.Format(ResHelper.GetString("om.macros.macro.slow"), DocumentationHelper.GetDocumentationTopicUrl("om_macro_performance"));
            ShowWarning(text);
        }
    }