コード例 #1
0
        /// <summary>
        /// 享元模式帳號身分網站
        /// </summary>
        public void ExcuteWebsiteAccountFlyWeight()
        {
            WebSiteAccountFactory f  = new WebSiteAccountFactory();
            WebSiteAccount        fx = f.WebSiteAccountCategory("產品展示");

            fx.Use(new User("A"));

            WebSiteAccount fy = f.WebSiteAccountCategory("產品展示");

            fy.Use(new User("B"));

            WebSiteAccount fz = f.WebSiteAccountCategory("產品展示");

            fz.Use(new User("C"));

            WebSiteAccount fl = f.WebSiteAccountCategory("柏克萊");

            fl.Use(new User("D"));

            WebSiteAccount fm = f.WebSiteAccountCategory("柏克萊");

            fm.Use(new User("E"));

            WebSiteAccount fn = f.WebSiteAccountCategory("柏克萊");

            fn.Use(new User("F"));

            Console.WriteLine($"網站分類總數{f.GetWebSiteCount()}");
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: IhorKuzmichov/NaOtvet
        private void LoadRemoteData()
        {
            var webLinks = NaOtvetClient.GetWebLinks(new string[] { "youtubeTutorial", "youtubeChannel" });

            youtubeTutorialUrl = webLinks.First(webLink => webLink.Name == "youtubeTutorial").Url;
            youtubeChannelUrl  = webLinks.First(webLink => webLink.Name == "youtubeChannel").Url;
            naurokAccount      = NaOtvetClient.GetWebSiteAccount("https://naurok.com.ua");
        }