Esempio n. 1
0
        public MassMass Mass;// { get; protected set; }

        /// <exception cref="InvalidOperationException">Condition.</exception>
        protected static TBaseModeRusi4 GetInstance <TBaseModeRusi4>(MassMass mass)
            where TBaseModeRusi4 :  BaseModeRusi4 <T>//, new()
        {
            if (instance == null)
            {
                var list = typeof(TBaseModeRusi4).GetConstructors();

                var ctor = typeof(TBaseModeRusi4).GetConstructor(
                    BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance,
                    null,
                    new Type[] { typeof(MassMass) },
                    null);
                if (ctor == null)
                {
                    throw new InvalidOperationException();
                }

                instance = ctor.Invoke(new Object[] { mass }) as BaseModeRusi4 <T>;
            }
            return(instance as TBaseModeRusi4);
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mass"></param>
 /// <returns></returns>
 public override IModeControl Low(MassMass mass)
 {
     return(BaseModeRusi4 <InertRusi4> .GetInstance <InertRusi4>(mass));
 }