示例#1
0
        public bool AddNewActionToSection(int action_id, int station_id, string patent, string type)
        {
            int locomotive_id = 0, wagon_id = 0;

            if (type == "locomotive")
            {
                locomotive_id = Locomotive.FindByPatent(patent).locomotive_id;
            }
            else
            {
                wagon_id = Wagon.FindByPatent(patent).wagon_id;
            }

            try
            {
                this.ApplyAction(action_id, locomotive_id, wagon_id, station_id);
                SectionAction action = new SectionAction(action_id, section_index, locomotive_id, wagon_id);
                actions_list.Add(action);
                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(false);
            }
        }
示例#2
0
        public Section(View itemView) : base(itemView)
        {
            _containerLayout    = itemView.FindViewById <LinearLayout>(Resource.Id.sectionContainer);
            _titleLabel         = itemView.FindViewById <SimpleLabel>(Resource.Id.sectionTitle);
            _actionButton       = itemView.FindViewById <Button>(Resource.Id.sectionButton);
            _titleLabel.Gravity = GravityFlags.CenterVertical;

            _actionButton.Click += delegate
            {
                SectionAction?.Invoke();
            };

            UpdateAppearance();
        }
示例#3
0
 public void AddActionsToLastSection()
 {
     foreach (Wagon w in wagon_list)
     {
         SectionAction action = new SectionAction(5, section_index, 0, w.wagon_id);
         actions_list.Add(action);
     }
     foreach (Locomotive l in locomotive_list)
     {
         SectionAction action = new SectionAction(6, section_index, l.locomotive_id, 0);
         actions_list.Add(action);
     }
     all_actions_by_section.Add(actions_list);
 }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="nextOffset">The next offset to process.</param>
 /// <param name="nextAction">The next action to complete.</param>
 public SectionResult(int nextOffset, SectionAction nextAction)
 {
     _nextAction = nextAction;
     _nextOffset = nextOffset;
 }
示例#5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="nextOffset">The next offset to process.</param>
 /// <param name="nextAction">The next action to complete.</param>
 public SectionResult(int nextOffset, SectionAction nextAction)
 {
     _nextAction = nextAction;
     _nextOffset = nextOffset;
 }