Example #1
0
    //获取组件(包含共享部分的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);
    }
Example #2
0
 public void SetFlyweight(MyFlyweight myFlyweight)
 {
     m_Flyweight = myFlyweight;
 }