Exemple #1
0
 private void SelectionChangedHandler(object aObj, EventArgs aEvent)
 {
     DeviceSelectionChanged?.Invoke(this,
                                    DeviceListBox.SelectedItems.Cast <DeviceListItem>()
                                    .Where(aLI => aLI.Connected)
                                    .Select(aLI => aLI.Info).ToList());
 }
Exemple #2
0
        public HomeVM(User loggedInUser, Window view)
        {
            //System.Diagnostics.PresentationTraceSources.SetTraceLevel(this.View.dataGrid.ItemContainerGenerator, System.Diagnostics.PresentationTraceLevel.High);
            CurrentUser = loggedInUser;
            this.View   = view;

            //InMemoryAppender.LogData

            selectedSubstationChangedCmd = new SubstationSelectionChanged(this);
            selectedDeviceChangedCmd     = new DeviceSelectionChanged(this);
            openAddSubstationDialogCmd   = new OpenAddSubstation(this);
            deleteSubstationCmd          = new DeleteSubstation(this);
            redoCmd = new RedoCommand(this);
            undoCmd = new UndoCommand(this);
            openEditSubstationCmd = new OpenEditSubstation(this);
            refreshCommand        = new RefreshCommand(this);
            signOutCmd            = new SignOutCommand(this);
            openAddUserCmd        = new OpenAddUser(this);
            openEditUserDataCmd   = new OpenEditUserData(this);
            cloneSubstationCmd    = new CloneSubstationCmd(this);
            filterSubstationCmd   = new FilterSubstationsCmd(this);
            openAddDeviceCmd      = new OpenAddDevice(this);
            deleteDeviceCmd       = new DeleteDeviceCmd(this);
            openAddMeasurementCmd = new OpenAddMeasurement(this);
            deleteMeasurementCmd  = new DeleteMeasurement(this);

            #region initialize Undo/Redo data holders
            RedoHistory = new List <BaseCommand>();
            UndoHistory = new List <BaseCommand>();

            SubstationsUndo  = new List <Substation>();
            DevicesUndo      = new List <Device>();
            MeasurementsUndo = new List <Measurement>();

            SubstationsRedo  = new List <Substation>();
            DevicesRedo      = new List <Device>();
            MeasurementsRedo = new List <Measurement>();
            #endregion

            FilterName     = "";
            FilterLocation = "";

            //CurrentUser = UserProxy.Instance.Proxy.Login("admin", "admin");
            visibleIfAdmin = CurrentUser.isAdmin ? "Visible" : "Hidden"; // show/hide GUI elements based on priviledge

            RefreshData();
        }