Esempio n. 1
0
        private string GetSummrytxt(ShapeElement parentShape)
        {
            ClrInterface interface2 = this.GetClass(parentShape);

            if (interface2 == null)
            {
                return("(无摘要)");
            }
            if (string.IsNullOrEmpty(interface2.DocSummary))
            {
                return("(无摘要)");
            }
            return(interface2.DocSummary);
        }
Esempio n. 2
0
        /// <summary>
        /// Equals override.
        /// </summary>
        /// <param name="obj">Object to compare to.</param>
        /// <returns>True if this interface equals another.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is ClrInterface))
            {
                return(false);
            }

            ClrInterface rhs = (ClrInterface)obj;

            if (Name != rhs.Name)
            {
                return(false);
            }

            if (BaseInterface == null)
            {
                return(rhs.BaseInterface == null);
            }

            return(BaseInterface.Equals(rhs.BaseInterface));
        }
Esempio n. 3
0
        private ClrInterface?GetInterface(MetadataImport import, int mdIFace)
        {
            ClrInterface?result = null;

            if (!import.GetTypeDefProperties(mdIFace, out string?name, out _, out int extends).IsOK)
            {
                name = import.GetTypeRefName(mdIFace);
            }

            // TODO:  Handle typespec case.
            if (name != null)
            {
                ClrInterface?type = null;
                if (extends != 0 && extends != 0x01000000)
                {
                    type = GetInterface(import, extends);
                }

                result = new ClrInterface(name, type);
            }

            return(result);
        }
Esempio n. 4
0
        private ClrInterface GetInterface(MetaDataImport import, int mdIFace)
        {
            ClrInterface result = null;

            if (!import.GetTypeDefProperties(mdIFace, out string name, out TypeAttributes attrs, out int extends))
            {
                name = import.GetTypeRefName(mdIFace);
            }

            // TODO:  Handle typespec case.
            if (name != null && !DesktopHeap.Interfaces.TryGetValue(name, out result))
            {
                ClrInterface type = null;
                if (extends != 0 && extends != 0x01000000)
                {
                    type = GetInterface(import, extends);
                }

                result = new DesktopHeapInterface(name, type);
                DesktopHeap.Interfaces[name] = result;
            }

            return(result);
        }
Esempio n. 5
0
 public DesktopHeapInterface(string name, ClrInterface baseInterface)
 {
     _name = name;
     _base = baseInterface;
 }
 public InterfaceInformation(ClrDump clrDump, ClrInterface interf)
 {
     TypeName     = TypeHelpers.ManageAlias(interf.Name);
     ClrDump      = clrDump;
     ClrInterface = interf;
 }
Esempio n. 7
0
 public DummyTypeInformation(ClrInterface interf)
 {
     this.interf = interf;
     TypeName    = interf.Name;
 }
Esempio n. 8
0
 public DesktopHeapInterface(string name, ClrInterface baseInterface)
 {
     _name = name;
     _base = baseInterface;
 }
 public StructuredType CreateFromClrInterface(ClrInterface type)
 {
     return(CreateFromTypeName(type.Name));
 }
Esempio n. 10
0
 public MDInterface(ClrInterface heapint)
 {
     m_heapint = heapint;
 }
Esempio n. 11
0
 /// <summary>
 /// Determines whether the adapted type conforms to a specified interface
 /// </summary>
 /// <param name="i">The interface to test</param>
 /// <returns></returns>
 public bool Realizes(ClrInterface i)
 => ReflectedElement.Realizes(i.ReflectedElement);
Esempio n. 12
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ClrInterfaceAdapter" /> class.
 /// </summary>
 /// <param name="interface">The interface.</param>
 /// <exception cref="ArgumentNullException">interface</exception>
 /// <inheritdoc />
 public ClrInterfaceAdapter(IConverter converter, ClrInterface @interface) : base(converter)
 {
     Interface = @interface ?? throw new ArgumentNullException(nameof(@interface));
     Name      = Interface.Name;
 }