コード例 #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 ISheet CreateSheet()
        {
            var sheetElement = new XElement(TAG_SHEET);
            var sheet        = new XMindSheet(sheetElement, this);

            _adaptableRegistry.RegisterByNode(sheet, sheet.Implementation);
            return(sheet);
        }
コード例 #3
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);
        }