Ejemplo n.º 1
0
        public MNPage InsertPage(MNPage refPage, string newPageName, bool bShouldInsertAfter)
        {
            MNPage newPage = new MNPage(this);

            newPage.Title = newPageName;
            int index    = Data.Pages.IndexOf(refPage);
            int newIndex = Data.Pages.Count;

            if (index >= 0)
            {
                if (bShouldInsertAfter)
                {
                    newIndex = index + 1;
                }
                else
                {
                    newIndex = index;
                }
            }

            Data.Pages.Insert(newIndex, newPage);
            MNNotificationCenter.BroadcastMessage(this, "NewPageInserted", newPage);

            return(newPage);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates new template
        /// </summary>
        /// <returns></returns>
        public MNPage CreateNewTemplate()
        {
            MNPage page = new MNPage(this);

            page.Title    = string.Format("<Template Title>");
            page.Document = this;
            page.Id       = Data.GetNextId();
            Data.Templates.Add(page);

            MNNotificationCenter.BroadcastMessage(this, "PageInserted", page);

            return(page);
        }
Ejemplo n.º 3
0
        public MNReferencedText CreateNewText(bool isScript)
        {
            MNReferencedText rt = new MNReferencedText();

            rt.Name = "Untitled";

            if (isScript)
            {
                Data.Scripts.Add(rt);
            }
            else
            {
                DefaultLanguage.Texts.Add(rt);
                DefaultLanguage.Modified = true;
            }

            MNNotificationCenter.BroadcastMessage(this, "TextInserted", rt);

            return(rt);
        }