Esempio n. 1
0
        /// <summary>
        /// Spracuje request poziadavku na nacitanie obrazku
        /// </summary>
        /// <param name="context">HttpContext</param>
        public void ProcessRequest(HttpContext context)
        {
            String          file = context.Request.RawUrl.Replace("/file/", String.Empty);
            Nullable <Guid> key  = file.Replace(".data", String.Empty).ToGuidWithoutDash();

            if (key.HasValue)
            {
                FileModelBase fileModel = null;
                if (WebConfiguration.OnFileLoadDelegate != null)
                {
                    fileModel = WebConfiguration.OnFileLoadDelegate(key.Value);
                }
                if (fileModel != null)
                {
                    context.Response.ContentType = fileModel.ContentType;
                    context.Response.BinaryWrite(fileModel.Data);
                    return;
                }
            }

            context.Response.StatusCode        = 404;
            context.Response.StatusDescription = "File not found !";
            context.Response.End();
        }
Esempio n. 2
0
 public ConsoleConfigWindow(FileModelBase consoleMachine)
 {
     _consoleMachine = consoleMachine;
     InitializeComponent();
 }