MyMessage
using System;
using System.Collections.Generic;
using System.Text;
namespace Pattern.Bridge
{
/**//// <summary>
/// 操作Message(RefinedAbstraction)
/// </summary>
public class MyMessage : Message
{
/**//// <summary>
/// 獲取Message
/// </summary>
/// <returns></returns>
public override List<MessageModel> Get()
{
List<MessageModel> l = base.Get();
foreach (MessageModel mm in l)
{
mm.Message += "(RefinedAbstraction)";
}
return l;
}
}
}
AbstractMessage
using System;
using System.Collections.Generic;
using System.Text;
namespace Pattern.Bridge
{
/**//// <summary>
/// 操作Message(Implementor)
/// </summary>
public abstract class AbstractMessage
{
/**//// <summary>
/// 獲取Message
/// </summary>
/// <returns></returns>
public abstract List<MessageModel> Get();
/**//// <summary>
/// 插入Message
/// </summary>
/// <param name="mm">Message實體對象</param>
/// <returns></returns>
public abstract bool Insert(MessageModel mm);
}
}