Inheritance: SenseNet.ContentRepository.File
Ejemplo n.º 1
0
        public void MasterPage_Constructor()
        {
            Node parent = Repository.Root; 

            MasterPage target = new MasterPage(parent);

            Assert.IsNotNull(target, "1. MasterPage is null.");
        }
Ejemplo n.º 2
0
		private void SaveMasterPage(MasterPage masterPage, string textData)
		{
            BinaryData binaryData = new BinaryData();

            if (masterPage.Binary != null)
            {
                masterPage.Binary.SetStream(Tools.GetStreamFromString(textData));
                masterPage.Binary.FileName = new BinaryFileName(ASPX);
            }
            else
            {
                
                binaryData.SetStream(Tools.GetStreamFromString(textData));
                binaryData.FileName = new BinaryFileName(ASPX);
                masterPage.Binary = binaryData;
            }
            masterPage.Save();
		}
Ejemplo n.º 3
0
		private MasterPage GetMasterPageByPath(string path, string name)
		{
			var parent = Node.LoadNode(path) as IFolder;
			if (parent != null)
			{
				_masterPage = GetExistNode(parent, name) as MasterPage;
				if (_masterPage == null)
				{
					_masterPage = new MasterPage((Node)parent);
					_masterPage.Name = string.Concat(name);
				}
				return _masterPage;
			}
			else
			{
				return null;
			}
		}
Ejemplo n.º 4
0
        public void PageTemplate_SetMasterPageNode()
        {
            Node parent = Repository.Root;

            MasterPage target = new MasterPage(parent);
			target.Save();

            PageTemplate val = new PageTemplate(parent);

            val.MasterPageNode = target;

            Assert.IsNotNull(val.MasterPageNode, "#1");
            Assert.AreNotEqual(target, val.MasterPageNode, "#2"); // reference not equal because property getter returns a new instance.
            Assert.AreEqual(target.VersionId, val.MasterPageNode.VersionId, "#3");
        }