Interaction logic for CaptureItem.xaml
Inheritance: System.Windows.Controls.UserControl
Exemplo n.º 1
0
 void CaptureItem_UpdateCollectedLink(Controls.CaptureItem item)
 {
     Page.CollectedItem ci = CollectedItems.ToList().Find(x => x.Id == item.link_COMBO.Text);
     if (ci != null)
     {
         item.link_COMBO.Text = ci.Display;
     }
 }
Exemplo n.º 2
0
        void Event_AddCaptureItemClicked(Controls.Event e)
        {
            CaptureItem ci = new CaptureItem();

            if (e.ParentEvent != null)
            {
                Controls.CaptureItem item = CreateCaptureItem(ci, e.ParentEvent);
                e.ParentEvent.captureItems.Add(ci);
                e.CaptureItems.Add(item);
            }

            SettingChanged?.Invoke(null, null, null);
        }
Exemplo n.º 3
0
        void CaptureItem_RemoveClicked(Controls.CaptureItem item)
        {
            if (item.ParentEvent != null)
            {
                item.ParentEvent.captureItems.Remove(item.ParentCaptureItem);

                Controls.Event e = events.Find(x => x.ParentEvent == item.ParentEvent);
                if (e != null)
                {
                    if (e.CaptureItems.Contains(item))
                    {
                        e.CaptureItems.Remove(item);
                    }
                }
            }

            SettingChanged?.Invoke(null, null, null);
        }
Exemplo n.º 4
0
        Controls.CaptureItem CreateCaptureItem(CaptureItem ci, Event e)
        {
            Controls.CaptureItem result = new Controls.CaptureItem();

            result.ParentPage        = this;
            result.ParentEvent       = e;
            result.ParentCaptureItem = ci;

            result.SettingChanged += CaptureItem_SettingChanged;
            result.RemoveClicked  += CaptureItem_RemoveClicked;

            if (ci.name != null)
            {
                result.CaptureName = String_Functions.UppercaseFirst(ci.name.Replace('_', ' '));
            }

            result.link_COMBO.Text = ci.link;

            return(result);
        }
Exemplo n.º 5
0
        Controls.Event CreateEvent(Event e)
        {
            var result = new Controls.Event();

            result.ParentPage  = this;
            result.ParentEvent = e;

            result.Description = e.description;

            result.SettingChanged        += Event_SettingChanged;
            result.AddValueClicked       += Event_AddValueClicked;
            result.AddCaptureItemClicked += Event_AddCaptureItemClicked;

            foreach (Value v in e.values)
            {
                Controls.Value val = CreateValue(v, e);
                result.Values.Add(val);
            }

            foreach (CaptureItem ci in e.captureItems)
            {
                Controls.CaptureItem cap = CreateCaptureItem(ci, e);
                result.CaptureItems.Add(cap);
            }

            // Default
            var def = new Controls.Default();

            def.ParentResult = e.Default;
            if (e.Default != null)
            {
                def.ValueName = e.Default.value;
            }
            def.SettingChanged += def_SettingChanged;
            result.DefaultValue = def;

            return(result);
        }
Exemplo n.º 6
0
        Controls.CaptureItem CreateCaptureItem(CaptureItem ci, Event e)
        {
            Controls.CaptureItem result = new Controls.CaptureItem();

            result.ParentPage = this;
            result.ParentEvent = e;
            result.ParentCaptureItem = ci;

            result.SettingChanged += CaptureItem_SettingChanged;
            result.RemoveClicked += CaptureItem_RemoveClicked;

            if (ci.name != null)
            {
                result.CaptureName = String_Functions.UppercaseFirst(ci.name.Replace('_', ' '));
            }

            result.link_COMBO.Text = ci.link;

            return result;
        }