Exemplo n.º 1
0
        /// <summary>
        /// 登録アプリリストをXMLデータから取得する
        /// </summary>
        /// <param name="doc">XMLデータ</param>
        /// <param name="configData">アプリケーション設定データ</param>
        private static void ParseLinkageAppXml(XDocument doc, AppConfigData configData)
        {
            var linkageElement = doc.Root?.Element(LinkAppElemName);
            var dataElements   = linkageElement?.Elements(LinkAppDataName);

            if (dataElements == null)
            {
                return;
            }

            foreach (var dataElement in dataElements)
            {
                var appNameElement = dataElement.Element(LinkAppNameElemName);
                var appPathElement = dataElement.Element(LinkAppPathElemName);

                if (appPathElement != null && appNameElement != null &&
                    (string.IsNullOrEmpty(appNameElement.Value) || string.IsNullOrEmpty(appPathElement.Value)))
                {
                    continue;
                }

                var linkageApp = new ExtraAppSetting {
                    AppName = appNameElement?.Value, AppPath = appPathElement?.Value
                };
                configData.LinkageAppList.Add(linkageApp);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Parse the XML of the linked application.
        /// </summary>
        private static void ParseLinkageAppXml(XDocument xdoc, AppConfigData configData)
        {
            XElement linkageElement             = xdoc.Root.Element(LinkAppElemName);
            IEnumerable <XElement> dataElements = linkageElement.Elements(LinkAppDataName);

            foreach (XElement dataElement in dataElements)
            {
                XElement appNameElement = dataElement.Element(LinkAppNameElemName);
                XElement appPathElement = dataElement.Element(LinkAppPathElemName);

                if (!string.IsNullOrEmpty(appNameElement.Value) && !string.IsNullOrEmpty(appPathElement.Value))
                {
                    var linkageApp = new ExtraAppSetting {
                        AppName = appNameElement.Value, AppPath = appPathElement.Value
                    };
                    configData.LinkageAppList.Add(linkageApp);
                }
            }
        }