Exemplo n.º 1
0
        private void btnSelectBehaviours_MouseUp(object sender, MouseButtonEventArgs e)
        {
            PickBehaviours pickBehavioursWindow = new PickBehaviours(Studio.GetBehaviourConfiguration().Behaviours, Page.Behaviours);

            pickBehavioursWindow.ShowDialog();
            Page.Behaviours   = pickBehavioursWindow.SelectedBehaviours;
            Page.BehaviourIds = BehaviourUtils.GetBehaviourIds(Page.Behaviours);
        }
Exemplo n.º 2
0
 public void ViewAttached()
 {
     foreach (List <Action> pack in Studio.GetBehaviourConfiguration().InternalWebActionPacks.Select(wp => wp.GetActions()))
     {
         availableWebActions.AddRange(pack);
     }
     behaviours = new ObservableCollection <Behaviour>(Studio.GetBehaviourConfiguration().Behaviours);
     lsbBehaviours.ItemsSource = behaviours;
 }
Exemplo n.º 3
0
        private void BtnNew_Click(object sender, RoutedEventArgs e)
        {
            AddBehaviour addBehaviourDialog = new AddBehaviour(availableWebActions, behaviours.ToList());

            addBehaviourDialog.ShowDialog();
            if (addBehaviourDialog.WebBehaviour != null)
            {
                behaviours.Add(addBehaviourDialog.WebBehaviour);
                Studio.GetBehaviourConfiguration().Behaviours.Add(addBehaviourDialog.WebBehaviour);
            }
        }
Exemplo n.º 4
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            AddBehaviour editBehaviourDialog = new AddBehaviour(availableWebActions, behaviours.ToList(), true);

            editBehaviourDialog.WebBehaviour = (Behaviour)lsbBehaviours.SelectedItem;
            editBehaviourDialog.ShowDialog();
            if (editBehaviourDialog.WebBehaviour != null)
            {
                behaviours[behaviours.IndexOf((Behaviour)lsbBehaviours.SelectedItem)] = editBehaviourDialog.WebBehaviour;
                if (lsbBehaviours.SelectedItem != null)
                {
                    Studio.GetBehaviourConfiguration().Behaviours[behaviours.IndexOf((Behaviour)lsbBehaviours.SelectedItem)] = editBehaviourDialog.WebBehaviour;
                }
            }
        }
Exemplo n.º 5
0
        private void BtnRemove_Click(object sender, RoutedEventArgs e)
        {
            Behaviour webbehaviour = (Behaviour)lsbBehaviours.SelectedItem;

            if (ValidateWebBehaviourRemoval(webbehaviour))
            {
                if (ConfirmAlert.Show($"Web behaviour '{webbehaviour.Name}' will be removed.").DialogResult.Value)
                {
                    behaviours.Remove((Behaviour)lsbBehaviours.SelectedItem);
                    Studio.GetBehaviourConfiguration().Behaviours.Remove((Behaviour)lsbBehaviours.SelectedItem);
                }
            }
            else
            {
                WarningAlert.Show("This web behaviour cannot be removed because it's used in the project.");
            }
        }