コード例 #1
0
        public HomeController()
        {
            photosWebModel = new PhotosWebModel(configModel.OutputDirectory);
            string outputdirPath = configModel.OutputDirectory;

            imageWebModel = new ImageWebModel(outputdirPath);
        }
        // GET: First/Details
        public ActionResult ImageWeb()
        {
            students = GetStudents();
            ImageWebModel model = new ImageWebModel(students);

            return(View(model));
        }
コード例 #3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            ImageWebModel      model  = ImageWebModel.GetModel();
            CommandsController cc     = new CommandsController(model);
            ComunicationClient client = ComunicationClient.GetClient(8000);

            client.CommandReceived += delegate(object senderObj, CommandReceivedEventArgs args)
            {
                JsonCommand jCommand = args.JsonCommand;
                cc.ExecuteCommand(jCommand.CommandID, jCommand.Args, jCommand.JsonData);
            };
            try
            {
                client.ConnectToServer();
                client.sendCommand((int)CommandsEnum.GetConfigCommand, null);
                client.sendCommand((int)CommandsEnum.LogsCommand, null);
            }
            catch
            {
                Console.WriteLine("failed to connect to server");
            }
        }
コード例 #4
0
        // GET: First/ImageWeb
        public ActionResult ImageWeb()
        {
            ImageWebModel model = new ImageWebModel();

            model.NumPhotos = new PhotosModel().NumPhotos;
            model.Students  = students;
            return(View(model));
        }
コード例 #5
0
 /// <summary>
 /// photo controller constructor
 /// </summary>
 public PhotoController()
 {
     photoModel    = new PhotoModel();
     logModel      = new LogModel();
     configModel   = new ConfigModel();
     imageWebModel = new ImageWebModel();
     NumOfPicture  = photoModel.getNumber();
 }
コード例 #6
0
 public CommandsController(ImageWebModel model)
 {
     this.commands = new Dictionary <int, ICommand>();
     this.commands.Add((int)CommandsEnum.GetConfigCommand, new GetAppConfigCommand(model));
     this.commands.Add((int)CommandsEnum.LogsCommand, new GetLogsCommand(model));
     this.commands.Add((int)CommandsEnum.LogCommand, new LogCommand(model));
     this.commands.Add((int)CommandsEnum.RemoveDirCommand, new RemoveDirCommand(model));
 }
コード例 #7
0
        /// <summary>
        /// Returns the view of the image web
        /// </summary>
        /// <returns> view of the image web</returns>
        // GET: First
        public ActionResult ImageWeb()
        {
            List <ImageWebModel.Student> studentsList = ImageWebModel.LoadText();
            ImageWebModel iWM = ImageWebModel.Instance;

            ViewBag.status = iWM.GetServiceStatus();

            int numOfPics = iWM.GetNumOfPics();

            if (numOfPics == -1)
            {
                ViewBag.numOfPhotos = "Error occurred, Couldn't get the output directory from the service";
            }
            else
            {
                ViewBag.numOfPhotos = iWM.GetNumOfPics();
            }
            return(View(studentsList));
        }
コード例 #8
0
 public GetLogsCommand(ImageWebModel model)
 {
     this.model = model;
 }
コード例 #9
0
 public RemoveDirCommand(ImageWebModel model)
 {
     this.model = model;
 }
コード例 #10
0
 // GET: Home
 public ActionResult Index()
 {
     imageWebModel = new ImageWebModel(WebClient.GetInstance(), outputDir);
     return(View(imageWebModel));
 }
コード例 #11
0
 public ImageWebViewController()
 {
     model = ImageWebModel.GetModel();
 }
コード例 #12
0
 public GetAppConfigCommand(ImageWebModel model)
 {
     this.model = model;
 }
コード例 #13
0
 public LogCommand(ImageWebModel model)
 {
     this.model = model;
 }
コード例 #14
0
 public PhotosViewController()
 {
     model = ImageWebModel.GetModel();
 }
コード例 #15
0
 public DeletePhotoViewController()
 {
     model = ImageWebModel.GetModel();
 }