예제 #1
0
        /// <summary>
        /// Gets the canonical name of a style with the specified parameters.
        /// </summary>
        private static String GetCanonicalName(UvssRuleArgumentsCollection arguments, String owner, String name)
        {
            var part1 = (owner == null) ? name : String.Format("{0}.{1}", owner, name);
            var part2 = (arguments.Count > 0) ? String.Format(" ({0})", arguments) : null;

            return(part1 + part2);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UvssRule"/> class.
        /// </summary>
        /// <param name="arguments">The styling rule's argument list.</param>
        /// <param name="owner">The name of the owner of type of the attached property that this
        /// styling rule modifies, if it modifies an attached property.</param>
        /// <param name="name">The name of the dependency property that this styling rule modifies.</param>
        /// <param name="value">The styling rule's value.</param>
        /// <param name="isImportant">A value indicating whether the styling rule has the !important qualifier.</param>
        internal UvssRule(UvssRuleArgumentsCollection arguments, String owner, String name, String value, Boolean isImportant)
        {
            Contract.Require(arguments, nameof(arguments));

            this.arguments     = arguments;
            this.canonicalName = GetCanonicalName(arguments, owner, name);
            this.container     = owner;
            this.name          = name;
            this.value         = value;
            this.isImportant   = isImportant;
        }