示例#1
0
        public IAdaptable CreateAdaptable(XNode node)
        {
            IAdaptable a = null;

            if (node is XElement)
            {
                XElement e        = (XElement)node;
                XName    nodeName = e.Name;
                switch (nodeName.ToString())
                {
                case TAG_SHEET:
                    a = new XMindSheet(e, this);
                    break;

                case TAG_TOPIC:
                    a = new XMindTopic(e, this);
                    break;
                }
            }
            if (a != null)
            {
                // Logger.Info($"XMindWorkbook.CreateAdaptable: adaptable is created - {a}");
            }
            else
            {
                // Logger.Warn($"XMindWorkbook.CreateAdaptable: adaptable was is not created - {a}");
            }
            return(a);
        }
示例#2
0
        public override ITopic CreateTopic()
        {
            var topicElement = new XElement(TAG_TOPIC);
            // GetWorkbookElement().Add(topicElement);
            XMindTopic topic = new XMindTopic(topicElement, this);

            _adaptableRegistry.RegisterByNode(topic, topic.Implementation);
            return(topic);
        }
示例#3
0
        /// <summary>
        /// Register topic. Note <see cref="ITopic"/> is not included in DOM of <see cref="XMindWorkBook"/>
        /// </summary>
        /// <returns>Registered XMindTopic</returns>
        public override ITopic CreateTopic()
        {
            var        topicElement = new XElement(TAG_TOPIC);
            XMindTopic topic        = new XMindTopic(topicElement, this)
            {
                OwnedSheet = GetPrimarySheet()
            };

            Logger.Log.DebugTrace($"Register topic {topic.GetId()} for {Name}");
            _adaptableRegistry.RegisterByNode(topic, topic.Implementation);
            return(topic);
        }
示例#4
0
        public IAdaptable?CreateAdaptable(XNode node)
        {
            IAdaptable?adaptable = null;

            if (node is XElement e)
            {
                XName nodeName = e.Name;
                switch (nodeName.ToString())
                {
                case TAG_SHEET:
                    adaptable = new XMindSheet(e, this);
                    break;

                case TAG_TOPIC:
                    adaptable = new XMindTopic(e, this);
                    break;
                }
            }
            if (adaptable is null)
            {
                Logger.Log.Warning($"XMindWorkbook.CreateAdaptable: adaptable was is not created - {adaptable}");
            }
            return(adaptable);
        }