Пример #1
0
 public TaskManager(RepeatClient client)
 {
     this.client   = client;
     this.compiler = new CSCompiler(".");
     actions       = new Dictionary <string, UserDefinedAction>();
     emptyAction   = new EmptyAction("");
 }
        public IHttpActionResult PutRepeatClient(int id, RepeatClient repeatClient)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != repeatClient.RepeatClientId)
            {
                return(BadRequest());
            }

            db.Entry(repeatClient).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RepeatClientExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            RepeatClient repeatClient = db.RepeatClients.Find(id);

            db.RepeatClients.Remove(repeatClient);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #4
0
 public ActionResult Edit([Bind(Include = "id,value")] RepeatClient repeatClient)
 {
     if (ModelState.IsValid)
     {
         db.Entry(repeatClient).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(repeatClient));
 }
Пример #5
0
        public static void Main(String[] args)
        {
            SetConsoleCtrlHandler(new HandlerRoutine(ConsoleCtrlCheck), true);
            BasicConfigurator.Configure();
            int port = GetPort(args);

            client = new RepeatClient(port);
            client.StartRunning();
            logger.Info("Successfully started C# IPC client.");
        }
Пример #6
0
        public ActionResult Create([Bind(Include = "id,value")] RepeatClient repeatClient)
        {
            if (ModelState.IsValid)
            {
                db.RepeatClients.Add(repeatClient);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(repeatClient));
        }
        public IHttpActionResult GetRepeatClient(int id)
        {
            RepeatClient repeatClient = db.RepeatClients.Find(id);

            if (repeatClient == null)
            {
                return(NotFound());
            }

            return(Ok(repeatClient));
        }
        public IHttpActionResult PostRepeatClient(RepeatClient repeatClient)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.RepeatClients.Add(repeatClient);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = repeatClient.RepeatClientId }, repeatClient));
        }
Пример #9
0
        // GET: RepeatClients/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RepeatClient repeatClient = db.RepeatClients.Find(id);

            if (repeatClient == null)
            {
                return(HttpNotFound());
            }
            return(View(repeatClient));
        }
        public IHttpActionResult DeleteRepeatClient(int id)
        {
            RepeatClient repeatClient = db.RepeatClients.Find(id);

            if (repeatClient == null)
            {
                return(NotFound());
            }

            db.RepeatClients.Remove(repeatClient);
            db.SaveChanges();

            return(Ok(repeatClient));
        }
Пример #11
0
 public MouseRequest(RepeatClient client) : base(client)
 {
     this.Type   = "action";
     this.Device = "mouse";
 }
Пример #12
0
 public KeyboardRequest(RepeatClient client) : base(client)
 {
     this.Type   = "action";
     this.Device = "keyboard";
 }
Пример #13
0
 public RequestGenerator(RepeatClient client)
 {
     this.client  = client;
     ParamStrings = new List <string>();
     ParamInt     = new List <int>();
 }
Пример #14
0
 public SystemClientRequest(RepeatClient client) : base(client)
 {
     this.Type   = "system_client";
     this.Device = "system";
 }
Пример #15
0
 public ToolRequest(RepeatClient client) : base(client)
 {
     this.Type   = "action";
     this.Device = "tool";
 }
Пример #16
0
 public SharedMemoryRequest(RepeatClient client) : base(client)
 {
     this.Type   = "shared_memory";
     this.Device = "shared_memory";
 }