Пример #1
0
 /// <summary>
 /// Use TryAlignWith() instead unless you are trying to call this from TryAlignWith()!
 /// </summary>
 public static bool TryAlignWithGeneric <TInsertable>(this TInsertable insertable, IInsertFriendly insertFriendly)
     where TInsertable : IInsertable
 {
     return(insertable.IsCompatibleGeneric(insertFriendly) && (insertFriendly as IInsertFriendly <TInsertable>).TryAlign(insertable));
 }
Пример #2
0
        /// <summary>
        /// Use TryInsertIn() instead unless you are trying to call this from TryInsertIn()!
        /// </summary>
        public static bool TryInsertInGeneric <TInsertable>(this TInsertable insertable, IInsertFriendly insertFriendly)
            where TInsertable : IInsertable
        {
            bool insertResult = insertable.IsCompatibleGeneric(insertFriendly) && (insertFriendly as IInsertFriendly <TInsertable>).TryInsert(insertable);

            if (insertResult)
            {
                insertable.HandleInsert();
            }
            return(insertResult);
        }
 public bool TryInsertIn(IInsertFriendly insertFriendly) => this.TryInsertInGeneric(insertFriendly);
Пример #4
0
 /// <summary>
 /// Use IsCompatible() instead unless you are trying to call this from IsCompatible()!
 /// </summary>
 public static bool IsCompatibleGeneric <TInsertable>(this TInsertable insertable, IInsertFriendly insertFriendly)
     where TInsertable : IInsertable
 {
     return(insertFriendly is IInsertFriendly <TInsertable>);
 }
 public bool TryAlignWith(IInsertFriendly insertFriendly) => this.TryAlignWithGeneric(insertFriendly);