public RcpaListViewField(Button btnRemove, Button btnLoad, Button btnSave, Button btnUp, Button btnDown,
                                 ListView lvItems, string key, string description)
        {
            this.description = description;

            this.lvItems = lvItems;

            ListViewEventHandlers handlers = new ListViewEventHandlers(lvItems);

            infoAdaptor = new ItemInfosListViewAdaptor(lvItems);

            if (lvItems.MultiSelect)
            {
                lvItems.KeyDown += new KeyEventHandler(lvItems_KeyDown);
            }

            Childrens.Add(lvItems);

            if (btnRemove != null)
            {
                btnRemove.Text   = "Remove";
                btnRemove.Click += handlers.RemoveEvent;
                Childrens.Add(btnRemove);
            }

            if (btnLoad != null)
            {
                btnLoad.Text   = "Load";
                btnLoad.Click += handlers.LoadEvent;
                Childrens.Add(btnLoad);
            }

            if (btnSave != null)
            {
                btnSave.Text   = "Save";
                btnSave.Click += handlers.SaveEvent;
                Childrens.Add(btnSave);
            }

            if (btnUp != null)
            {
                btnUp.Text   = "Up";
                btnUp.Click += handlers.UpEvent;
                Childrens.Add(btnUp);
            }

            if (btnDown != null)
            {
                btnDown.Text   = "Down";
                btnDown.Click += handlers.DownEvent;
                Childrens.Add(btnDown);
            }

            Adaptor = new OptionFileItemInfosAdaptor(infoAdaptor, key);
        }
Exemplo n.º 2
0
    public RcpaListViewField(Button btnRemove, Button btnLoad, Button btnSave, Button btnUp, Button btnDown,
                             ListView lvItems, string key, string description)
    {
      this.description = description;

      this.lvItems = lvItems;

      ListViewEventHandlers handlers = new ListViewEventHandlers(lvItems);

      infoAdaptor = new ItemInfosListViewAdaptor(lvItems);

      lvItems.KeyDown += new KeyEventHandler(lvItems_KeyDown);

      Childrens.Add(lvItems);

      if (btnRemove != null)
      {
        btnRemove.Text = "Remove";
        btnRemove.Click += handlers.RemoveEvent;
        Childrens.Add(btnRemove);
      }

      if (btnLoad != null)
      {
        btnLoad.Text = "Load";
        btnLoad.Click += handlers.LoadEvent;
        Childrens.Add(btnLoad);
      }

      if (btnSave != null)
      {
        btnSave.Text = "Save";
        btnSave.Click += handlers.SaveEvent;
        Childrens.Add(btnSave);
      }

      if (btnUp != null)
      {
        btnUp.Text = "Up";
        btnUp.Click += handlers.UpEvent;
        Childrens.Add(btnUp);
      }

      if (btnDown != null)
      {
        btnDown.Text = "Down";
        btnDown.Click += handlers.DownEvent;
        Childrens.Add(btnDown);
      }

      Adaptor = new OptionFileItemInfosAdaptor(infoAdaptor, key);
    }