Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        internal override void Init()
        {
            var fieldsTable = Task.DataView.GetFieldsTab();

            dataViewContent    = new StringBuilder();
            selectedFldIdxList = new List <bool>();

            for (var i = 0; i < fieldsTable.getSize(); i++)
            {
                selectedFldIdxList.Add(SelectedFields.Contains((Field)fieldsTable.getField(i)));
            }

            dataViewContent.Append("<" + ConstInterface.MG_TAG_DATAVIEW + XMLConstants.TAG_CLOSE);
        }
Esempio n. 2
0
        protected override List <TplResult> InnerProcess(List <TplResult> input)
        {
            for (int j = 0; j < input.Count; j++)
            {
                var result = input[j];

                //Remove fields
                for (int i = 0; i < result.Count; i++)
                {
                    var key = result.Fields.Keys.ElementAt(i);
                    if (!SelectedFields.Contains(key))
                    {
                        if (result.RemoveField(key))
                        {
                            i--;
                        }

                        else
                        {
                            result.SetFieldVisibility(key, false);
                        }
                    }
                    else
                    {
                        result.SetFieldVisibility(key, true);
                    }
                }

                //Remove empty results
                bool containsAllSelectedFields = true;
                bool containsOneSelectedField  = false;
                foreach (var f in SelectedFields)
                {
                    containsAllSelectedFields &= result.HasField(f);
                    containsOneSelectedField  |= result.HasField(f);
                }

                if (!containsOneSelectedField || (!containsAllSelectedFields && RemoveEntriesWithNullValues))
                {
                    input.RemoveAt(j);
                    j--;
                }
            }

            return(input);
        }