Example #1
0
 private void Add <T>(IGeneratable <T> generator)
 {
     if (!Has(typeof(T)) && !generator.GetType().IsInterface)
     {
         supportedGenerators.Add(typeof(T), generator);
     }
 }
Example #2
0
        // TODO: Unexpose this
        public bool CanFirstParameterBeInstance(IGeneratable parent, GenerationOptions opts)
        {
            var param = Parameters.FirstOrDefault();

            if (param == null)
            {
                return(false);
            }

            // hacky check for symbol equality
            return(param.Resolve(opts).GetType() == parent.GetType());
        }