Ejemplo n.º 1
0
Archivo: Auth.cs Proyecto: sfework/TM
        public static List <AuthModel> Get()
        {
            var Re = MCache.Get <List <AuthModel> >(MCache.MCacheTag.AuthList);

            if (Re == null)
            {
                var Ts = typeof(Auth).GetNestedTypes();
                Re = new List <AuthModel>();
                foreach (var T1 in Ts)
                {
                    var At   = (AuthTagAttribute)T1.GetCustomAttributes(true)[0];
                    var Temp = new Dictionary <string, int>();
                    foreach (var T2 in T1.GetFields(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public))
                    {
                        Temp.Add(T2.Name, int.Parse(At.Prefix + ((int)T2.GetValue(null)).ToString().PadLeft(2, '0')));
                    }
                    Re.Add(new AuthModel {
                        Tag = At.Name, Auths = Temp
                    });
                }
                MCache.Set(MCache.MCacheTag.AuthList, Re);
            }
            return(Re);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public ColorVector GetValue(Point2D uvCoords, Vector3 p)
        {
            float sines = MathF.Sin(Scale.X * p.X) * MathF.Sin(Scale.Y * p.Y) * MathF.Sin(Scale.Z * p.Z);

            return((sines < 0.0f) ? T1.GetValue(uvCoords, p) : T2.GetValue(uvCoords, p));
        }