Пример #1
0
 public void Supplier(SampleControl control)
 {
     if (control is ControllerA)
     {
         Console.WriteLine("ControllerVisitor'un eylemi uygulandı !");
         //todo
     }
 }
Пример #2
0
        public SampleControlViewModel(SampleControl mw)
        {
            Persons = new ObservableCollection<Person>();
            cts = new CancellationTokenSource();

            CancelCommand = new DelegateCommand(async (t) =>
            {
                cts.Cancel();
            }, (obj) => !cts.Token.IsCancellationRequested);

            RefreshCommand = new DelegateCommand(async (t) =>
            {
                Persons = new ObservableCollection<Person>();
                cts = new CancellationTokenSource();

                for (int i = 1; i <= 100; i++)
                {
                    if (cts.Token.IsCancellationRequested)
                    {
                        return;
                    }

                    var p = new Person();
                    p.Name = "Person " + i;
                    p.Address = "SomethingStreet " + i * 2;

                    var icon = new BitmapImage();

                    icon.BeginInit();
                    icon.UriSource = new Uri("https://cdn0.iconfinder.com/data/icons/users-android-l-lollipop-icon-pack/24/user-16.png");
                    icon.EndInit();

                    p.Icon = icon;

                    Persons.Add(p);
                   
                    mw.grid.ScrollIntoView(p);

                    await Task.Delay(250);
                }
            }, (obj) => true);

            mw.Loaded += (s, e) =>
            {
                RefreshCommand.Execute(null);
            };
        }
Пример #3
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        SampleControl ctr = new SampleControl();

        this.Form.Controls.Add(ctr);
    }
Пример #4
0
 public DirectChannel(string audioPath, int delay, [NotNull] AudioPlaybackEngine engine, SampleControl control = null) : base(engine)
 {
     _audioPath = audioPath;
     _delay     = delay;
     _control   = control ?? new SampleControl();
 }
 public MyDropDownList()
 {
     mySampleControl = new SampleControl();
 }