static SvgImageManager()
 {
     ManifestResourceNames.Add(ExecutingAssembly, ExecutingAssembly.GetManifestResourceNames().ToList());
     if (ExecutingAssembly != CallingAssembly)
     {
         ManifestResourceNames.Add(CallingAssembly, CallingAssembly.GetManifestResourceNames().ToList());
     }
 }
        public override bool Equals(object obj)
        {
            if (!(obj is MemberDependency other))
            {
                return(false);
            }

            return(string.Equals(MemberDocId, other.MemberDocId, StringComparison.Ordinal) &&
                   DefinedInAssemblyIdentity == other.DefinedInAssemblyIdentity &&
                   CallingAssembly.Equals(other.CallingAssembly) &&
                   IsPrimitive == other.IsPrimitive);
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            var other = obj as MemberDependency;

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

            return(StringComparer.Ordinal.Equals(MemberDocId, other.MemberDocId) &&
                   StringComparer.Ordinal.Equals(DefinedInAssemblyIdentity, other.DefinedInAssemblyIdentity) &&
                   CallingAssembly.Equals(other.CallingAssembly));
        }
Beispiel #4
0
        public void TheCallingAssembly()
        {
            var callingAssembly = CallingAssembly.Find();

            if (callingAssembly != null)
            {
                Assembly(callingAssembly);
            }
            else
            {
                throw new InvalidOperationException("Could not determine the calling assembly, you may need to explicitly call IAssemblyScanner.Assembly()");
            }
        }
Beispiel #5
0
        public void TheCallingAssembly()
        {
            if (_parent.GetType().Assembly != typeof(ServiceRegistry).Assembly)
            {
                Assembly(_parent.GetType().Assembly);
                return;
            }

            var callingAssembly = CallingAssembly.Find();

            if (callingAssembly != null)
            {
                Assembly(callingAssembly);
            }
            else
            {
                throw new InvalidOperationException("Could not determine the calling assembly, you may need to explicitly call IAssemblyScanner.Assembly()");
            }
        }
Beispiel #6
0
        static Page()
        {
            //Assembly assembly = callingAssemblyByStackTrace();
            //var allTypes = assembly.GetTypes();

            var allTypes = CallingAssembly.GetTypes();

            List <Type> pageTypes = allTypes.Where(t => t.IsSubclassOf(PageType)).ToList();

            foreach (var pageType in pageTypes)
            {
                ConstructorInfo ctor = pageType.GetConstructors().FirstOrDefault(x => x.GetParameters().Count() == 0);
                if (ctor == null)
                {
                    throw new NullReferenceException("No default constructor() defined for " + pageType);
                }

                Page pageInstance = (Page)ctor.Invoke(new object[] { });
                Pages.Add(pageInstance);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 取得类型
        /// </summary>
        /// <returns>类型</returns>
        private Type GetType(string typeName)
        {
            Type type = Type.GetType(typeName);

            if (type == null)
            {
                type = DefaultAssembly.GetType(typeName);
            }
            if (type == null)
            {
                type = CallingAssembly.GetType(typeName);
            }
            if (type == null)
            {
                type = ExecutingAssembly.GetType(typeName);
            }
            if (type == null)
            {
                type = EntryAssembly.GetType(typeName);
            }
            return(type);
        }
        public override int GetHashCode()
        {
            if (!_hashComputed)
            {
                _hashCode     = ((DefinedInAssemblyIdentity?.ToString() ?? string.Empty) + (MemberDocId ?? string.Empty) + IsPrimitive.ToString((IFormatProvider)CultureInfo.InvariantCulture)).GetHashCode() ^ CallingAssembly.GetHashCode();
                _hashComputed = true;
            }

            return(_hashCode);
        }
Beispiel #9
0
 public static Assembly Calling()
 {
     return(CallingAssembly.Find());
 }
 public void use_current_assembly()
 {
     CallingAssembly.Find()
     .ShouldBe(GetType().Assembly);
 }
Beispiel #11
0
        public override int GetHashCode()
        {
            if (!_hashComputed)
            {
                _hashCode     = ((DefinedInAssemblyIdentity ?? string.Empty) + (MemberDocId ?? string.Empty)).GetHashCode() ^ CallingAssembly.GetHashCode();
                _hashComputed = true;
            }

            return(_hashCode);
        }