Esempio n. 1
0
        private void setMappingButton_Click(object sender, EventArgs e)
        {
            if (_project == null)
            {
                return;
            }
            var box = _project !.Pages[_pageIndex].Boxes[_boxKey];

            var pageRepeat = _project !.Pages[_pageIndex].RepeatMode.DataPath;
            var mapEdit    = new PickDataSource(_project, "Pick source for box", box.MappingPath, pageRepeat, _pageIndex, allowEmpty: false);

            mapEdit.ShowDialog();

            if (mapEdit.SelectedPath != null && mapEdit.SelectedPath.Length > 0)
            {
                box.MappingPath      = mapEdit.SelectedPath;
                dataPathLabel !.Text = string.Join(".", box.MappingPath);

                if (IsUsingDefaultName(boxKeyTextbox?.Text)) // auto-name the box based on the data path
                {
                    boxKeyTextbox !.Text = AutoNameBox(box) ?? boxKeyTextbox !.Text;
                }

                _project.Save();
            }
        }
Esempio n. 2
0
        private void pickDataButton_Click(object sender, EventArgs e)
        {
            if (_project == null)
            {
                return;
            }

            var rm = new PickDataSource(_project, "Pick repeat source", _project.Pages[_pageIndex].RepeatMode.DataPath, null, null, allowEmpty: false);

            rm.ShowDialog();
            if (rm.SelectedPath == null)
            {
                return;
            }

            _selectedPath        = rm.SelectedPath;
            dataPathLabel !.Text = string.Join(".", rm.SelectedPath);
        }