/// <summary>
        /// A string representation of the ManagementEventAggregationCondition including indentation
        /// </summary>
        /// <param name="aggregatedCondition">The ManagementEventAggregationCondition object</param>
        /// <param name="indentationTabs">The number of tabs to insert in front of each member</param>
        /// <returns>A string representation of the ManagementEventAggregationCondition including indentation</returns>
        public static string ToString(this ManagementEventAggregationCondition aggregatedCondition, int indentationTabs)
        {
            StringBuilder output = new StringBuilder();

            if (aggregatedCondition != null)
            {
                output.AppendLine();
                output.AddSpacesInFront(indentationTabs).AppendLine("Operator            : " + aggregatedCondition.Operator);
                output.AddSpacesInFront(indentationTabs).AppendLine("Threshold           : " + aggregatedCondition.Threshold);
                output.AddSpacesInFront(indentationTabs).Append("Window size         : " + aggregatedCondition.WindowSize);
            }

            return(output.ToString());
        }
 internal ManagementEventRuleCondition(string odataType, RuleDataSource dataSource, ManagementEventAggregationCondition aggregation) : base(odataType, dataSource)
 {
     Aggregation = aggregation;
     OdataType   = odataType ?? "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition";
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the PSEventRuleCondition class
 /// </summary>
 /// <param name="ruleCondition">The rule condition</param>
 public PSEventRuleCondition(ManagementEventRuleCondition ruleCondition)
 {
     this.DataSource           = ruleCondition.DataSource as RuleManagementEventDataSource;
     this.AggregationCondition = ruleCondition.Aggregation;
 }