Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            NavigationTrack navigationtrack = db.NavigationTracks.Find(id);

            db.NavigationTracks.Remove(navigationtrack);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        //
        // GET: /NavigationTrack/Details/5

        public ActionResult Details(int id = 0)
        {
            NavigationTrack navigationtrack = db.NavigationTracks.Find(id);

            if (navigationtrack == null)
            {
                return(HttpNotFound());
            }
            return(View(navigationtrack));
        }
Exemplo n.º 3
0
        //
        // GET: /NavigationTrack/Edit/5

        public ActionResult Edit(int id = 0)
        {
            NavigationTrack navigationtrack = db.NavigationTracks.Find(id);

            if (navigationtrack == null)
            {
                return(HttpNotFound());
            }
            ViewBag.RouteId = new SelectList(db.NavRoutes, "Id", "Name", navigationtrack.RouteId);
            return(View(navigationtrack));
        }
Exemplo n.º 4
0
 public ActionResult Edit(NavigationTrack navigationtrack)
 {
     if (ModelState.IsValid)
     {
         db.Entry(navigationtrack).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RouteId = new SelectList(db.NavRoutes, "Id", "Name", navigationtrack.RouteId);
     return(View(navigationtrack));
 }
Exemplo n.º 5
0
        public WindowManager(ITheme theme, RDMPMainForm mainForm, RefreshBus refreshBus, DockPanel mainDockPanel, IRDMPPlatformRepositoryServiceLocator repositoryLocator, ICheckNotifier globalErrorCheckNotifier)
        {
            _windowFactory = new WindowFactory(repositoryLocator, this);
            ActivateItems  = new ActivateItems(theme, refreshBus, mainDockPanel, repositoryLocator, _windowFactory, this, globalErrorCheckNotifier);

            _mainDockPanel = mainDockPanel;

            MainForm          = mainForm;
            RepositoryLocator = repositoryLocator;

            Navigation = new NavigationTrack <DockContent>((c) => c.ParentForm != null, (c) => c.Activate());
            mainDockPanel.ActiveDocumentChanged += mainDockPanel_ActiveDocumentChanged;
        }
Exemplo n.º 6
0
        public WindowManager(ITheme theme, RDMPMainForm mainForm, RefreshBus refreshBus, DockPanel mainDockPanel, IRDMPPlatformRepositoryServiceLocator repositoryLocator, ICheckNotifier globalErrorCheckNotifier)
        {
            _windowFactory = new WindowFactory(repositoryLocator, this);
            ActivateItems  = new ActivateItems(theme, refreshBus, mainDockPanel, repositoryLocator, _windowFactory, this, globalErrorCheckNotifier);

            GlobalExceptionHandler.Instance.Handler = (e) => globalErrorCheckNotifier.OnCheckPerformed(new CheckEventArgs(e.Message, CheckResult.Fail, e));

            _mainDockPanel = mainDockPanel;

            MainForm          = mainForm;
            RepositoryLocator = repositoryLocator;

            Navigation = new NavigationTrack <INavigation>(c => c.IsAlive, (c) => c.Activate(ActivateItems));
            mainDockPanel.ActiveDocumentChanged += mainDockPanel_ActiveDocumentChanged;
            ActivateItems.Emphasise             += RecordEmphasis;
        }
Exemplo n.º 7
0
        public ActionResult Create(NavigationTrack navigationtrack, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                var fileBytes = new byte[file.ContentLength];
                file.InputStream.Read(fileBytes, 0, file.ContentLength);

                navigationtrack.Image = fileBytes;

                db.NavigationTracks.Add(navigationtrack);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.RouteId = new SelectList(db.NavRoutes, "Id", "Name", navigationtrack.RouteId);
            return(View(navigationtrack));
        }
Exemplo n.º 8
0
        public override void SetDatabaseObject(IActivateItems activator, ExternalDatabaseServer databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            if (_navigationTrack == null)
            {
                //what happens when user clicks back/forward
                _navigationTrack = new NavigationTrack <LogViewerFilter>(f => true, f =>
                {
                    if (f.LoggingTable != LoggingTables.None)
                    {
                        var cmd = new ExecuteCommandViewLoggedData(activator, f);
                        cmd.Execute();
                    }
                });

                //set the initial filter
                _navigationTrack.Append(Filter);
                _back = new ToolStripButton("Back", FamFamFamIcons.Back, (s, e) => _navigationTrack.Back(true))
                {
                    DisplayStyle = ToolStripItemDisplayStyle.Image
                };
            }

            CommonFunctionality.Add(_back);

            CommonFunctionality.Add(label1);
            CommonFunctionality.Add(tbContentFilter);

            CommonFunctionality.Add(label2);
            CommonFunctionality.Add(tbTop);

            CommonFunctionality.Add(cbPreferNewer);


            if (!databaseObject.DiscoverExistence(DataAccessContext.Logging, out string reason))
            {
                activator.KillForm(ParentForm, "Database " + databaseObject + " did not exist:" + reason);
                return;
            }

            LogManager = new LogManager(databaseObject);
            FetchDataTable();
        }