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; }
    }
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 有时候我们需要编写一些小的代码片段时,在Visual Studio中创建一个工程就显得有点杀鸡用牛刀的感觉了,所有...
    简约生活_忆沙阅读 1,825评论 0 0
  • 你是虚假的春天 是不能同归的殊途 是我年复一年 藏在枕下的春秋大梦
    哀慕熙荣阅读 112评论 0 1
  • 相信大多数人都对佛教有一些神秘并崇拜的感情,身边好多人似乎也都觉得信佛是一种时尚,一种体现自己身份和高贵精神...
    睡不醒的眼睛阅读 2,987评论 3 9
  • 这个星期天我和爸爸妈妈一起到西溪南去玩,当中有一件事最有趣,那就是抓小虾。 来到西溪南沿着青石小路,...
    0浩雨0阅读 537评论 2 3
  • 01 如果你没有那样的心情,就不会听那样的歌。 记一段好词,写一段感触,沉浸在音乐的氛围里,体会某种情绪。 听歌,...
    属于我的清柠阅读 475评论 0 1