Exemplo n.º 1
0
 /// <summary>
 /// Parse the pathinfo.
 /// </summary>
 protected override void ParsePathInfo()
 {
     base.ParsePathInfo();
     if (base.ModuleParams != null)
     {
         if (base.ModuleParams.Length >= 2)
         {
             // First argument is the module action and the second is the Id of the file. The rest we don't care about for now.
             try
             {
                 this._currentAction = (DownloadsModuleActions)Enum.Parse(typeof(DownloadsModuleActions)
                                                                          , base.ModuleParams[0], true);
                 this._currentFileId = Int32.Parse(base.ModuleParams[1]);
             }
             catch (ArgumentException ex)
             {
                 throw new Exception("Error when parsing module action: " + base.ModuleParams[0], ex);
             }
             catch (Exception ex)
             {
                 throw new Exception("Error when parsing module parameters: " + base.ModulePathInfo, ex);
             }
         }
         else
         {
             this._currentAction = DownloadsModuleActions.ViewFiles;
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Parse the pathinfo.
 /// </summary>
 protected override void ParsePathInfo()
 {
     base.ParsePathInfo();
     if (base.ModuleParams != null)
     {
         if (base.ModuleParams.Length == 2)
         {
             // First argument is the module action and the second is the Id of the file.
             try
             {
                 this._currentAction = (DownloadsModuleActions)Enum.Parse(typeof(DownloadsModuleActions)
                     , base.ModuleParams[0], true);
                 this._currentFileId = Int32.Parse(base.ModuleParams[1]);
             }
             catch (ArgumentException ex)
             {
                 throw new Exception("Error when parsing module action: " + base.ModuleParams[0], ex);
             }
             catch (Exception ex)
             {
                 throw new Exception("Error when parsing module parameters: " + base.ModulePathInfo, ex);
             }
         }
     }
 }