Exemplo n.º 1
0
        public virtual RuleConfiguration VisitRuleConfiguration(RuleConfiguration node)
        {
            if (node != null)
            {
            }

            return(node);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RuleConfiguration" /> class from the specified instance.
        /// </summary>
        /// <param name="other">
        /// The instance from which the new instance is to be initialized.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="other" /> is null.
        /// </exception>
        public RuleConfiguration(RuleConfiguration other)
        {
            if (other == null)
            {
                throw new ArgumentNullException(nameof(other));
            }

            Init(other.Enabled, other.DefaultLevel, other.Parameters);
        }
Exemplo n.º 3
0
        private void Init(string id, Message name, Message shortDescription, Message fullDescription, IDictionary <string, string> messageStrings, IDictionary <string, string> richMessageStrings, RuleConfiguration configuration, Uri helpUri, Message help, IDictionary <string, SerializedPropertyInfo> properties)
        {
            Id = id;
            if (name != null)
            {
                Name = new Message(name);
            }

            if (shortDescription != null)
            {
                ShortDescription = new Message(shortDescription);
            }

            if (fullDescription != null)
            {
                FullDescription = new Message(fullDescription);
            }

            if (messageStrings != null)
            {
                MessageStrings = new Dictionary <string, string>(messageStrings);
            }

            if (richMessageStrings != null)
            {
                RichMessageStrings = new Dictionary <string, string>(richMessageStrings);
            }

            if (configuration != null)
            {
                Configuration = new RuleConfiguration(configuration);
            }

            if (helpUri != null)
            {
                HelpUri = new Uri(helpUri.OriginalString, helpUri.IsAbsoluteUri ? UriKind.Absolute : UriKind.Relative);
            }

            if (help != null)
            {
                Help = new Message(help);
            }

            if (properties != null)
            {
                Properties = new Dictionary <string, SerializedPropertyInfo>(properties);
            }
        }
Exemplo n.º 4
0
        private void Init(string id, Message name, Message shortDescription, Message fullDescription, IDictionary <string, string> messageStrings, IDictionary <string, string> richMessageStrings, RuleConfiguration configuration, FileLocation helpLocation, Message help, IDictionary <string, SerializedPropertyInfo> properties)
        {
            Id = id;
            if (name != null)
            {
                Name = new Message(name);
            }

            if (shortDescription != null)
            {
                ShortDescription = new Message(shortDescription);
            }

            if (fullDescription != null)
            {
                FullDescription = new Message(fullDescription);
            }

            if (messageStrings != null)
            {
                MessageStrings = new Dictionary <string, string>(messageStrings);
            }

            if (richMessageStrings != null)
            {
                RichMessageStrings = new Dictionary <string, string>(richMessageStrings);
            }

            if (configuration != null)
            {
                Configuration = new RuleConfiguration(configuration);
            }

            if (helpLocation != null)
            {
                HelpLocation = new FileLocation(helpLocation);
            }

            if (help != null)
            {
                Help = new Message(help);
            }

            if (properties != null)
            {
                Properties = new Dictionary <string, SerializedPropertyInfo>(properties);
            }
        }
Exemplo n.º 5
0
        private void Init(string id, string name, string shortDescription, string fullDescription, IDictionary <string, string> messageFormats, RuleConfiguration configuration, ResultLevel defaultLevel, Uri helpUri, IDictionary <string, SerializedPropertyInfo> properties)
        {
            Id               = id;
            Name             = name;
            ShortDescription = shortDescription;
            FullDescription  = fullDescription;
            if (messageFormats != null)
            {
                MessageFormats = new Dictionary <string, string>(messageFormats);
            }

            Configuration = configuration;
            DefaultLevel  = defaultLevel;
            if (helpUri != null)
            {
                HelpUri = new Uri(helpUri.OriginalString, helpUri.IsAbsoluteUri ? UriKind.Absolute : UriKind.Relative);
            }

            if (properties != null)
            {
                Properties = new Dictionary <string, SerializedPropertyInfo>(properties);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Rule" /> class from the supplied values.
 /// </summary>
 /// <param name="id">
 /// An initialization value for the <see cref="P: Id" /> property.
 /// </param>
 /// <param name="name">
 /// An initialization value for the <see cref="P: Name" /> property.
 /// </param>
 /// <param name="shortDescription">
 /// An initialization value for the <see cref="P: ShortDescription" /> property.
 /// </param>
 /// <param name="fullDescription">
 /// An initialization value for the <see cref="P: FullDescription" /> property.
 /// </param>
 /// <param name="messageFormats">
 /// An initialization value for the <see cref="P: MessageFormats" /> property.
 /// </param>
 /// <param name="configuration">
 /// An initialization value for the <see cref="P: Configuration" /> property.
 /// </param>
 /// <param name="defaultLevel">
 /// An initialization value for the <see cref="P: DefaultLevel" /> property.
 /// </param>
 /// <param name="helpUri">
 /// An initialization value for the <see cref="P: HelpUri" /> property.
 /// </param>
 /// <param name="properties">
 /// An initialization value for the <see cref="P: Properties" /> property.
 /// </param>
 public Rule(string id, string name, string shortDescription, string fullDescription, IDictionary <string, string> messageFormats, RuleConfiguration configuration, ResultLevel defaultLevel, Uri helpUri, IDictionary <string, SerializedPropertyInfo> properties)
 {
     Init(id, name, shortDescription, fullDescription, messageFormats, configuration, defaultLevel, helpUri, properties);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Rule" /> class from the supplied values.
 /// </summary>
 /// <param name="id">
 /// An initialization value for the <see cref="P: Id" /> property.
 /// </param>
 /// <param name="name">
 /// An initialization value for the <see cref="P: Name" /> property.
 /// </param>
 /// <param name="shortDescription">
 /// An initialization value for the <see cref="P: ShortDescription" /> property.
 /// </param>
 /// <param name="fullDescription">
 /// An initialization value for the <see cref="P: FullDescription" /> property.
 /// </param>
 /// <param name="messageStrings">
 /// An initialization value for the <see cref="P: MessageStrings" /> property.
 /// </param>
 /// <param name="richMessageStrings">
 /// An initialization value for the <see cref="P: RichMessageStrings" /> property.
 /// </param>
 /// <param name="configuration">
 /// An initialization value for the <see cref="P: Configuration" /> property.
 /// </param>
 /// <param name="helpUri">
 /// An initialization value for the <see cref="P: HelpUri" /> property.
 /// </param>
 /// <param name="help">
 /// An initialization value for the <see cref="P: Help" /> property.
 /// </param>
 /// <param name="properties">
 /// An initialization value for the <see cref="P: Properties" /> property.
 /// </param>
 public Rule(string id, Message name, Message shortDescription, Message fullDescription, IDictionary <string, string> messageStrings, IDictionary <string, string> richMessageStrings, RuleConfiguration configuration, Uri helpUri, Message help, IDictionary <string, SerializedPropertyInfo> properties)
 {
     Init(id, name, shortDescription, fullDescription, messageStrings, richMessageStrings, configuration, helpUri, help, properties);
 }
Exemplo n.º 8
0
 public bool ValueEquals(RuleConfiguration other) => ValueComparer.Equals(this, other);