コード例 #1
0
        public DataControl()
        {
            InitializeComponent();

            objects = DataHelper.GetObjectsWithGroups();
            parameters = DataHelper.GetParameters();

            objectsList.DataSource = objects;
            parametersList.DataSource = parameters;

            objectsView.CustomUnboundColumnData += new CustomColumnDataEventHandler((sender, e) => UnboundColumnData(sender, e, objects));
            objectsView.Columns["cLicField"].GroupIndex = 0;
            objectsView.Columns["cBranch"].GroupIndex = 1;
            objectsView.CellValueChanging += OnObjectSelected;

            parametersView.CustomUnboundColumnData += new CustomColumnDataEventHandler((sender, e) => UnboundColumnData(sender, e, parameters));
            parametersView.CellValueChanging += OnParameterSelected;

            displayObjects = new DisplayObjects(dataTable, dataView, chartControl);
            displayObjects.DataChanged += EnableButton;

            dataTable.DataSource = displayObjects.times;

            dataView.CustomUnboundColumnData += displayObjects.getUnboundColumnData;
            dataView.CellValueChanged += displayObjects.OnCellValueChanged;
            dataView.RowCellStyle += displayObjects.OnRowCellStyle;

            initTimeIntervals();

            closeButton.Click += OnCloseButtonClick;
        }
コード例 #2
0
        public TextViewModel AddText(Text text, int position)
        {
            var addedText = new TextViewModel(this, text, position);

            DisplayObjects.Add(addedText);
            RaiseAddedDisplayObjectEvent(this, addedText);
            return(addedText);
        }
コード例 #3
0
        public GamePasswordViewModel AddGamePassword(PasswordGameRequirement gamePasword, int position)
        {
            var addedPassword = new GamePasswordViewModel(this, gamePasword, position);

            DisplayObjects.Add(addedPassword);
            RaiseAddedDisplayObjectEvent(this, addedPassword);
            return(addedPassword);
        }
コード例 #4
0
        public PictureViewModel AddPicture(Picture picture, int position)
        {
            var addedPicture = new PictureViewModel(this, picture, position);

            DisplayObjects.Add(addedPicture);
            RaiseAddedDisplayObjectEvent(this, addedPicture);
            return(addedPicture);
        }
コード例 #5
0
        public PictureViewModel AddPicture(Picture picture)
        {
            var addedPicture = new PictureViewModel(this, picture, (int)picture.PositionInIntroduction);

            DisplayObjects.Add(addedPicture);
            RaiseAddedDisplayObjectEvent(this, addedPicture);
            return(addedPicture);
        }
コード例 #6
0
        public TextViewModel AddText(Text text)
        {
            var addedText = new TextViewModel(this, text, (int)text.PositionInIntroduction);

            DisplayObjects.Add(addedText);
            RaiseAddedDisplayObjectEvent(this, addedText);
            return(addedText);
        }
コード例 #7
0
        protected void UpdateDisplayObjects(object sender, AddedDisplayObjectEventArgs e)
        {
            var newDisplayObjects = DisplayObjects.OrderBy(t => t.Position).ToList();

            for (int i = 0; i < newDisplayObjects.Count; i++)
            {
                this.DisplayObjects[i] = newDisplayObjects[i];
            }
        }
コード例 #8
0
        public void UpdateDisplayObject(DisplayObjectViewModel item)
        {
            int index = DisplayObjects.IndexOf(item);

            if (index != -1)
            {
                DisplayObjects.Remove(item);
                DisplayObjects.Insert(index, item);
            }
        }
コード例 #9
0
 public DisplayObjectViewModel RemoveDisplayObject(DisplayObject objectToRemove)
 {
     foreach (DisplayObjectViewModel displayObject in DisplayObjects)
     {
         if (displayObject.BaseObject == objectToRemove)
         {
             DisplayObjects.Remove(displayObject);
             return(displayObject);
         }
     }
     return(null);
 }
コード例 #10
0
 public void draw()
 {
     echoTypedEnable = false;
     logger.log(Logger.Level.INFO, "Drawing screen...");
     VT4100.Send(clear);
     w_data       = new DisplayObjects(0, 1, 10, 30, "Data", this);
     w_objectData = new DisplayObjects(w_data.Left, 1, w_data.Height, 80 - w_data.Width + 1, "Object Data", this);
     w_vision     = new DisplayObjects(0, w_data.Bottom, 11, 80, "Vision", this);
     w_prompt     = new DisplayObjects(0, 20, 3, 80, "Prompt", this);
     w_data.text("Current AZ:", 0, 0);
     w_data.text("Current EL:", 0, 1);
     w_data.text("Desired AZ:", 0, 2);
     w_data.text("Desired EL:", 0, 3);
     w_data.text("Moving?", 0, 4);
     w_data.text("GPS: N/A", 0, 5);
     w_data.text("Remote power V:", 0, 6);
     w_objectData.text("Name: ", 0, 0);
     w_objectData.text("Distance: ", 0, 1);
     w_objectData.text("Ra/Dec: ", 0, 2);
     w_objectData.text("Cart.: ", 0, 3);
     w_objectData.text("AZ: ", 0, 4);
     w_objectData.text("EL: ", 0, 5);
     w_objectData.text("LST: ", 35, 0);
     w_objectData.text("HA: ", 35, 1);
     w_vision.text("N", 0, 8);
     w_vision.text("E", 19, 8);
     w_vision.text("S", 39, 8);
     w_vision.text("W", 58, 8);
     w_vision.text("N", 77, 8);
     w_prompt.text("Command >> ", 0, 0);
     SetCursorAddress(new CursorAddress {
         x = 12, y = 21
     });
     logger.log(Logger.Level.INFO, "Drawing screen done");
     inputBuffer.Clear();
     echoTypedEnable = true;
 }
コード例 #11
0
 public void RemovePasswordViewModel(GamePasswordViewModel passwordToRemove)
 {
     DisplayObjects.Remove(passwordToRemove);
 }
コード例 #12
0
 public void AddPasswordViewModel(GamePasswordViewModel passwordToAdd)
 {
     DisplayObjects.Add(passwordToAdd);
     RaiseAddedDisplayObjectEvent(this, passwordToAdd);
 }
コード例 #13
0
 public void RemoveDisplayObjectViewModel(DisplayObjectViewModel textViewModel)
 {
     DisplayObjects.Remove(textViewModel);
 }
コード例 #14
0
 public void AddDisplayObjectViewModel(DisplayObjectViewModel displayObjectViewModel)
 {
     DisplayObjects.Add(displayObjectViewModel);
     RaiseAddedDisplayObjectEvent(this, displayObjectViewModel);
 }