BankInterface

ExportCardAttribute.cs

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BankInterface
{
    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class)]
    public class ExportCardAttribute : ExportAttribute
    {
        public ExportCardAttribute() : base(typeof(ICard))
        {

        }
        public string CardType { get; set; }
    }
}

ICard.cs

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BankInterface
{
    //[InheritedExport]
    public interface ICard
    {
        double Money { get; set; }
        string GetCountInfo();
        void SaveMoney(double money);
        void CheckOutMoney(double money);
    }
    public interface IMetaData
    {
        string CardType { get; }
    }
}

你可能感兴趣的:(BankInterface)