Exemple #1
0
 public static void WCFHost_Start()
 {
     "Starting Host".info();
     HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
     TmRestHost = new TM_REST_Host().StartHost();
     TmRest     = TmRestHost.GetProxy();
 }
Exemple #2
0
 public TM_Rest_Direct()
 {
     //TMConfig.Current.TMSetup.UseAppDataFolder = true;									// set the TM XMl Database folder to be
     moq_HttpContext            = new API_Moq_HttpContext();
     HttpContextFactory.Context = moq_HttpContext.httpContext();
     TmRest = new TM_REST();
 }
 public static ITM_REST response_ContentType(this ITM_REST iRest_Admin, string contentType)
 {
     if (WebOperationContext.Current != null)
     {
         WebOperationContext.Current.OutgoingResponse.ContentType = contentType;
     }
     return(iRest_Admin);
 }
        public static ITM_REST redirect_To_Page(this ITM_REST iRestAdmin, string redirectTarget)
        {
            var webOperationContext = WebOperationContext.Current;

            if (webOperationContext.notNull())
            {
                redirectTarget = redirectTarget.replace("//", "/");            // in case they made it this far, prevent urls that have //
                iRestAdmin.response_ContentType_Html();
                webOperationContext.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.Redirect;
                webOperationContext.OutgoingResponse.Headers.Add("Location", redirectTarget);
            }
            return(iRestAdmin);
        }
 public static void Setup()
 {
     HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
     //TMConfig.Current.UseAppDataFolder = true;
     RestAdmin = new TM_REST();
 }
 public TBot_Brain(ITM_REST tmRest)
 {
     TmRest    = tmRest;
     StartTime = DateTime.Now;
 }
 public static ITM_REST response_ContentType_Html(this ITM_REST iRest_Admin)
 {
     return(iRest_Admin.response_ContentType("text/html"));
 }
 public static ITM_REST response_ContentType_Json(this ITM_REST iRest_Admin)
 {
     return(iRest_Admin.response_ContentType("application/json"));
 }
Exemple #9
0
 public TM_Rest_Hosted()
 {
     TMConfig.Current.TMSetup.UseAppDataFolder = true;                                                                                   // set the TM XMl Database folder to be
     HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
     TmRest = new TM_REST();
 }
Exemple #10
0
 public TBot_Brain(ITM_REST tmRest)
 {
     TmRest = tmRest;
     StartTime = DateTime.Now;
 }