Beispiel #1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Updates the space Used label
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[Jon Henning]	11/1/2004	Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void UpdateSpaceUsed()
        {
            string strDestFolder = PathUtils.Instance.AddTrailingSlash(UnMaskPath(DestPath));
            var objPortalController = new PortalController();
            string strUsed;
            string strQuota;

            if (PortalSettings.HostSpace == 0)
            {
                strQuota = Localization.GetString("UnlimitedSpace", LocalResourceFile);
            }
            else
            {
                strQuota = PortalSettings.HostSpace + "MB";
            }
            if (IsHostMenu)
            {
                lblFileSpace.Text = "&nbsp;";
            }
            else
            {
                long spaceUsed = objPortalController.GetPortalSpaceUsedBytes(FolderPortalID);
                if (spaceUsed < 1024)
                {
                    strUsed = spaceUsed.ToString("0.00") + "B";
                }
                else if (spaceUsed < (1024*1024))
                {
                    strUsed = (spaceUsed/1024).ToString("0.00") + "KB";
                }
                else
                {
                    strUsed = (spaceUsed/(1024*1024)).ToString("0.00") + "MB";
                }
                lblFileSpace.Text = string.Format(Localization.GetString("SpaceUsed", LocalResourceFile), strUsed, strQuota);
            }
        }