示例#1
0
        /// <summary>
        /// Removes the current dataset and it's children from the project.
        /// </summary>
        public void Delete()
        {
            if (!CanBeDeleted)
            {
                throw new CannotDeleteDatasetException();
            }

            m_Dataset.Delete();
        }
        /// <summary>
        /// Called when the dataset should be deleted.
        /// </summary>
        /// <param name="projectFacade">The object that contains the methods that allow interaction with the project system.</param>
        /// <param name="datasetFacade">The object that contains the methods that allow interaction with a dataset.</param>
        /// <param name="timer">The function that creates and stores timing intervals.</param>
        private static void OnDeleteDataset(ILinkToProjects projectFacade, DatasetFacade datasetFacade, Func <string, IDisposable> timer)
        {
            // If there is no dataset facade, then we're in
            // designer mode, or something else silly.
            if (datasetFacade == null)
            {
                return;
            }

            using (timer("Deleting dataset"))
            {
                datasetFacade.Delete();
                projectFacade.ActiveProject().History.Mark();
            }
        }