当前位置: 首页>>代码示例>>C#>>正文


C# User_Object.Get_Setting方法代码示例

本文整理汇总了C#中SobekCM.Core.Users.User_Object.Get_Setting方法的典型用法代码示例。如果您正苦于以下问题:C# User_Object.Get_Setting方法的具体用法?C# User_Object.Get_Setting怎么用?C# User_Object.Get_Setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SobekCM.Core.Users.User_Object的用法示例。


在下文中一共展示了User_Object.Get_Setting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Related_Images_ItemViewer

        /// <summary> Constructor for a new instance of the Related_Images_ItemViewer class, used to display 
        /// the thumbnail images (i.e., related images) associated with a digital resource </summary>
        /// <param name="BriefItem"> Digital resource object </param>
        /// <param name="CurrentUser"> Current user, who may or may not be logged on </param>
        /// <param name="CurrentRequest"> Information about the current request </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <param name="ViewerCode"> Viewer code for the related images viewer </param>
        public Related_Images_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer, string ViewerCode)
        {
            // Save the arguments for use later
            briefItem = BriefItem;
            currentRequest = CurrentRequest;

            // Get the proper number of thumbnails per page
            if (CurrentUser != null)
            {
                // First, pull the thumbnails per page from the user options
                thumbnailsPerPage = CurrentUser.Get_Setting("Related_Images_ItemViewer:ThumbnailsPerPage", 50);

                // Or was there a new value in the URL?
                if ((currentRequest.Thumbnails_Per_Page.HasValue) && (currentRequest.Thumbnails_Per_Page.Value >= -1))
                {
                    CurrentUser.Add_Setting("Related_Images_ItemViewer:ThumbnailsPerPage", currentRequest.Thumbnails_Per_Page);
                    thumbnailsPerPage = currentRequest.Thumbnails_Per_Page.Value;
                }
            }
            else
            {
                int tempValue = 50;
                object sessionValue = HttpContext.Current.Session["Related_Images_ItemViewer:ThumbnailsPerPage"];
                if (sessionValue != null)
                {
                    int.TryParse(sessionValue.ToString(), out tempValue);
                }
                thumbnailsPerPage = tempValue;

                // Or was there a new value in the URL?
                if ((currentRequest.Thumbnails_Per_Page.HasValue) && (currentRequest.Thumbnails_Per_Page.Value >= -1))
                {
                    HttpContext.Current.Session["Related_Images_ItemViewer:ThumbnailsPerPage"] = currentRequest.Thumbnails_Per_Page;
                    thumbnailsPerPage = currentRequest.Thumbnails_Per_Page.Value;
                }
            }

            // -1 means to display all thumbnails
            if (thumbnailsPerPage == -1)
                thumbnailsPerPage = int.MaxValue;

            // Now, reset the value in the navigation object, since we won't need to set it again
            currentRequest.Thumbnails_Per_Page = -100;

            // Get the proper size of thumbnails per page
            if (CurrentUser != null)
            {
                // First, pull the thumbnails per page from the user options
                thumbnailSize = CurrentUser.Get_Setting("Related_Images_ItemViewer:ThumbnailSize", 1);

                // Or was there a new value in the URL?
                if ((currentRequest.Size_Of_Thumbnails.HasValue) && (currentRequest.Size_Of_Thumbnails.Value > -1))
                {
                    CurrentUser.Add_Setting("Related_Images_ItemViewer:ThumbnailSize", currentRequest.Size_Of_Thumbnails);
                    thumbnailSize = currentRequest.Size_Of_Thumbnails.Value;
                }
            }
            else
            {
                int tempValue = 1;
                object sessionValue = HttpContext.Current.Session["Related_Images_ItemViewer:ThumbnailSize"];
                if (sessionValue != null)
                {
                    int.TryParse(sessionValue.ToString(), out tempValue);
                }
                thumbnailSize = tempValue;

                // Or was there a new value in the URL?
                if ((currentRequest.Size_Of_Thumbnails.HasValue) && (currentRequest.Size_Of_Thumbnails.Value > -1))
                {
                    HttpContext.Current.Session["Related_Images_ItemViewer:ThumbnailSize"] = currentRequest.Size_Of_Thumbnails;
                    thumbnailSize = currentRequest.Size_Of_Thumbnails.Value;
                }
            }

            // Now, reset the value in the navigation object, since we won't need to set it again
            currentRequest.Size_Of_Thumbnails = -1;

            // Get the number of thumbnails for this item
            pageCount = briefItem.Images != null ? briefItem.Images.Count : 0;

            // Determine the page
            page = 1;
            if (!String.IsNullOrEmpty(CurrentRequest.ViewerCode))
            {
                int tempPageParse;
                if (Int32.TryParse(CurrentRequest.ViewerCode.Replace(ViewerCode.Replace("#", ""), ""), out tempPageParse))
                    page = tempPageParse;
            }

            // Just a quick range check
            if (page > pageCount)
                page = 1;
//.........这里部分代码省略.........
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Related_Images_ItemViewer.cs

示例2: QC_ItemViewer


//.........这里部分代码省略.........
                if (Int32.TryParse(temp_width, out allThumbnailsOuterDiv1Width))
                    HttpContext.Current.Session["QC_AllThumbnailsWidth"] = allThumbnailsOuterDiv1Width;
                if (Int32.TryParse(temp_height, out allThumbnailsOuterDiv1Height))
                    HttpContext.Current.Session["QC_AllThumbnailsHeight"] = allThumbnailsOuterDiv1Height;

            }
            else
            {
                object session_width = HttpContext.Current.Session["QC_AllThumbnailsWidth"];
                if (session_width != null)
                    allThumbnailsOuterDiv1Width = (int)session_width;
                object session_height = HttpContext.Current.Session["QC_AllThumbnailsHeight"];
                if (session_height != null)
                    allThumbnailsOuterDiv1Height = (int)session_height;
            }

            // See if there were hidden requests
            hidden_request = HttpContext.Current.Request.Form["QC_behaviors_request"] ?? String.Empty;
            hidden_main_thumbnail = HttpContext.Current.Request.Form["Main_Thumbnail_File"] ?? String.Empty;
            hidden_move_relative_position = HttpContext.Current.Request.Form["QC_move_relative_position"] ?? String.Empty;
            hidden_move_destination_fileName = HttpContext.Current.Request.Form["QC_move_destination"] ?? String.Empty;
            autonumber_number_system = HttpContext.Current.Request.Form["Autonumber_number_system"] ?? String.Empty;
            string temp = HttpContext.Current.Request.Form["autonumber_mode_from_form"] ?? "0";
            Int32.TryParse(temp, out autonumber_mode_from_form);
            autonumber_text_only = HttpContext.Current.Request.Form["Autonumber_text_without_number"] ?? String.Empty;
            autonumber_number_only = HttpContext.Current.Request.Form["Autonumber_number_only"] ?? String.Empty;
            autonumber_number_system = HttpContext.Current.Request.Form["Autonumber_number_system"] ?? String.Empty;
            hidden_autonumber_filename = HttpContext.Current.Request.Form["Autonumber_last_filename"] ?? String.Empty;
            temp = HttpContext.Current.Request.Form["QC_sortable_option"] ?? "-1";

            // Check for sortable ( aka, Drag and drop pages ) setting - is it different than user's setting?
            if (Int32.TryParse(temp, out makeSortable) && (makeSortable > 0) && (makeSortable <= 3))
            {
                if (makeSortable.ToString() != CurrentUser.Get_Setting("QC_ItemViewer:SortableMode", "NULL"))
                {
                    CurrentUser.Add_Setting("QC_ItemViewer:SortableMode", makeSortable);
                    SobekCM_Database.Set_User_Setting(CurrentUser.UserID, "QC_ItemViewer:SortableMode", makeSortable.ToString());
                }
            }

            // Check for the autonumber option - is it different than user's setting?
            temp = HttpContext.Current.Request.Form["QC_autonumber_option"] ?? "-1";
            if ((Int32.TryParse(temp, out autonumber_mode)) && (autonumber_mode >= 0) && (autonumber_mode <= 2))
            {
                if (autonumber_mode.ToString() != CurrentUser.Get_Setting("QC_ItemViewer:AutonumberingMode", "NULL"))
                {
                    CurrentUser.Add_Setting("QC_ItemViewer:AutonumberingMode", autonumber_mode);
                    SobekCM_Database.Set_User_Setting(CurrentUser.UserID, "QC_ItemViewer:AutonumberingMode", autonumber_mode.ToString());
                }
            }

            // Check for size of thumbnail specified from the URL  - is it different than user's settings?
            if (CurrentRequest.Size_Of_Thumbnails > 0)
            {
                if (CurrentRequest.Size_Of_Thumbnails.ToString() != CurrentUser.Get_Setting("QC_ItemViewer:ThumbnailSize", "NULL"))
                {
                    CurrentUser.Add_Setting("QC_ItemViewer:ThumbnailSize", CurrentRequest.Size_Of_Thumbnails);
                    SobekCM_Database.Set_User_Setting(CurrentUser.UserID, "QC_ItemViewer:ThumbnailSize", CurrentRequest.Size_Of_Thumbnails.ToString());
                }
            }

            //Get any notes/comments entered by the user
            notes = HttpContext.Current.Request.Form["txtComments"] ?? String.Empty;

            if (!(Int32.TryParse(HttpContext.Current.Request.Form["QC_Sortable"], out makeSortable))) makeSortable = 3;
            // If the hidden move relative position is BEFORE, it is before the very first page
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:67,代码来源:QC_ItemViewer.cs


注:本文中的SobekCM.Core.Users.User_Object.Get_Setting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。