Exemplo n.º 1
0
 public override CanGoReturn CanGo(SlideFormButton dir)
 {
     switch (dir)
     {
         case SlideFormButton.Bottom:
             return new CanGoReturn(false, "Non Implementato");
         case SlideFormButton.Top:
             return new CanGoReturn(false, "Non Implementato");
         case SlideFormButton.Right:
             return new CanGoReturn(true);
         case SlideFormButton.Left:
             return new CanGoReturn(true);
     }
     return new CanGoReturn(false, "Non Implementato");
 }
Exemplo n.º 2
0
 public override CanGoReturn CanGo(SlideFormButton dir)
 {
     switch(dir)
     {
         case SlideFormButton.Bottom:
             return new CanGoReturn(false, "Non Implementato");
         case SlideFormButton.Top:
             return new CanGoReturn(false, "Non Implementato");
         case SlideFormButton.Right:
             if (textBox1.Text == "Pippo")
                 return new CanGoReturn(true);
             else
                 return new CanGoReturn(false,"Scrivi \"Pippo\"");
         case SlideFormButton.Left:
             return new CanGoReturn(false, "Non Implementato");
     }
     return new CanGoReturn(false, "Non Implementato");
 }
Exemplo n.º 3
0
        public void LoadCurrentNode()
        {
            if (Panel_Container.Contains(CurrentNode.panel))
                return;

            if (CurrentNode == null || CurrentNode.panel==null)
                return;

            CurrentNode.panel.Location = new Point(Panel_Container.Width, 0);
            CurrentNode.panel.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            CurrentNode.panel.Size = new Size(Panel_Container.Width, Panel_Container.Height);
            Panel_Container.Controls.Add(CurrentNode.panel);

            new Thread(() =>
            {
                SliderPanel p = CurrentNode.panel;
                while (CurrentNode.panel.Location.X > 0)
                {
                    foreach (Control c in Panel_Container.Controls)
                        c.SetLocationInvoke(c.Location.X - 2, c.Location.Y);
                    Thread.Sleep(1);
                }
                CurrentNode.panel.SetLocationInvoke(0, CurrentNode.panel.Location.Y);

                int i = 0, count = Panel_Container.Controls.Count;
                while(count>0)
                {
                    if (Panel_Container.Controls[i] == CurrentNode.panel)
                        i++;
                    else
                        Panel_Container.Controls.RemoveAt(i);

                    count--;
                }

            }).Start();

            Buttons = CurrentNode.GetButtons();
            foreach (KeyValuePair<SlideFormButton, Button> kv in DictButton)
            {
                if (Buttons.HasFlag(kv.Key))
                {
                    kv.Value.Visible = true;
                    kv.Value.Enabled = true;
                }
                else
                {
                    kv.Value.Visible = false;
                    kv.Value.Enabled = false;
                }
            }
        }
Exemplo n.º 4
0
 public void SetNext(SlideFormButton btn, SliderNode panel)
 {
     Nexts.Add(btn, panel);
 }
Exemplo n.º 5
0
 public SliderNode GetNext(SlideFormButton btn)
 {
     if (Nexts.ContainsKey(btn))
         return Nexts[btn];
     return null;
 }
Exemplo n.º 6
0
 public CanGoReturn CanGo(SlideFormButton dir)
 {
     return _panel.CanGo(dir);
 }