Пример #1
0
        public static bool FromXml(string version, XElement config, out Markup markup)
        {
            var nodeId = config.GetAttrValue <ushort>(nameof(Id));

            markup = MarkupManager.Get(nodeId);
            markup.FromXml(version, config);
            return(true);
        }
Пример #2
0
        public static bool FromXml(Version version, XElement config, out Markup markup)
        {
            var nodeId = config.GetAttrValue <ushort>(nameof(Id));

            try
            {
                markup = MarkupManager.Get(nodeId);
                markup.FromXml(version, config);
                return(true);
            }
            catch (Exception error)
            {
                Logger.LogError(() => $"Could load node #{nodeId} markup", error);
                markup = null;
                MarkupManager.LoadErrors += 1;
                return(false);
            }
        }