当前位置: 首页>>代码示例>>C#>>正文


C# IPersister.Save方法代码示例

本文整理汇总了C#中IPersister.Save方法的典型用法代码示例。如果您正苦于以下问题:C# IPersister.Save方法的具体用法?C# IPersister.Save怎么用?C# IPersister.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPersister的用法示例。


在下文中一共展示了IPersister.Save方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public override void SetUp()
        {
            base.SetUp();

			persister = TestSupport.SetupFakePersister();
			persister.Save(root);
        }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:7,代码来源:DeleteInterceptorTests.cs

示例2: SetUp

		public override void SetUp()
		{
			base.SetUp();
			
			//definitions = TestSupport.SetupDefinitions(typeof(NormalPage), typeof(NormalItem));
			//persister = TestSupport.SetupFakePersister();
			definitions = engine.Definitions;
			persister = engine.Persister;
			
			page = CreateOneItem<NormalPage>(0, "root", null);
			persister.Save(page);

			worker = new EditableItemMigration(definitions, persister.Repository);
		}
开发者ID:rohancragg,项目名称:n2cms,代码行数:14,代码来源:EditableItemMigrationTest.cs

示例3: SetUp

        public override void SetUp()
        {
            base.SetUp();

            finder = new FakeTypeFinder(typeof(XmlableItem).Assembly, typeof(XmlableItem), typeof(XmlableItem2));
            notifier = mocks.Stub<IItemNotifier>();
            mocks.Replay(notifier);

            definitions = new DefinitionManager(
                new DefinitionBuilder(
                    finder,
                    new EngineSection(),
                    new FakeEditUrlManager()),
                new N2.Edit.Workflow.StateChanger(),
                notifier,
                new InterceptingProxyFactory());

            parser = mocks.StrictMock<IUrlParser>();
            Expect.On(parser)
                .Call(parser.BuildUrl(null))
                .IgnoreArguments()
                .Do(new BuildUrl(delegate(ContentItem itemToBuild)
                                    {
                                        string url = "/" + itemToBuild.Name + ".aspx";
                                        foreach (ContentItem parent in Find.EnumerateParents(itemToBuild, null))
                                        {
                                            if (parent.Parent != null)
                                                url = "/" + parent.Name + url;
                                        }
                                        return url;
                                    }))
                .Repeat.Any();
            mocks.Replay(parser);

            persister = mocks.StrictMock<IPersister>();
            persister.Save(null);
            LastCall.IgnoreArguments().Repeat.Any();
            mocks.Replay(persister);
        }
开发者ID:spmason,项目名称:n2cms,代码行数:39,代码来源:SerializationTestsBase.cs

示例4: AddAnswer

 public virtual void AddAnswer(IPersister persister, int selectedItem)
 {
     Option o = persister.Get<Option>(selectedItem);
     o.Answers++;
     persister.Save(o);
 }
开发者ID:cherylhanlon,项目名称:Tigers,代码行数:6,代码来源:Poll.cs

示例5: Unpublish

	    /// <summary>
	    /// Used by Edit.aspx
	    /// </summary>
	    /// <param name="persister"></param>
	    /// <param name="item"></param>
	    public static void Unpublish(IPersister persister, ContentItem item)
        {
            if (!item.IsPage)
                throw new ArgumentException("Unpublish requires item to be page");

            var stateChanger = Context.Current.Resolve<StateChanger>();
            stateChanger.ChangeTo(item, ContentState.Unpublished);
            persister.Save(item);
        }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:14,代码来源:VersioningExtensions.cs

示例6: Publish

        /// <summary>
        /// Used by PublishScheduledAction and the Publish Button in the Curtain
        /// </summary>
        /// <param name="versionManager"></param>
        /// <param name="persister"></param>
        /// <param name="previewedItem"></param>
        /// <returns></returns>
		public static ContentItem Publish(this IVersionManager versionManager, IPersister persister, ContentItem previewedItem)
        {
            //if (previewedItem.State == ContentState.Published)
            //    return previewedItem; // nothing to do

            if (!previewedItem.IsPage)
                throw new ArgumentException("Publish requires item to be a page");

            if (previewedItem.VersionOf.HasValue)
			{
                // is versioned
				previewedItem = versionManager.MakeMasterVersion(previewedItem);
				persister.Save(previewedItem);
			}

            var stateChanger = Context.Current.Resolve<StateChanger>();
            stateChanger.ChangeTo(previewedItem, ContentState.Published);
            persister.Save(previewedItem);
			return previewedItem;
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:27,代码来源:VersioningExtensions.cs


注:本文中的IPersister.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。