Beispiel #1
0
        protected ActionDetail GetActionDetailFromInterface(object identifyingType, Type interfaceType)
        {
            var provider = ProviderIdentifier.GetProviderFromType(identifyingType.GetType());
            var type     = GetTypeAssociatedWithProvider(provider, interfaceType);

            return(new ActionDetail {
                Provider = provider, Type = type
            });
        }
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     unchecked
     {
         var result = (SystemDataSet != null ? SystemDataSet.GetHashCode() : 0);
         result = (result * 397) ^ (ProviderIdentifier != null ? ProviderIdentifier.GetHashCode() : 0);
         result = (result * 397) ^ (ClientIdentifier != null ? ClientIdentifier.GetHashCode() : 0);
         result = (result * 397) ^ CoDependentIndicator.GetHashCode();
         result = (result * 397) ^ (TedsServiceType != null ? TedsServiceType.GetHashCode() : 0);
         return(result);
     }
 }
Beispiel #3
0
        private static Type GetTypeAssociatedWithProvider(Provider provider, Type interfaceType)
        {
            var typesImplementingInterface = GetTypesImplementingInterface(interfaceType);

            foreach (var type in typesImplementingInterface)
            {
                var typeProvider = ProviderIdentifier.GetProviderFromType(type);
                if (typeProvider == provider)
                {
                    return(type);
                }
            }

            return(null);
        }
        public void ProviderIdentifier()
        {
            var identifier = new ProviderIdentifier("google.com", "firebase");

            Assert.Equal("ProviderIdentifier(google.com, firebase)", identifier.ToString());
        }
Beispiel #5
0
 public Provider GetProvider()
 {
     return(ProviderIdentifier.GetProviderFromType(GetType()));
 }