Beispiel #1
0
 public virtual string ToHtml()
 {
     if (Text != null)
     {
         return(System.Web.HttpUtility.HtmlEncode(Text));
     }
     return(String.Format(ResourceManagerSingleton.GetResourceString("ProgressInfoFormat"),
                          Value, Maximum, Units));
 }
Beispiel #2
0
        protected override void OnPreRender(EventArgs e)
        {
            if (UploadModule.IsEnabled)
            {
                // If we don't have a session yet and the session mode is not "Off", we need to create a
                // session so that it can be used to pass information between the progress display and the
                // upload request.  Apparently the only way to force the session to be created is to put
                // something in it.
                if (HttpContext.Current.Session != null &&
                    Page.Session.Mode != System.Web.SessionState.SessionStateMode.Off &&
                    Page.Session.Count == 0 &&
                    !Page.Session.IsReadOnly)
                {
                    Page.Session["NeatUpload_value"] = "ignored";
                }

                InitializeVars();
                if (!Page.IsClientScriptBlockRegistered("NeatUploadJs"))
                {
                    Page.RegisterClientScriptBlock("NeatUploadJs", @"
	<script type='text/javascript' language='javascript' src='"
                                                   + UploadModule.BustCache(ResolveUrl("~/NeatUpload/NeatUpload.js"))
                                                   + @"'></script>");
                }
                if (!Page.IsClientScriptBlockRegistered("NeatUploadProgressBar"))
                {
                    Page.RegisterClientScriptBlock("NeatUploadProgressBar", @"
	<script type='text/javascript' language='javascript'>
	NeatUploadPB.prototype.ClearFileNamesAlert = '"     + ResourceManagerSingleton.GetResourceString("ClearFileNamesAlert") + @"';
	// -->
	</script>
	"    );
                }
                this.Page.RegisterStartupScript("NeatUploadProgressBarBase-" + this.UniqueID, GetStartupScript());
            }
            base.OnPreRender(e);
        }
Beispiel #3
0
 /// <summary>
 /// Creates an <see cref="InvalidStorageConfigException"/>, given a
 /// text description of the problem.
 /// </summary>
 /// <param name="details">
 /// A description of the problem.
 /// </param>
 public InvalidStorageConfigException(string details)
     : base(500, String.Format(ResourceManagerSingleton.GetResourceString("InvalidStorageConfigMessageFormat"), details))
 {
     Details = details;
 }
Beispiel #4
0
 protected virtual string GetResourceString(string resourceName)
 {
     return(ResourceManagerSingleton.GetResourceString(resourceName));
 }
 /// <summary>
 /// Creates an <see cref="NonfilePortionTooLargeException"/>, given the maximum allowed
 /// length of the non-file portion of the request, and the actual length of the non-file
 /// portion of the request.
 /// </summary>
 /// <param name="maxNormalRequestLength">
 /// The maximum allowed length of the non-file portion of the request.
 /// </param>
 /// <param name="normalRequestLength">
 /// The length of the non-file portion of the request.
 /// </param>
 /// <remarks>The HTTP status code for this exception will be 413, and the message
 /// will be retrieved from the "NonfilePortionTooLargeMessageFormat" resource in
 /// NeatUpload.Strings.resx.</remarks>
 public NonfilePortionTooLargeException(long maxNormalRequestLength, long normalRequestLength)
     : base(413, String.Format(ResourceManagerSingleton.GetResourceString("NonfilePortionTooLargeMessageFormat"), maxNormalRequestLength, normalRequestLength))
 {
     MaxNormalRequestLength = maxNormalRequestLength;
     NormalRequestLength    = normalRequestLength;
 }
 /// <summary>
 /// Creates an <see cref="UploadTooLargeException"/>, given the maximum allowed
 /// request length, and the length of the request which was too large.
 /// </summary>
 /// <param name="maxRequestLength">
 /// The maximum allowed request length
 /// </param>
 /// <param name="requestLength">
 /// The length of the request which was too large.
 /// </param>
 /// <remarks>The HTTP status code for this exception will be 413, and the message
 /// will be retrieved from the "UploadTooLargeMessageFormat" resource in
 /// NeatUpload.Strings.resx.</remarks>
 public UploadTooLargeException(long maxRequestLength, long requestLength)
     : base(413, String.Format(ResourceManagerSingleton.GetResourceString("UploadTooLargeMessageFormat"), maxRequestLength, requestLength))
 {
     MaxRequestLength = maxRequestLength;
     RequestLength    = requestLength;
 }