Exemple #1
0
        public bool AddMap(string name, int paragraph, DocFieldDataType type)
        {
            if (!map.ContainsValue(name))
            {
                map.Add(paragraph, name);
                mapTypes.Add(paragraph, type);
                UpdateMapInfo();
                return true;
            }
            else
            {
                if (Overwrite(name))
                {
                    //remove old mapping
                    var removeIndex = map.First(x => x.Value == name).Key;
                    map.Remove(removeIndex);
                    mapTypes.Remove(removeIndex);

                    map.Add(paragraph, name);
                    mapTypes.Add(paragraph, type);
                    UpdateMapInfo();
                    return true;
                }
                return false;
            }
        }
Exemple #2
0
        public bool EditMap(string name, int index, DocFieldDataType type)
        {
            if (map[index] != name && map.ContainsValue(name))
            {
                if (Overwrite(name))
                {
                    var removeIndex = map.First(x => x.Value == name).Key;
                    map.Remove(removeIndex);
                    mapTypes.Remove(removeIndex);

                    map[index] = name;
                    mapTypes[index] = type;
                    UpdateMapInfo();
                    return true;
                }
                return false;
            }
            else
            {
                map[index] = name;
                mapTypes[index] = type;
                UpdateMapInfo();
                return true;
            }
        }
Exemple #3
0
        private void loadType(DocFieldDataType type)
        {
            var buttons = new RadioButton[6] { rbCurrency, rbDate, rbList, rbNum, rbText, rbYesNo };

            for (int i = 0; i < buttons.Length; i++)
            {
                buttons[i].Checked = (buttons[i].Tag.ToString() == type.ToString());
            }
        }
Exemple #4
0
 private void rb_Click(object sender, EventArgs e)
 {
     this.type = (DocFieldDataType)Enum.Parse(typeof(DocFieldDataType), ((RadioButton)sender).Tag.ToString());
 }