Exemplo n.º 1
0
        public static int Create <T1, T2, T3, T4, T5, T6, T7>(T1?value1, T2?value2, T3?value3, T4?value4, T5?value5, T6?value6, T7?value7)
        {
            uint hc1 = (uint)(value1?.GetHashCode() ?? 0);
            uint hc2 = (uint)(value2?.GetHashCode() ?? 0);
            uint hc3 = (uint)(value3?.GetHashCode() ?? 0);
            uint hc4 = (uint)(value4?.GetHashCode() ?? 0);
            uint hc5 = (uint)(value5?.GetHashCode() ?? 0);
            uint hc6 = (uint)(value6?.GetHashCode() ?? 0);
            uint hc7 = (uint)(value7?.GetHashCode() ?? 0);

            Initialize(out uint v1, out uint v2, out uint v3, out uint v4);

            v1 = Round(v1, hc1);
            v2 = Round(v2, hc2);
            v3 = Round(v3, hc3);
            v4 = Round(v4, hc4);

            uint hash = MixState(v1, v2, v3, v4);

            hash += 28;

            hash = QueueRound(hash, hc5);
            hash = QueueRound(hash, hc6);
            hash = QueueRound(hash, hc7);

            hash = MixFinal(hash);
            return((int)hash);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取树形列表
        /// </summary>
        /// <param name="allData">所有API权限</param>
        /// <param name="parentID">父级唯一标识</param>
        /// <param name="getNewT1"></param>
        /// <returns></returns>
        public static List <T1> GetTreeList <T1, T2, T3>(List <T2> allData, T3?parentID, Func <T2, T1> getNewT1) where T1 : ITreeModel <T1, T3>, new() where T2 : ITreeDomain <T3> where T3 : struct
        {
            var       result = new List <T1>();
            List <T2> data   = allData.Where(m => m.ParentID.Equals(parentID)).ToList();

            foreach (T2 item in data)
            {
                T1 temp = getNewT1(item);
                temp.Child = GetTreeList <T1, T2, T3>(allData, item.ID, getNewT1);
                result.Add(temp);
            }
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取树形列表
        /// </summary>
        /// <param name="allData">所有API权限</param>
        /// <param name="parentID">父级唯一标识</param>
        /// <returns></returns>
        public static List <T1> GetTreeList <T1, T2, T3>(List <T2> allData, T3?parentID = null) where T1 : ITreeModel <T1, T3>, new() where T2 : ITreeDomain <T3> where T3 : struct
        {
            var       result = new List <T1>();
            List <T2> data   = allData.Where(m => m.ParentID.Equals(parentID)).ToList();

            foreach (T2 item in data)
            {
                result.Add(new T1
                {
                    ID    = item.ID,
                    Name  = item.Name,
                    Child = GetTreeList <T1, T2, T3>(allData, item.ID)
                });
            }
            return(result);
        }
Exemplo n.º 4
0
        public static int Create <T1, T2, T3>(T1?value1, T2?value2, T3?value3)
        {
            uint hc1 = (uint)(value1?.GetHashCode() ?? 0);
            uint hc2 = (uint)(value2?.GetHashCode() ?? 0);
            uint hc3 = (uint)(value3?.GetHashCode() ?? 0);

            uint hash = MixEmptyState();

            hash += 12;

            hash = QueueRound(hash, hc1);
            hash = QueueRound(hash, hc2);
            hash = QueueRound(hash, hc3);

            hash = MixFinal(hash);
            return((int)hash);
        }
Exemplo n.º 5
0
        private T3 ConvertTo2 <T3, T2>(
            T3?convertedParent,
            Func <T3?, TreeJoint <T>, T3> converter
            )
            where T3 : notnull, TreeJoint <T2>
        {
            var converted = converter(convertedParent, this);

            foreach (var child in _children)
            {
                var convertedChild = child.ConvertTo2 <T3, T2>(
                    converted,
                    converter
                    );
                converted.AddChild(convertedChild);
            }

            return(converted);
        }
Exemplo n.º 6
0
        public static int Create <T1, T2, T3, T4>(T1?value1, T2?value2, T3?value3, T4?value4)
        {
            uint hc1 = (uint)(value1?.GetHashCode() ?? 0);
            uint hc2 = (uint)(value2?.GetHashCode() ?? 0);
            uint hc3 = (uint)(value3?.GetHashCode() ?? 0);
            uint hc4 = (uint)(value4?.GetHashCode() ?? 0);

            Initialize(out uint v1, out uint v2, out uint v3, out uint v4);

            v1 = Round(v1, hc1);
            v2 = Round(v2, hc2);
            v3 = Round(v3, hc3);
            v4 = Round(v4, hc4);

            uint hash = MixState(v1, v2, v3, v4);

            hash += 16;

            hash = MixFinal(hash);
            return((int)hash);
        }
Exemplo n.º 7
0
 public static void Information <T1, T2, T3>(this ILogger logger, string Message, T1?arg1, T2?arg2, T3?arg3)
 {
     if (logger.IsEnabled(LogLevel.Information))
     {
         logger.LogInformation(Message, arg1, arg2, arg3);
     }
 }
Exemplo n.º 8
0
 public static void Trace <T1, T2, T3>(this ILogger logger, string Message, T1?arg1, T2?arg2, T3?arg3)
 {
     if (logger.IsEnabled(LogLevel.Trace))
     {
         logger.LogTrace(Message, new object[] { arg1, arg2, arg3 });
     }
 }
Exemplo n.º 9
0
 public static void Critical <T1, T2, T3>(this ILogger logger, string Message, T1?arg1, T2?arg2, T3?arg3)
 {
     if (logger.IsEnabled(LogLevel.Critical))
     {
         logger.LogCritical(Message, new object[] { arg1, arg2, arg3 });
     }
 }
Exemplo n.º 10
0
 public ReturnType?NullableGenericMethod <T1, T2, T3>(T1?t1, T2 t2, T3?t3) where T1 : class where T2 : class where T3 : class
 {
     return(null);
 }
Exemplo n.º 11
0
 /// <summary>
 /// 获取树形列表
 /// </summary>
 /// <param name="allData">所有API权限</param>
 /// <param name="parentID">父级唯一标识</param>
 /// <param name="getNewT1"></param>
 /// <returns></returns>
 public static List <T1> GetTreeListByAttribute <T1, T2, T3>(List <T2> allData, T3?parentID, Func <T2, T1> getNewT1) where T1 : ITreeModel <T1, T3>, new() where T3 : struct
 {
     //var result = new List<T1>();
     //List<T2> data = allData.Where(m => m.ParentID.Equals(parentID)).ToList();
     //foreach (T2 item in data)
     //{
     //    T1 temp = getNewT1(item);
     //    temp.Child = GetTreeList<T1, T2, T3>(allData, item.ID, getNewT1);
     //    result.Add(temp);
     //}
     //return result;
     return(null);
 }
Exemplo n.º 12
0
        /// <summary>
        /// 获取树形列表
        /// </summary>
        /// <param name="allAPIAuthorities">所有API权限</param>
        /// <param name="parentID">父级唯一标识</param>
        /// <returns></returns>
        public static List <T1> GetTreeList <T1, T2, T3>(List <T2> allAPIAuthorities, T3?parentID = null) where T1 : ITreeModel <T1, T3>, new() where T2 : ITreeDomain <T3> where T3 : struct
        {
            var       result         = new List <T1>();
            List <T2> apiAuthorities = allAPIAuthorities.Where(m => m.ParentID.Equals(parentID)).ToList();

            foreach (T2 apiAuthority in apiAuthorities)
            {
                result.Add(new T1
                {
                    ID    = apiAuthority.ID,
                    Name  = apiAuthority.Name,
                    Child = GetTreeList <T1, T2, T3>(allAPIAuthorities, apiAuthority.ID)
                });
            }
            return(result);
        }
Exemplo n.º 13
0
 public static void Warning <T1, T2, T3>(this ILogger logger, string Message, T1?arg1, T2?arg2, T3?arg3)
 {
     if (logger.IsEnabled(LogLevel.Warning))
     {
         logger.LogWarning(Message, new object[] { arg1, arg2, arg3 });
     }
 }
Exemplo n.º 14
0
 public static void Debug <T1, T2, T3, T4, T5, T6, T7, T8>(T1?value1, T2?value2, T3?value3, T4?value4, T5?value5, T6?value6, T7?value7, T8?value8)
 {
 }
Exemplo n.º 15
0
 public static void Debug <T1, T2, T3, T4, T5, T6>(T1?value1, T2?value2, T3?value3, T4?value4, T5?value5, T6?value6)
 {
 }
Exemplo n.º 16
0
 public static void Debug <T1, T2, T3, T4>(T1?value1, T2?value2, T3?value3, T4?value4)
 {
 }
Exemplo n.º 17
0
 public static void Debug <T1, T2, T3>(T1?value1, T2?value2, T3?value3)
 {
 }
Exemplo n.º 18
0
 public abstract T2 Baz(T3?p);
Exemplo n.º 19
0
 /// <summary>
 /// 获取树形列表
 /// </summary>
 /// <param name="allData">所有API权限</param>
 /// <param name="parentID">父级唯一标识</param>
 /// <returns></returns>
 public static List <T1> GetTreeListByAttribute <T1, T2, T3>(List <T2> allData, T3?parentID = null) where T1 : ITreeModel <T1, T3>, new() where T3 : struct
 {
     //var result = new List<T1>();
     //List<T2> data = allData.Where(m => m.ParentID.Equals(parentID)).ToList();
     //foreach (T2 item in data)
     //{
     //    result.Add(new T1
     //    {
     //        ID = item.ID,
     //        Name = item.Name,
     //        Child = GetTreeList<T1, T2, T3>(allData, item.ID)
     //    });
     //}
     //return result;
     return(null);
 }
Exemplo n.º 20
0
        /// <summary>
        /// 获取树形列表
        /// </summary>
        /// <param name="allAPIAuthorities">所有API权限</param>
        /// <param name="parentID">父级唯一标识</param>
        /// <param name="getNewT1"></param>
        /// <returns></returns>
        public static List <T1> GetTreeList <T1, T2, T3>(List <T2> allAPIAuthorities, T3?parentID, Func <T2, T1> getNewT1) where T1 : ITreeModel <T1, T3>, new() where T2 : ITreeDomain <T3> where T3 : struct
        {
            var       result         = new List <T1>();
            List <T2> apiAuthorities = allAPIAuthorities.Where(m => m.ParentID.Equals(parentID)).ToList();

            foreach (T2 apiAuthority in apiAuthorities)
            {
                T1 temp = getNewT1(apiAuthority);
                temp.Child = GetTreeList <T1, T2, T3>(allAPIAuthorities, apiAuthority.ID, getNewT1);
                result.Add(temp);
            }
            return(result);
        }
Exemplo n.º 21
0
 public static bool AnyIsNull <T1, T2, T3, T4>(T1?value1, T2?value2, T3?value3, T4?value4) where T1 : struct where T2 : struct where T3 : struct where T4 : struct
 {
     return(false == value1.HasValue || false == value2.HasValue || false == value3.HasValue || false == value4.HasValue);
 }