public RcpaListViewMultipleDirectoryField(Button btnAdd, Button btnRemove, Button btnLoad, Button btnSave,
                                              ListView lstDirectories, string key, string description, bool required,
                                              bool validateSelectedItemOnly)
      : base(btnRemove, btnLoad, btnSave, lstDirectories, key, description)
    {
      btnAdd.Text = "Add";
      btnAdd.Click += AddClick;

      this.Validator = new ItemInfosValidator(new ItemInfosListViewAdaptor(lvItems), validateSelectedItemOnly, required, (m => Directory.Exists(m)), description, "Directory not exists : {0}");
    }
Exemplo n.º 2
0
        public RcpaListViewMultipleDirectoryField(Button btnAdd, Button btnRemove, Button btnLoad, Button btnSave,
                                                  ListView lstDirectories, string key, string description, bool required,
                                                  bool validateSelectedItemOnly)
            : base(btnRemove, btnLoad, btnSave, lstDirectories, key, description)
        {
            btnAdd.Text   = "Add";
            btnAdd.Click += AddClick;

            this.Validator = new ItemInfosValidator(new ItemInfosListViewAdaptor(lvItems), validateSelectedItemOnly, required, (m => Directory.Exists(m)), description, "Directory not exists : {0}");
        }
    public RcpaListBoxMultipleFileField(Button btnAddFiles, Button btnRemoveFiles, Button btnClear, Button btnLoad, Button btnSave,
                                 ListBox lstFiles, String key, OpenFileArgument fileArgument, bool required,
                                 bool validateSelectedItemOnly)
    {
      Childrens.Add(lstFiles);

      listBoxAdaptor = new ItemInfosListBoxAdaptor(lstFiles);

      validator = new ItemInfosValidator(listBoxAdaptor, validateSelectedItemOnly, required, (m => File.Exists(m)), fileArgument.GetFileDescription(), "File not exists : {0}");

      this.fileArgument = fileArgument;

      this.lstFiles = lstFiles;

      ListBoxFileEventHandlers handlers = new ListBoxFileEventHandlers(lstFiles, fileArgument);

      if (btnAddFiles != null)
      {
        btnAddFiles.Text = "Add";
        btnAddFiles.Click += handlers.AddEvent;
        Childrens.Add(btnAddFiles);
      }

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

      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);
      }

      Adaptor = new OptionFileItemInfosAdaptor(listBoxAdaptor, key);
    }
        public RcpaListBoxMultipleFileField(Button btnAddFiles, Button btnRemoveFiles, Button btnClear, Button btnLoad, Button btnSave,
                                            ListBox lstFiles, String key, OpenFileArgument fileArgument, bool required,
                                            bool validateSelectedItemOnly)
        {
            Childrens.Add(lstFiles);

            listBoxAdaptor = new ItemInfosListBoxAdaptor(lstFiles);

            validator = new ItemInfosValidator(listBoxAdaptor, validateSelectedItemOnly, required, (m => File.Exists(m)), fileArgument.GetFileDescription(), "File not exists : {0}");

            this.fileArgument = fileArgument;

            this.lstFiles = lstFiles;

            ListBoxFileEventHandlers handlers = new ListBoxFileEventHandlers(lstFiles, fileArgument);

            if (btnAddFiles != null)
            {
                btnAddFiles.Text   = "Add";
                btnAddFiles.Click += handlers.AddEvent;
                Childrens.Add(btnAddFiles);
            }

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

            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);
            }

            Adaptor = new OptionFileItemInfosAdaptor(listBoxAdaptor, key);
        }