public MySwitch(MyKeys key, Func <MyKeys, bool> action, MyRef <bool> field, string note = "")
 {
     m_boolReference = field;
     Key             = key;
     Action          = action;
     Note            = note;
 }
    public static void Main()
    {
        MyRef <string> s = new MyRef <string>();

        s.Value = "failed";
        End e = new End(s);

        Console.WriteLine("After: {0}", s.Value);
    }
Example #3
0
    public void DoIt()
    {
        var v = new MyRef <int> {
            Ref = 1
        }
        saveVar("First", v)

        changeVar("First", 2)
        Console.WriteLine(v.Ref.ToString());     // Should print 2
    }
    public void DoIt()
    {
        var v = new MyRef <int> {
            Ref = 1
        };

        saveVar("First", v);
        changeVar("First", 2);
        Console.WriteLine(v.Ref.ToString());                              // Should print 2
        Console.WriteLine(((MyRef <int>)MyDict["First"]).Ref.ToString()); // should also print 2
    }
        public override async Task ShowAsync()
        {
            if (Target == null)
            {
                throw new NullReferenceException("Target cannot be null");
            }

            _called = true;
            if (OnShow.HasDelegate)
            {
                await OnShow.InvokeAsync(this);
            }
            Shown = true;
            await BlazorStrap.Interop.SetStyleAsync(MyRef, "display", "");

            if (!MyRef.Equals(null))
            {
                await BlazorStrap.Interop.SetStyleAsync(MyRef, "visibility", "hidden");

                await BlazorStrap.Interop.AddClassAsync(MyRef, "show");

                if (!string.IsNullOrEmpty(DropdownOffset))
                {
                    await BlazorStrap.Interop.AddPopoverAsync(MyRef, Placement, Target, DropdownOffset);
                }
                else
                {
                    await BlazorStrap.Interop.AddPopoverAsync(MyRef, Placement, Target);
                }

                if (!IsDropdown)
                {
                    await BlazorStrap.Interop.UpdatePopoverArrowAsync(MyRef, Placement, false);
                }
                await BlazorStrap.Interop.SetStyleAsync(MyRef, "visibility", "");

                Style = await BlazorStrap.Interop.GetStyleAsync(MyRef);

                EventsSet = true;
            }

            await InvokeAsync(StateHasChanged);
        }
        protected void AddSwitch(MyKeys key, Func <MyKeys, bool> action, MyRef <bool> boolRef, string note = "")
        {
            MySwitch newSwitch = new MySwitch(key, action, boolRef, note);

            m_switches.Add(newSwitch);
        }
 public End(MyRef <string> parameter)
 {
     this.parameter = parameter;
     this.Init();
     Console.WriteLine("Inside: {0}", parameter.Value);
 }
 public Consumer(MyRef <Test> t)
 {
     test = t;
 }