Inheritance: AbstractDialog
コード例 #1
0
ファイル: MainView.cs プロジェクト: Railec/SE1cKBS2
        // The constructor for the main view
        public MainView(string name)
            : base(name)
        {
            this._locationlist = new List<Label>();
            this._buildinglist = new List<Label>();
            this._floorlist = new List<Label>();

            this._doch = DocumentHandler.GetInstance();
            this.SelectCorrectLocations();

            this._addLocationDialog = new AddLocationDialog("Locatie toevoegen", delegate () {
                this.RemoveAllLocationsFromPanel();
                this.SelectCorrectLocations();
                this._locationLabelLocationY = 0;
                this.PlaceLocationsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._addBuildingDialog = new AddBuildingDialog("Gebouw toevoegen", delegate () {        // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.RemoveAllBuildingsFromPanel();
                this.SelectCorrectBuildings(this._currentLocationID); // The floors of the current building are being selected.
                this._locationLabelBuildingY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceBuildingsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown });
            });

            this._addFloorDialog = new AddFloorDialog("Verdieping toevoegen", delegate () {
                this.RemoveAllFloorsFromPanel(); // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.SelectCorrectFloors(this._currentBuildingID); // The floors of the current building are being selected.
                this._locationLabelFloorY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceFloorsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown
            });

            this._deleteLocationDialog = new DeleteLocationDialog("Locatie verwijderen", delegate () {
                this.RemoveAllLocationsFromPanel();
                this.RemoveAllBuildingsFromPanel();
                this.RemoveAllFloorsFromPanel();
                this.SelectCorrectLocations();
                this._locationLabelLocationY = 0;
                this.PlaceLocationsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._deleteBuildingDialog = new DeleteBuildingDialog("Gebouw verwijderen", delegate () {        // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.RemoveAllFloorsFromPanel();
                this.RemoveAllBuildingsFromPanel();
                this.SelectCorrectBuildings(this._currentLocationID); // The floors of the current building are being selected.
                this._locationLabelBuildingY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceBuildingsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown });
            });

            this._deleteFloorDialog = new DeleteFloorDialog("Verdieping verwijderen", delegate () {
                this.RemoveAllFloorsFromPanel(); // If the floor has been added, all floors and their labels will be deleted from the panel and their arrays
                this.SelectCorrectFloors(this._currentBuildingID); // The floors of the current building are being selected.
                this._locationLabelFloorY = 0; // The field for the Y-coordinate of the labels of the floors is set to zero.
                this.PlaceFloorsOnPanel(); // The labels of the floors are being placed on the panel with each their own spcific Y-coordinate.
                this.DecisionShowScrollbar(); // Decide if the scrollbar has to be shown
            });

            this._editLocationDialog = new EditLocationDialog("Locatie wijzigen", delegate () {
                this.RemoveAllLocationsFromPanel();
                this.SelectCorrectLocations();
                this._locationLabelLocationY = 0;
                this.PlaceLocationsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._editBuildingDialog = new EditBuildingDialog("Gebouw wijzigen", delegate () {
                this.RemoveAllBuildingsFromPanel();
                this.SelectCorrectBuildings(this._currentLocationID);
                this._locationLabelBuildingY = 0;
                this.PlaceBuildingsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._editFloorDialog = new EditFloorDialog("Verdieping wijzigen", delegate () {
                this.RemoveAllFloorsFromPanel();
                this.SelectCorrectFloors(this._currentBuildingID);
                this._locationLabelFloorY = 0;
                this.PlaceFloorsOnPanel();
                this.DecisionShowScrollbar();
            });

            this._addItemTypeDialog = new AddItemTypeDialog("Meubel type toevoegen", null);
            this._addItemDialog = new AddItemDialog("Meubel toevoegen",null);
        }
コード例 #2
0
ファイル: FloorView.cs プロジェクト: Railec/SE1cKBS2
        /**
           * This method is required for designer support and is by default a good place to organise controls in a state.
           */
        protected override void InitializeComponent()
        {
            //TODO: Current Loc & Building should come from something set BEFORE this state is reached.
            DocumentHandler doch = DocumentHandler.GetInstance();
            if (_isLoaded) {
                doch.CurrentLocation = LocationHandler.GetInstance().GetLocationBy((location) => location.Id == this._currentLocationID);
                doch.CurrentBuilding = BuildingHandler.GetInstance().GetBuildingBy((building) => building.Id == this._currentBuildingID);
                doch.CurrentFloor = FloorHandler.GetInstance().GetFloorBy((floor) => floor.GetID() == this._currentFloorID);
            }
            else {

                doch.CurrentLocation = LocationHandler.GetInstance().GetLocationBy((location) => location.Id == 1);
                doch.CurrentBuilding = BuildingHandler.GetInstance().GetBuildingBy((building) => building.Id == 1);
                if (doch.CurrentBuilding != null) {
                    doch.CurrentFloor = FloorHandler.GetInstance().GetFloorBy((floor) => floor.GetBuildingID() == doch.CurrentBuilding.Id);
                }
            }

            this._navigation = new NavigationStrip();
            this.FillNavigationStrip();

            this._blueprint = new BlueprintPanel();
            this._blueprint.Size = new Size(this.Form.ClientSize.Width - 10, this.Form.ClientSize.Height - 35);
            this._blueprint.Top = 30;
            this._blueprint.Left = 5;
            this._blueprint.MouseClick += this.EventBlueprintClick;

            this._addLocationDialog = new AddLocationDialog("Locatie toevoegen", this.FillNavigationStrip);
            this._addBuildingDialog = new AddBuildingDialog("Gebouw toevoegen", this.FillNavigationStrip);
            this._addFloorDialog = new AddFloorDialog("Verdieping toevoegen", this.FillNavigationStrip);

            this._deleteLocationDialog = new DeleteLocationDialog("Locatie verwijderen", this.FillNavigationStrip);
            this._deleteBuildingDialog = new DeleteBuildingDialog("Gebouw verwijderen", this.FillNavigationStrip);
            this._deleteFloorDialog = new DeleteFloorDialog("Verdieping verwijderen", this.FillNavigationStrip);

            this._editLocationDialog = new EditLocationDialog("Locatie aanpassen", this.FillNavigationStrip);
            this._editBuildingDialog = new EditBuildingDialog("Gebouw wijzigen", this.FillNavigationStrip);
            this._editFloorDialog = new EditFloorDialog("Verdieping Aanpassen", this.FillNavigationStrip);

            this._selectRoomDialog = new SelectRoomDialog("Geselecteerde Kamer", null);
            this._selectFunctionDialog = new SelectFunctionDialog("Selecteer een functie");

            if (doch.CurrentFloor != null) {
                this.FillBlueprint(doch.CurrentFloor.GetID());
            }

            this.Controls.Add(this._addLocationDialog);
            this.Controls.Add(this._addBuildingDialog);
            this.Controls.Add(this._addFloorDialog);

            this.Controls.Add(this._deleteLocationDialog);
            this.Controls.Add(this._deleteBuildingDialog);
            this.Controls.Add(this._deleteFloorDialog);

            this.Controls.Add(this._editLocationDialog);
            this.Controls.Add(this._editBuildingDialog);
            this.Controls.Add(this._editFloorDialog);

            this.Controls.Add(this._selectRoomDialog);
            this.Controls.Add(this._selectFunctionDialog);

            this.Controls.Add(this._navigation);
            this.Controls.Add(this._blueprint);
        }