コード例 #1
0
        /// <summary>
        /// Using the control and builder, constructs the final parameter based on what the user has selected.
        /// </summary>
        /// <returns>The parameter or null if no parameter can be provided.</returns>
        public virtual IParameter GetParameter()
        {
            var values = Values;

            if (Parser != null && values != null)
            {
                values = Parser.Parse(values);
            }
            return(SelectedBuilder.Build(SelectedPath, values));
        }
コード例 #2
0
            /// <summary>
            /// Considered equal when the path, builder and parser are equal.
            /// Note: value is ignored in equality test.
            /// </summary>
            public bool Equals(IPartView other)
            {
                if (other == null || !(other is IPartViewNode))
                {
                    return(false);
                }

                var node = (IPartViewNode)other;

                return(SelectedPath.Equals(node.SelectedPath) &&
                       SelectedBuilder.Equals(node.SelectedBuilder) &&
                       dbqf.Parsers.Parser.Equals(Parser, node.Parser));
            }
コード例 #3
0
        /// <summary>
        /// AdvancedPart considered equal when the path, builder and parser are equal.
        /// Note: value is ignored in equality test.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(IPartView other)
        {
            if (other == null || !(other is IPartViewNode))
            {
                return(false);
            }

            var node = (IPartViewNode)other;

            return(SelectedPath.Equals(node.SelectedPath) &&
                   SelectedBuilder.Equals(node.SelectedBuilder) &&
                   Parser.Equals(Parser, node.Parser) &&
                   (Values != null ? Values.Equals(node.Values) : true));
        }
コード例 #4
0
 private void ComputeHash()
 {
     unchecked
     {
         _hash = 13;
         if (SelectedPath != null)
         {
             _hash = (_hash * 7) + SelectedPath.GetHashCode();
         }
         if (SelectedBuilder != null)
         {
             _hash = (_hash * 7) + SelectedBuilder.GetHashCode();
         }
         if (Parser != null)
         {
             _hash = (_hash * 7) + Parser.GetHashCode();
         }
     }
 }
コード例 #5
0
ファイル: PresetPart.cs プロジェクト: zaharPonimash/dbqf
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 13;
         if (SelectedPath != null)
         {
             hash = (hash * 7) + SelectedPath.GetHashCode();
         }
         if (SelectedBuilder != null)
         {
             hash = (hash * 7) + SelectedBuilder.GetHashCode();
         }
         if (Parser != null)
         {
             hash = (hash * 7) + Parser.GetHashCode();
         }
         return(hash);
     }
 }