예제 #1
0
        private void FloorPlan_Load(object sender, EventArgs e)
        {
            // disallow user resizing or maximising of form
            // http://stackoverflow.com/questions/7970262/disable-resizing-of-a-windows-form
            getInstance().FormBorderStyle = FormBorderStyle.FixedSingle;
            getInstance().MaximizeBox     = false;

            setupDGV();

            // setup floor plan cells and textbox values
            setupFloorPlan(FLOOR_LENGTH, FLOOR_HEIGHT);

            // setup combo box for home's alarm state
            Common.fillComboBoxFromEnum <AlarmState>(ref cboAlarmState);
            if (home.HomeID != -1)
            {
                // load the state from the DB if the home previously existed
                cboAlarmState.SelectedItem = home.State;
            }

            // fetch the room information from the database
            Common.fillComboBoxFromEnum <RoomCategory>(ref cboCategory);
            Common.fillListBoxFromEnum <CompassPoint>(ref clbDoorLocations);

            int x = dgv.SelectedCells[0].ColumnIndex;
            int y = dgv.SelectedCells[0].RowIndex;

            setupRoomInformation(x, y);

            HomeConfig.getInstance().Show();
            HomeConfig.getInstance().Left = getInstance().Right;
        }
예제 #2
0
        private void FloorPlan_LocationChanged(object sender, EventArgs e)
        {
            Form  fp  = getInstance();
            Point loc = fp.Location;

            HomeConfig.getInstance().Left = fp.Right;
        }
        public static Form getInstance()
        {
            if (homeConfig == null)
            {
                homeConfig = new HomeConfig();
            }

            return(homeConfig);
        }