コード例 #1
0
        /// <summary>
        /// The user has selected an extractable thing in the catalogue and opted to include it in the extraction
        /// So we have to convert it to an <see cref="ExtractableColumn"/> (which has configuration specific stuff - and lets
        /// data analyst override stuff for this extraction only)
        ///
        /// <para>Then add it to the right hand list</para>
        /// </summary>
        /// <param name="columns"></param>
        private void Include(params IColumn[] columns)
        {
            olvSelected.BeginUpdate();
            try
            {
                //for each column we are adding
                foreach (IColumn c in columns)
                {
                    //make sure it is up to date with database

                    IRevertable r = c as IRevertable;

                    //if the column is out of date
                    if (r != null && r.HasLocalChanges().Evaluation == ChangeDescription.DatabaseCopyDifferent)
                    {
                        r.RevertToDatabaseState();//get a fresh copy
                    }
                    //add to the config
                    ExtractableColumn addMe = _config.AddColumnToExtraction(_dataSet, c);

                    //update on the UI
                    olvSelected.AddObject(addMe);
                }
            }
            finally
            {
                olvSelected.EndUpdate();
            }

            RefreshDisabledObjectStatus();
            SortSelectedByOrder();

            Publish(_config);
        }
コード例 #2
0
        /// <summary>
        /// Shows a yes no to saving and describes differences in an IMapsDirectlyToDatabaseTable object which suports IRevertable
        /// </summary>
        /// <param name="revertable"></param>
        public static DialogResult?ShowIfRequired(IRevertable revertable)
        {
            if (revertable == null)
            {
                return(null);
            }

            var differences = revertable.HasLocalChanges();

            if (differences.Evaluation == ChangeDescription.DatabaseCopyDifferent)
            {
                return(new OfferChanceToSaveDialogUI(revertable, differences).ShowDialog());
            }

            return(null);
        }
コード例 #3
0
        /// <summary>
        /// The user has selected an extractable thing in the catalogue and opted to include it in the extraction
        /// So we have to convert it to an ExtractableColumn (which has configuration specific stuff - and lets
        /// data analyst override stuff for this extraction only)
        ///
        /// <para>Then add it to the right hand list</para>
        /// </summary>
        /// <param name="item"></param>
        private ExtractableColumn AddColumnToExtraction(IColumn item)
        {
            IRevertable r = item as IRevertable;

            //if the column is out of date
            if (r != null && r.HasLocalChanges().Evaluation == ChangeDescription.DatabaseCopyDifferent)
            {
                r.RevertToDatabaseState();//get a fresh copy
            }
            ExtractableColumn addMe = _config.AddColumnToExtraction(_dataSet, item);

            olvSelected.AddObject(addMe);

            RefreshDisabledObjectStatus();
            SortSelectedByOrder();

            return(addMe);
        }