Esempio n. 1
0
        internal static ClassCommandDescriptor <TInstanceCmd> Build()
        {
            var descr = new ClassCommandDescriptor <TInstanceCmd>();

            descr.ReadAttributes(typeof(TInstanceCmd));
            descr.SetDefaults();
            return(descr);
        }
Esempio n. 2
0
        // ReSharper disable once UnusedMember.Local

        internal static ClassCommand <TInstanceCmd> Create <TInstanceCmd>(Func <ICommandContext, TInstanceCmd> factory) where TInstanceCmd : ICommandInstance
        {
            var descriptor = ClassCommandDescriptor <TInstanceCmd> .Build();

            var parameters = ReadParameters <TInstanceCmd>();
            var cmd        = new ClassCommand <TInstanceCmd>(descriptor, factory ?? DefaultInstanceFactory <TInstanceCmd>, parameters)
            {
                Group = descriptor.GroupName
            };

            return(cmd);
        }