Esempio n. 1
0
        // 取得元件(包含共用部份的Flyweight)
        public UnsharedCoincreteFlyweight GetUnsharedFlyweight(string Key, string SharedContent, string UnsharedContent)
        {
            // 先取得共用的部份
            Flyweight SharedFlyweight = GetFlyweight(Key, SharedContent);

            // 產出元件
            UnsharedCoincreteFlyweight theFlyweight = new UnsharedCoincreteFlyweight(UnsharedContent);

            theFlyweight.SetFlyweight(SharedFlyweight);               // 設定共享的部份
            return(theFlyweight);
        }
Esempio n. 2
0
		// 取得元件(包含共用部份的Flyweight)
		public UnsharedCoincreteFlyweight GetUnsharedFlyweight(string Key,string SharedContent,string UnsharedContent)
		{
			// 先取得共用的部份
			Flyweight SharedFlyweight = GetFlyweight(Key, SharedContent);

			// 產出元件
			UnsharedCoincreteFlyweight  theFlyweight =  new UnsharedCoincreteFlyweight( UnsharedContent);
			theFlyweight.SetFlyweight( SharedFlyweight ); // 設定共享的部份
			return theFlyweight;
		}