Пример #1
0
 public string BuildPropertyName(string propertyName)
 {
     var chain = new PropertyChain(this);
     chain.Add(propertyName);
     return chain.ToString();
 }
Пример #2
0
 public PropertyChain(PropertyChain parent)
 {
     if(parent != null) {
         memberNames.AddRange(parent.memberNames);
     }
 }
Пример #3
0
 /// <summary>
 /// Checks if the current chain is the child of another chain.
 /// For example, if chain1 were for "Parent.Child" and chain2 were for "Parent.Child.GrandChild" then
 /// chain2.IsChildChainOf(chain1) would be true.
 /// </summary>
 /// <param name="parentChain">The parent chain to compare</param>
 /// <returns>True if the current chain is the child of the other chain, otherwise false</returns>
 public bool IsChildChainOf(PropertyChain parentChain)
 {
     return(ToString().StartsWith(parentChain.ToString()));
 }
Пример #4
0
 /// <summary>
 /// Checks if the current chain is the child of another chain.
 /// For example, if chain1 were for "Parent.Child" and chain2 were for "Parent.Child.GrandChild" then
 /// chain2.IsChildChainOf(chain1) would be true.
 /// </summary>
 /// <param name="parentChain">The parent chain to compare</param>
 /// <returns>True if the current chain is the child of the other chain, otherwise false</returns>
 public bool IsChildChainOf(PropertyChain parentChain)
 {
     return ToString().StartsWith(parentChain.ToString());
 }
		/// <summary>
		/// Builds a property path.
		/// </summary>
		public string BuildPropertyName(string propertyName) {
			if (memberNames.Count == 0) {
				return propertyName;
			}

			var chain = new PropertyChain(this);
			chain.Add(propertyName);
			return chain.ToString();
		}