Esempio n. 1
0
        /// <summary>
        /// Processes the capServer response recieved.
        /// </summary>
        /// <param name="capServers">The cap servers.</param>
        private void ProcessCapServer(string capServers)
        {
            if (string.IsNullOrWhiteSpace(capServers))
            {
                return;
            }

            DataObjects.Clear();
            DataObjects.Add(QueryTemplateText);
            DataObject = QueryTemplateText;

            var xml         = XDocument.Parse(capServers);
            var dataObjects = new List <string>();

            xml.Descendants()
            .Where(x => x.Name.LocalName == "dataObject")
            .ForEach(x =>
            {
                if (!dataObjects.Contains(x.Value))
                {
                    dataObjects.Add(x.Value);
                }
            });

            dataObjects.Sort();
            DataObjects.AddRange(dataObjects.Except(_excludedDataObjects).ToList());
        }
Esempio n. 2
0
        /// <summary>
        /// Processes the capServer response recieved.
        /// </summary>
        /// <param name="capServers">The cap servers.</param>
        private void ProcessCapServer(string capServers)
        {
            if (string.IsNullOrWhiteSpace(capServers))
            {
                return;
            }

            DataObjects.Clear();
            DataObjects.Add(QueryTemplateText);
            DataObject = QueryTemplateText;

            var xml         = XDocument.Parse(capServers);
            var dataObjects = new List <string>();

            xml.Descendants().Where(x => x.Name.LocalName == "function" &&
                                    (x.Attributes("name").FirstOrDefault()?.Value == "WMLS_GetFromStore" ||
                                     x.Attributes("name").FirstOrDefault()?.Value == "GetFromStore"))
            .Descendants()
            .Where(x => x.Name.LocalName == "dataObject")
            .ForEach(x =>
            {
                if (!dataObjects.Contains(x.Value))
                {
                    dataObjects.Add(x.Value);
                }
            });

            dataObjects.Sort();
            DataObjects.AddRange(dataObjects.Except(_excludedDataObjects).ToList());
        }
        /// <summary>
        /// Called when the parent view is ready.
        /// </summary>
        public void OnViewReady(IEnumerable <string> dataObjects)
        {
            DataObjects.Clear();
            DataObjects.AddRange(dataObjects);

            if (!Items.Any() && Context != null)
            {
                LoadWells();
            }
        }