Пример #1
0
        private void DisplayRule(IDataRule aRule, bool edit)
        {
            switch (aRule.RuleType)
            {
            default:
                FieldSettings setAField = new FieldSettings(aRule);
                setAField.ViewOnly = edit;
                if (setAField.ShowDialog() == DialogResult.OK)
                {
                    //source.Tag = FieldSettings.Result;
                }
                break;

            //case FieldTypes.MappedSource:
            //   break;

            case FieldTypes.Collection:
                CollectionDialog collections = new CollectionDialog(aRule);
                collections.ViewOnly = edit;
                if (collections.ShowDialog() == DialogResult.OK)
                {
                    //source.Tag = CollectionDialog.Result;
                }
                break;

            case FieldTypes.Imported:
            case FieldTypes.MultiColumn:
                DataFileDialog dataFile = new DataFileDialog(aRule);
                dataFile.ViewOnly = edit;
                if (dataFile.ShowDialog() == DialogResult.OK)
                {
                    //source.Tag = DataFileDialog.Result;
                }
                break;

            case FieldTypes.Tuple:
                TupleDialog tuple = new TupleDialog(aRule);
                tuple.ViewOnly = edit;
                if (tuple.ShowDialog() == DialogResult.OK)
                {
                    //source.Tag = TupleDialog.Result;
                }
                break;
            }
        }
        private void AddRule(FieldTypes aField)
        {
            switch (aField)
            {
            default:
                FieldSettings setAField = new FieldSettings(aField);

                if (setAField.ShowDialog() == DialogResult.OK)
                {
                    AddRule(FieldSettings.Result);
                }
                break;

            //case FieldTypes.MappedSource:
            //   break;

            case FieldTypes.Collection:
                CollectionDialog collections = new CollectionDialog();

                if (collections.ShowDialog() == DialogResult.OK)
                {
                    AddRule(CollectionDialog.Result);
                }
                break;

            case FieldTypes.Imported:
            case FieldTypes.MultiColumn:
                DataFileDialog dataFile = new DataFileDialog();
                if (dataFile.ShowDialog() == DialogResult.OK)
                {
                    AddRule(DataFileDialog.Result);
                }
                break;

            case FieldTypes.Tuple:
                TupleDialog tuple = new TupleDialog();
                if (tuple.ShowDialog() == DialogResult.OK)
                {
                    AddRule(TupleDialog.Result);
                }
                break;
            }
        }