示例#1
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()));
 }
示例#2
0
 /// <summary>
 /// Builds a property path.
 /// </summary>
 public string BuildPropertyName(string propertyName) {
     var chain = new PropertyChain(this);
     chain.Add(propertyName);
     return chain.ToString();
 }
示例#3
0
 /// <summary>
 /// Creates a new PropertyChain based on another.
 /// </summary>
 public PropertyChain(PropertyChain parent) {
     if(parent != null) {
         memberNames.AddRange(parent.memberNames);				
     }
 }
示例#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());
 }