當前位置: 首頁>>代碼示例>>C#>>正文


C# PathData.Detach方法代碼示例

本文整理匯總了C#中N2.Web.PathData.Detach方法的典型用法代碼示例。如果您正苦於以下問題:C# PathData.Detach方法的具體用法?C# PathData.Detach怎麽用?C# PathData.Detach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在N2.Web.PathData的用法示例。


在下文中一共展示了PathData.Detach方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Attached_path_values_doesnt_mutate_original

        public void Attached_path_values_doesnt_mutate_original()
        {
            var path = new PathData { Action = "hej", CurrentItem = item, Ignore = true, IsCacheable = true, IsPubliclyAvailable = true, IsRewritable = true, Path = "/x", StopItem = page, TemplateUrl = "/hello.aspx" };

            var detached = path.Detach();
            var reattached = detached.Attach(persister);

            detached.Action = "hejdå";
            detached.CurrentItem = page;
            detached.Ignore = false;
            detached.IsCacheable = false;
            detached.IsPubliclyAvailable = false;
            detached.IsRewritable = false;
            detached.Path = "/y";
            detached.StopItem = item;
            detached.TemplateUrl = "/world.aspx";
            detached.QueryParameters["Hello"] = "world";

            reattached.Action.ShouldNotBe("hejdå");
            reattached.CurrentItem.ShouldNotBe(page);
            reattached.Ignore.ShouldNotBe(false);
            reattached.IsCacheable.ShouldNotBe(false);
            reattached.IsPubliclyAvailable.ShouldNotBe(false);
            reattached.IsRewritable.ShouldNotBe(false);
            reattached.Path.ShouldNotBe("/y");
            reattached.StopItem.ShouldNotBe(item);
            reattached.TemplateUrl.ShouldNotBe("/world.aspx");
            reattached.QueryParameters.ContainsKey("Hello").ShouldBe(false);
        }
開發者ID:zhaoguoli,項目名稱:n2cms,代碼行數:29,代碼來源:PathDataTests.cs

示例2: Attach_uses_persister_to_load_page

        public void Attach_uses_persister_to_load_page()
        {
            var path = new PathData { CurrentPage = page };
            path = path.Detach();
            path.CurrentPage.ShouldBe(null);

            var loadedPath = path.Attach(persister);
            loadedPath.CurrentPage.ID.ShouldBe(1);
        }
開發者ID:zhaoguoli,項目名稱:n2cms,代碼行數:9,代碼來源:PathDataTests.cs

示例3: Attach_creates_cloned_object

        public void Attach_creates_cloned_object()
        {
            var path = new PathData { Action = "hej", CurrentItem = item, Ignore = true, IsCacheable = true, IsPubliclyAvailable = true, IsRewritable = true, Path = "/x", StopItem = page, TemplateUrl = "/hello.aspx" };

            var detached = path.Detach();
            var reattached = detached.Attach(persister);

            reattached.ShouldNotBeSameAs(detached);
        }
開發者ID:zhaoguoli,項目名稱:n2cms,代碼行數:9,代碼來源:PathDataTests.cs

示例4: Detach_removes_reference_to_page_but_leaves_id

		public void Detach_removes_reference_to_page_but_leaves_id()
		{
			var path = new PathData { CurrentPage = page };
			path = path.Detach();

			path.CurrentPage.ShouldBe(null);
			path.PageID.ShouldBe(1);
		}
開發者ID:grbbod,項目名稱:drconnect-jungo,代碼行數:8,代碼來源:PathDataTests.cs

示例5: Detach_removes_reference_to_item_but_leaves_id

		public void Detach_removes_reference_to_item_but_leaves_id()
		{
			var path = new PathData { CurrentItem = page };
			path = path.Detach();

			path.CurrentItem.ShouldBe(null);
			path.ID.ShouldBe(1);
		}
開發者ID:grbbod,項目名稱:drconnect-jungo,代碼行數:8,代碼來源:PathDataTests.cs

示例6: Attach_uses_persister_to_load_stop

		public void Attach_uses_persister_to_load_stop()
		{
			var path = new PathData { StopItem = page };
			path = path.Detach();
			path.StopItem.ShouldBe(null);

			var loadedPath = path.Attach(persister);
			loadedPath.StopItem.ID.ShouldBe(1);
		}
開發者ID:grbbod,項目名稱:drconnect-jungo,代碼行數:9,代碼來源:PathDataTests.cs

示例7: Detach_creates_cloned_object

		public void Detach_creates_cloned_object()
		{
			var path = new PathData();
			var detached = path.Detach();

			detached.ShouldNotBeSameAs(path);
		}
開發者ID:grbbod,項目名稱:drconnect-jungo,代碼行數:7,代碼來源:PathDataTests.cs


注:本文中的N2.Web.PathData.Detach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。