Example #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
#if DEBUG
#else
            if (!CheckForProductKey())
            {
                App.Current.Shutdown();
            }
#endif
            if (e.Args == null)
            {
                (new MainWindow()).Show();
            }
            else if (e.Args.Length == 0)
            {
                (new MainWindow()).Show();
            }
            else
            {
                string fileName = e.Args[0];
                if (File.Exists(fileName))
                {
                    new MainWindow(PresentationViewModel.DeserializeFromXML(fileName)).Show();
                }
                else
                {
                    (new MainWindow()).Show();
                }
            }

            base.OnStartup(e);
        }
        public MainWindow(PresentationViewModel presentation)
        {
            this.DataContext = presentation;
            InitializeComponent();

            this._myViewModel.SlideShow.SlideChanged += new EventHandler(SlideShow_SlideChanged);
        }
Example #3
0
        public async Task <ActionResult> PresentationAttach(int requirementID)
        {
            Requirement requirement = await requirementRepository.FindRequirementByIDAsync(requirementID);

            PresentationViewModel model = new PresentationViewModel(requirement);

            return(View(model));
        }
Example #4
0
 public IActionResult Post([FromBody] PresentationViewModel presentation)
 {
     if (ModelState.IsValid)
     {
         _presentServ.PostPresentation(presentation);
         return(Ok(presentation));
     }
     return(HttpBadRequest(ModelState));
 }
Example #5
0
        public void Should_Produce_Document_One_Match()
        {
            var source  = "Hello world from my \"hello world\" application";
            var pattern = "hello";
            var vm      = new PresentationViewModel();

            vm.Parse();
            Assert.AreEqual(source, vm.SourceText);
            Assert.AreEqual(pattern, vm.RegexPattern);
            Assert.AreEqual(source, new TextRange(vm.ParsedDocument.ContentStart, vm.ParsedDocument.ContentEnd).Text.Trim());
        }
        private void btnAddPresentation_Click(object sender, RoutedEventArgs e)
        {
            var view = new PresentationView();
            var presentationViewModel = new PresentationViewModel()
            {
                Researcher = (ResearcherViewModel)DataContext,
                Mode       = Mode.Add
            };

            view.DataContext = presentationViewModel;
            view.ShowDialog();
        }
        public PresentationViewModel MapPresentationToPresentationViewModel(Presentation presentation)
        {
            var presentationViewModel = new PresentationViewModel
            {
                PresentationId   = presentation.PresentationId,
                Title            = presentation.Title,
                ShortDescription = presentation.ShortDescription,
                LongDescription  = presentation.LongDescription,
                Tags             = makeTagsString(presentation.PresentationTags.Select(a => a.Tag).ToList())
            };

            return(presentationViewModel);
        }
        // Add a new presentation
        public void PostPresentation(PresentationViewModel presentation)
        {
            var newPresentation = new Presentation()
            {
                Title        = presentation.Title,
                ConferenceId = presentation.ConferenceId,
                Description  = presentation.Description,
                ImageUrl     = presentation.ImageUrl
            };

            _presentRepo.AddPresentation(newPresentation);
            _presentRepo.SaveChanges();
        }
Example #9
0
        public async Task <ActionResult> PresentationAttach(int requirementID, int customerID, int contractorID)
        {
            //PresentationViewModel model = new PresentationViewModel();
            //model.RequirementID = requirementID;
            //return View(model);
            Requirement requirement = await requirementRepository.FindRequirementByIDAsync(requirementID);

            ViewBag.CustomerID   = customerID;
            ViewBag.ContractorId = contractorID;
            PresentationViewModel model = new PresentationViewModel(requirement);

            return(View(model));
        }
        public PresentationViewModelTests()
        {
            var factory = new FakeHttpClientFactory();

            _httpClient = factory.Client;

            var messageBus = new MessageBus(new MessagingCenter());

            _errorHandler = new ErrorHandler(messageBus);
            var service = new PresentationsService(new FakeConfig(), factory, _errorHandler);

            _viewModel = new PresentationViewModel(null, service, _errorHandler, messageBus);
        }
 public ViewResult AddPresentation()
 {
     var model = new PresentationViewModel
     {
         Presentation = new Presentation(),
         Attendee = new Attendee(),
         Conference = new Conference(),
         Room = new Room(),
         Attendees = context.Attendees.List(),
         Conferences = context.Conferences.List(),
         Rooms = context.Rooms.List()
     };
     return View(model);
 }
        public PresentationView()
        {
            InitializeComponent();
            PresentationViewModel viewModel = DataContext as PresentationViewModel;

            if (viewModel != null)
            {
                viewModel.ViewInstance = this;
                if (!viewModel.IsDocked)
                {
                    this.RootGrid.Children.Remove(this.PresentationGrid);
                }
            }
        }
Example #13
0
        public ActionResult Presentation(int id)
        {
            if (id == 0)
            {
                //return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            var PresentationViewModel = new PresentationViewModel();

            PresentationViewModel.CompData = (from a in db.Competitions where a.CompID == id select a).FirstOrDefault();
            int i = 0;

            foreach (var t in db.StudentTeams.Where(a => a.CompID == id))
            {
                var AverageScore = 0;
                var Round1Score  = (from r in db.RoundEntries where r.TeamID == t.TeamID && r.Round == 1 select r).FirstOrDefault();
                var Round2Score  = (from r in db.RoundEntries where r.TeamID == t.TeamID && r.Round == 2 select r).FirstOrDefault();
                if (Round1Score != null)
                {
                    AverageScore += Round1Score.Score;
                }
                if (Round2Score != null)
                {
                    AverageScore += Round2Score.Score;
                }
                if (Round1Score != null || Round2Score != null)
                {
                    AverageScore = AverageScore / 2;
                }

                var PresentationScoreboardModel = new PresentationScoreboardModel();
                if (Round1Score != null || Round2Score != null)
                {
                    PresentationScoreboardModel.TeamID             = t.TeamID;
                    PresentationScoreboardModel.TeamName           = t.TeamName;
                    PresentationScoreboardModel.TeamNumberBranch   = t.TeamNumberBranch;
                    PresentationScoreboardModel.TeamNumberSpecific = t.TeamNumberSpecific;
                    PresentationScoreboardModel.Average            = AverageScore;
                    PresentationViewModel.Scoreboard.Add(PresentationScoreboardModel);
                }
            }
            int c = 0;

            foreach (var count in db.StudentTeams.Where(a => a.CompID == id))
            {
                c++;
            }
            PresentationViewModel.TeamCount  = c;
            PresentationViewModel.Scoreboard = PresentationViewModel.Scoreboard.OrderByDescending(s => s.Average).ToList();
            return(View(PresentationViewModel));
        }
 public ViewResult EditPresentation(int id)
 {
     Presentation p = context.Presentations.Get(id);
     var model = new PresentationViewModel
     {
         Presentation = p,
         Attendee = context.Attendees.Get(p.PresenterID),
         Conference = context.Conferences.Get(p.ConferenceID),
         Room = context.Rooms.Get(p.RoomID),
         Attendees = context.Attendees.List(),
         Conferences = context.Conferences.List(),
         Rooms = context.Rooms.List()
     };
     return View(model);
 }
 public AddPresentation(bool isEdit, PresentationViewModel presentation)
 {
     InitializeComponent();
     _isEdit = isEdit;
     if (isEdit && presentation == null)
     {
         throw new ArgumentNullException(nameof(presentation), "Обязательно нужен исследователь");
     }
     Presentation      = presentation ?? new PresentationViewModel();
     _model            = _isEdit ? Presentation.Clone() : Presentation;
     DataContext       = Presentation;
     AddButton.Content = _isEdit ? "Сохранить" : "Добавить";
     this.Title        = _isEdit ? "Изменить доклад" : "Добавить доклад";
     DatePicker.Value  = DateTime.Now;
 }
Example #16
0
        private void btnOpen_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog myDialog = new OpenFileDialog();

            myDialog.Filter = "Sunum Dosyası (*.usm)|*.usm";
            myDialog.Title  = "Sunum Dosyası Aç";
            if (myDialog.ShowDialog().Value)
            {
                if (myDialog.CheckFileExists)
                {
                    MainWindow newWindow = new MainWindow(PresentationViewModel.DeserializeFromXML(myDialog.FileName));
                    newWindow.Show();
                    this.Close();
                }
            }
        }
Example #17
0
        // GET: ContractorRequirements/PresentationDelete/5
        public async Task <ActionResult> PresentationDelete(int?presentationID)
        {
            if (presentationID == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Presentation presentation = await presentationRepository.FindByIdAsync(presentationID.Value);

            if (presentation == null)
            {
                return(HttpNotFound());
            }
            var presentationViewModel = new PresentationViewModel(presentation);

            return(View(presentationViewModel));
        }
        public async Task <IActionResult> Create([Bind("Title,ShortDescription,LongDescription,Tags")] PresentationViewModel presentationViewModel)
        {
            if (ModelState.IsValid)
            {
                var currentSpeaker = await _speakerRepository.GetSpeakerBySpeakerEmailAsync(HttpContext.User.Identity.Name);

                var presentationTag = _presentationViewModelMapper.MapToPresentationTag(presentationViewModel, currentSpeaker);
                await _presentationManager.AddPresentation(presentationTag);

                //_context.Add(presentation);
                //await _context.SaveChangesAsync();
                return(RedirectToAction(nameof(Index)));
            }
            //return View(presentation);
            return(View());
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var initData = (ProjectionViewPageInitializationData)e.Parameter;

            // The ViewLifetimeControl is a convenient wrapper that ensures the
            // view is closed only when the user is done with it
            thisViewControl = initData.ProjectionViewPageControl;
            mainDispatcher  = initData.MainDispatcher;
            mainViewId      = initData.MainViewId;
            vm = initData.vm;

            // Listen for when it's time to close this view
            thisViewControl.Released += thisViewControl_Released;

            Focus(FocusState.Programmatic);
        }
Example #20
0
        public void ShouldNotifyOnSlideChange()
        {
            //GIVEN
            var viewModel = new PresentationViewModel(Any.String(), 0, Any.Instance <PresentationProgressObserver>())
            {
                TotalSlides = 100
            };
            var dummy = Substitute.For <IDummy>();

            viewModel.PropertyChanged += dummy.Invoked;

            //WHEN
            viewModel.NextSlideCommand.Execute(null);

            //THEN
            dummy.Received(1).Invoked(viewModel, Arg.Is <PropertyChangedEventArgs>(
                                          args => args.PropertyName == "CurrentSlide"));
        }
        public IActionResult Details([FromQuery] PresentationViewModel presentationViewModel)
        {
            //if (id == null)
            //{
            //    return NotFound();
            //}

            //var presentation = await _context.Presentations
            //    .FirstOrDefaultAsync(m => m.PresentationId == id);
            //if (presentation == null)
            //{
            //    return NotFound();
            //}



            return(View(presentationViewModel));
        }
Example #22
0
        public async Task <ActionResult> PresentationReject(int?presentationID, int customerID, int contractorID)
        {
            if (presentationID == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Presentation presentation = await presentationRepository.FindByIdAsync(presentationID.Value);

            if (presentation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CustomerID   = customerID;
            ViewBag.ContractorId = contractorID;

            var presentationViewModel = new PresentationViewModel(presentation);

            return(View(presentationViewModel));
        }
Example #23
0
        public async Task <ActionResult> PresentationRejectConfirmed(PresentationViewModel model, int customerID, int contractorID)
        {
            if (ModelState.IsValid)
            {
                Presentation presentation = await presentationRepository.FindByIdAsync(model.PresentationID);

                presentation.Observations  = model.Observations;
                presentation.RejectedForID = this.CurrentUserID;
                await presentationRepository.Reject(presentation);

                //Se recuperan los mails de los usuarios del Contratista
                var mailReceipts = await presentationServices.GetMailsContractors(contractorID);

                //Se envia un mail Avisando la situacion
                await workflowMessageService.SendRequirementPresentationRejectNotificationMessageAsync(presentation.ToDisplayViewModel(), mailReceipts);
            }

            return(RedirectToAction("PresentationsIndex", "Requirements", new { requirementID = model.RequirementID, customerID = customerID, contractorID = contractorID }));
            //return RedirectToAction("Index");
        }
Example #24
0
        private static void RunPresentation(string path)
        {
            var helperViewModel       = new HelperViewModel(path);
            var presentationViewModel = new PresentationViewModel(path, 0, helperViewModel);

            var helper = new HelperView(new PresentationTime(helperViewModel))
            {
                DataContext = helperViewModel,
            };
            var presentationView = new PresentationView
            {
                DataContext = presentationViewModel
            };

            presentationView.Show();

            helper.Owner = presentationView;

            helper.Show();
            presentationView.FocusOnPdf();
        }
Example #25
0
        //[ValidateAntiForgeryToken]
        public async Task <ActionResult> PresentationAttach(PresentationViewModel model, HttpPostedFileBase documentFiles)
        {
            if (ModelState.IsValid)
            {
                Presentation presentation = (Presentation)model.GetPresentation();

                var requirement = await requirementRepository.FindRequirementByIDAsync(model.RequirementID);

                presentation.RequirementID = model.RequirementID;

                try
                {
                    //Se suben los documentos
                    presentation.DocumentFiles = await documentFileService.UploadDocumentFileAsync(documentFiles, DocumentManager.GetFileName(requirement));

                    //Se crea la Presentacion
                    await presentationServices.CreateAsync(presentation);

                    //Se recuperan los mails de los auditores
                    var mailReceipts = await presentationServices.GetMailsAuditors(presentation);

                    //Se envian el mail avisando que se subio una Presentacion a un Requerimiento
                    //workflowMessageService.SendRequirementPresentationNotificationMessage(new PresentationViewModel(presentation), mailReceipts);
                    await workflowMessageService.SendRequirementPresentationNotificationMessageAsync(presentation.ToDisplayViewModel(), mailReceipts);

                    return(RedirectToAction("Index", Request.QueryString.ToRouteValues()));
                }
                catch (Exception e)
                {
                    var errors = string.Join(",", e.Message);
                    ModelState.AddModelError(string.Empty, errors);
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
 public override void When()
 {
     viewModel = new PresentationViewModel(view);
 }
Example #27
0
        private PresentationViewModel[] GetMuddlingThruPresentations()
        {
            var presentations = new PresentationViewModel[]  {
                new PresentationViewModel(
                    "May",
                    2014,
                    @"Internet Security?",
                    @"Web security is a matter of degree and risk. Consider an analogy to your home. While it cannot be as secure as Fort Knox, you can avoid leaving your door ajar, and while you might never have a flood, you should probably buy insurance. How secure do you need to be?",
                    "Shaun Luttin with Cindy Jacobsen",
                    @"http://1drv.ms/1rT7n7I",
                    "PowerPoint",
                    "Poster_InternetSecurity_May2014",
                    true),

                new PresentationViewModel(
                    "April",
                    2014,
                    @"What’s up with Windows XP?",
                    @"Microsoft stopped supporting Windows XP in early April. If you're using Windows XP, you might wonder, 'Do I need to do anything?' We will look at three options. This is a beginner level talk for people currently using Windows XP.",
                    "Shaun Luttin",
                    @"http://1drv.ms/1rT7m3T",
                    "PowerPoint",
                    "Poster_WindowsXP_Apr2014",
                    true),

                new PresentationViewModel(
                    "March",
                    2014,
                    "Intro to Windows 8",
                    "Back by Popular Demand! Understand the new layout and metro mode; learn key locations and navigation skills; backup your data and minimize viruses.",
                    "Shaun Luttin",
                    "http://1drv.ms/1rT7ksM",
                    "Windows 8.1 Cheat Sheet",
                    "Poster_Windows8_101_Mar2014",
                    true),

                new PresentationViewModel(
                    "January",
                    2014,
                    "Intro to Windows 8",
                    "Understand the new layout and metro mode; learn key locations and navigation skills; backup your data and minimize viruses.",
                    "Shaun Luttin",
                    "http://1drv.ms/1rT7ksM",
                    "Windows 8.1 Cheat Sheet",
                    "Poster_Windows8_101_Jan2014",
                    true),

                new PresentationViewModel(
                    "July",
                    2013,
                    "Searching the Internet",
                    "Ways to Search the Internet with a Focus on Using Google.",
                    "Shaun Luttin",
                    @"http://1drv.ms/1rT7iRG",
                    "PowerPoint",
                    "Poster_GoogleSearch_101",
                    true),

                new PresentationViewModel(
                    "June",
                    2013,
                    "Getting on the Internet",
                    "Ways to Access the Internet with a Focus on Using a Browser.",
                    "Shaun Luttin",
                    @"http://1drv.ms/1rT7fVW",
                    "PowerPoint",
                    "Poster_Internet_101",
                    true)
            };

            return(presentations);
        }