Esempio n. 1
0
        public InfoPathServices.FormInformation FormInformation(string libraryUrl, string xsnUrl)
        {
            var spContext = SharePointContextProvider.Current.GetSharePointContext(System.Web.HttpContext.Current);

            using (var clientContext = spContext.CreateUserClientContextForSPHost())
            {
                InfoPathServices.FormInformation info = null;
                if (clientContext != null)
                {
                    info = InfoPathServices.InfoPathAnalytics.FormInformation(clientContext, libraryUrl, xsnUrl);
                }
                // Sort info
                SortFormInformation(info);

                return(info);
            }
        }
Esempio n. 2
0
 private void SortFormInformation(InfoPathServices.FormInformation info)
 {
     info.DataConnections.Sort(
         delegate(InfoPathServices.DataConnection x, InfoPathServices.DataConnection y)
     {
         if (x.Name == null && y.Name == null)
         {
             return(0);
         }
         else if (x.Name == null)
         {
             return(-1);
         }
         else if (y.Name == null)
         {
             return(1);
         }
         else
         {
             return(x.Name.CompareTo(y.Name));
         }
     });
 }