Example #1
0
        public SliderForm(SliderNode EntryNode)
        {
            InitializeComponent();

            DictButton = new Dictionary<SlideFormButton, Button>();
            InitializeDictionaryButton();

            foreach (KeyValuePair<SlideFormButton,Button> kv in DictButton)
            {
                kv.Value.Click += ButtonClick;
            }

            CurrentNode = EntryNode;
            LoadCurrentNode();
        }
Example #2
0
        private void TEST_Load(object sender, EventArgs e)
        {

            //creo i nodi
            SliderNode fn = new SliderNode();
            fn.panel = new FirstPanel();

            SliderNode sn = new SliderNode();
            sn.panel = new SecondPanel();


            // assegno il giro dei nodi
            fn.SetNext(SlideFormButton.Right, sn);
            sn.SetNext(SlideFormButton.Left, fn);


            // creo lo slider e gli passo il primo nodo da caricare
            SliderForm sp = new SliderForm(fn);
            sp.ShowDialog();
            Close();
        }
Example #3
0
        private void ButtonClick(object sender, EventArgs e)
        {
            if(!DictButton.ContainsValue(sender as Button))
                return;

            SlideFormButton btn = DictButton.First((x) => x.Value == sender as Button).Key;

            CanGoReturn r = CurrentNode.CanGo(btn);
            if(r==false)
            {
                MessageBox.Show(r.Message);
                return;
            }

            CurrentNode=CurrentNode.GetNext(btn);
            LoadCurrentNode();
        }
Example #4
0
 public void SetNext(SlideFormButton btn, SliderNode panel)
 {
     Nexts.Add(btn, panel);
 }