Inheritance: DocumentTypeBase
コード例 #1
0
        public void Run()
        {
            Initialise("TypeSet3");
            ts.MasterRenamed mas = new ts.MasterRenamed()
            {
                MasterTab = new ts.MasterTab()
                {
                    MasterDatePickerTab = new DataTypes.BuiltIn.DatePicker() { Value = DateTime.Parse("2015-09-21 16:54:23.000") },
                    MasterRichtextEditorTab = new DataTypes.BuiltIn.RichtextEditor() { Value = "<p>this is <strong>STRONG</strong></p>" },
                    MasterTextstringTab = new DataTypes.BuiltIn.Textstring() { Value = "TEXTSTRINGS" }
                },
                MasterTextstringRenamedRoot = new DataTypes.BuiltIn.Textstring() { Value = "OTHERONES!!" },
                MasterTrueFalseRoot = new DataTypes.BuiltIn.TrueFalse() { Value = true }
            };
            mas.NodeDetails.Name = "Master Test";
            mas.Persist(publish: true);

            for (int i = 0; i < 20; i++)
            {
                ts.Child2 ch2 = GetChild();
                ch2.NodeDetails.Name = Guid.NewGuid().ToString();
                ch2.Persist(mas.NodeDetails.UmbracoId, publish: true);
            }

            umbraco.library.RefreshContent();
            var pubmas = new UmbracoHelper(UmbracoContext.Current).TypedContent(mas.NodeDetails.UmbracoId);
            var kids = pubmas.ChildrenOfType<ts.Child2>().ToList();
            var trd = kids.First().Composition.CompositionNumericRoot;
        }
コード例 #2
0
        public void Run()
        {
            Initialise("TypeSet3");
            ts.MasterRenamed mas = new ts.MasterRenamed()
            {
                MasterTab = new ts.MasterTab()
                {
                    MasterDatePickerTab = new DataTypes.BuiltIn.DatePicker()
                    {
                        Value = DateTime.Parse("2015-09-21 16:54:23.000")
                    },
                    MasterRichtextEditorTab = new DataTypes.BuiltIn.RichtextEditor()
                    {
                        Value = "<p>this is <strong>STRONG</strong></p>"
                    },
                    MasterTextstringTab = new DataTypes.BuiltIn.Textstring()
                    {
                        Value = "TEXTSTRINGS"
                    }
                },
                MasterTextstringRenamedRoot = new DataTypes.BuiltIn.Textstring()
                {
                    Value = "OTHERONES!!"
                },
                MasterTrueFalseRoot = new DataTypes.BuiltIn.TrueFalse()
                {
                    Value = true
                }
            };
            mas.NodeDetails.Name = "Master Test";
            mas.Persist(publish: true);

            for (int i = 0; i < 20; i++)
            {
                ts.Child2 ch2 = GetChild();
                ch2.NodeDetails.Name = Guid.NewGuid().ToString();
                ch2.Persist(mas.NodeDetails.UmbracoId, publish: true);
            }

            umbraco.library.RefreshContent();
            var pubmas = new UmbracoHelper(UmbracoContext.Current).TypedContent(mas.NodeDetails.UmbracoId);
            var kids   = pubmas.ChildrenOfType <ts.Child2>().ToList();
            var trd    = kids.First().Composition.CompositionNumericRoot;
        }