Provides the structure required for pin/unpin operation performed on matter/document. Meta-data includes the list name, list column, URL, and matter/document details.
Пример #1
0
        /// <summary>
        /// Gets the current user pinned details.
        /// </summary>
        /// <param name="isMatterView">If the user is pinning a matter, this will be true, else will be false.</param>
        /// <param name="getUserPinnedDetails">This is an object that contains the details of the specific pinned matter/document.</param>
        /// <returns>This returns an object that contains the details of the specific pinned matter/document.</returns>
        internal PinUnpinDetails GetCurrentUserPinnedDetails(bool isMatterView, object getUserPinnedDetails)
        {
            PinUnpinDetails userPinnedDetails = new PinUnpinDetails();
            try
            {
                if (isMatterView)
                {
                    userPinnedDetails.UserPinnedMatterData = (MatterData)getUserPinnedDetails;
                }
                else
                {
                    userPinnedDetails.UserPinnedDocumentData = (DocumentData)getUserPinnedDetails;
                }

                userPinnedDetails.ListName = isMatterView ? listNames.UserPinnedMatterListName : listNames.UserPinnedDocumentListName;
                userPinnedDetails.PinnedListColumnDetails = isMatterView ? searchSettings.PinnedListColumnMatterDetails : searchSettings.PinnedListColumnDocumentDetails;
                userPinnedDetails.URL = isMatterView ? userPinnedDetails.UserPinnedMatterData.MatterUrl : userPinnedDetails.UserPinnedDocumentData.DocumentUrl;
                return userPinnedDetails;
            }
            catch (Exception exception)
            {
                customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable);
                throw;
            }
        }
Пример #2
0
 /// <summary>
 /// Gets the first pinned matter serialized JSON object
 /// </summary>
 /// <param name="userPinnedDetails">User matter pin details object</param>
 /// <returns>JSON format of pin data</returns>
 private string GetFirstPinnedMatter(PinUnpinDetails userPinnedDetails)
 {
     try
     {
         Dictionary<string, MatterData> userFirstPinnedMatter = new Dictionary<string, MatterData>();
         userFirstPinnedMatter.Add(userPinnedDetails.UserPinnedMatterData.MatterUrl, userPinnedDetails.UserPinnedMatterData);
         string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedMatter, Newtonsoft.Json.Formatting.Indented);
         return pinnedDetailsJson;
     }
     catch (Exception exception)
     {
         customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable);
         throw;
     }
 }