//获取组件(包含共享部分的Flyweight public UnSharedConFlyWeight GetUnsharedFlyweight(string key, string sharedContent, string unsharedContent) { //现获取共享的部分 MyFlyweight sharedFlyweight = GetFlyweight(key, sharedContent); //产生组件 UnSharedConFlyWeight theFlyweight = new UnSharedConFlyWeight(unsharedContent); theFlyweight.SetFlyweight(sharedFlyweight); return(theFlyweight); }
public void SetFlyweight(MyFlyweight myFlyweight) { m_Flyweight = myFlyweight; }