Exemplo n.º 1
0
 /// <summary>Finds the complete field name from a partial name.</summary>
 /// <param name="name">the complete or partial name</param>
 /// <returns>the complete name or <CODE>null</CODE> if not found</returns>
 public virtual String FindFieldName(String name)
 {
     if (acroFieldsSom == null && xfaPresent)
     {
         acroFieldsSom = new AcroFieldsSearch(datasetsSom.GetName2Node().Keys);
         return(acroFieldsSom.GetAcroShort2LongName().ContainsKey(name) ? acroFieldsSom.GetAcroShort2LongName
                    ().Get(name) : acroFieldsSom.InverseSearchGlobal(new List <string>(new Stack <string>(Xml2Som.SplitParts(name)))));
     }
     return(null);
 }
Exemplo n.º 2
0
        /// <summary>Finds the complete field name from a partial name.</summary>
        /// <param name="name">the complete or partial name</param>
        /// <returns>the complete name or <CODE>null</CODE> if not found</returns>
        public virtual String FindFieldName(String name)
        {
            if (acroFieldsSom == null && xfaPresent && datasetsSom != null)
            {
                IDictionary <String, XNode> name2Node = datasetsSom.GetName2Node();
                ICollection <String>        keys      = name2Node.Keys;
                acroFieldsSom = new AcroFieldsSearch(keys);
            }

            if (acroFieldsSom != null && xfaPresent)
            {
                List <string> parts = new List <string>(new Stack <string>(Xml2Som.SplitParts(name)));

                bool containsKey = acroFieldsSom.GetAcroShort2LongName().ContainsKey(name);

                string inverse = acroFieldsSom.InverseSearchGlobal(parts);
                string normal  = acroFieldsSom.GetAcroShort2LongName().Get(name);

                return(containsKey ? normal : inverse);
            }
            return(null);
        }