예제 #1
0
        /// <summary>
        /// Make a shadow copy of the element at the current state which stays available even the element is gone.
        /// </summary>
        /// <returns>A shadow copy of the current element.</returns>
        public new BasicSaveFileDialogData GetDataCopy()
        {
            var data = new BasicSaveFileDialogData();

            FillData(data);

            data.SearchTextBox = GetSafeData(() =>
            {
                if (SearchTextBox == null)
                {
                    return(null);
                }
                return(SearchTextBox.GetDataCopy());
            });

            data.SearchButton = GetSafeData(() =>
            {
                if (SearchButton == null)
                {
                    return(null);
                }
                return(SearchButton.GetDataCopy());
            });

            data.BreadCrumbBar = GetSafeData(() =>
            {
                if (BreadCrumbBar == null)
                {
                    return(null);
                }
                return(BreadCrumbBar.GetDataCopy());
            });

            data.BreadCrumbTextBox = GetSafeData(() =>
            {
                if (BreadCrumbTextBox == null)
                {
                    return(null);
                }
                return(BreadCrumbTextBox.GetDataCopy());
            });

            data.FolderTree = GetSafeData(() =>
            {
                if (FolderTree == null)
                {
                    return(null);
                }
                return(FolderTree.GetDataCopy());
            });

            data.InputTextBox = GetSafeData(() =>
            {
                if (InputTextBox == null)
                {
                    return(null);
                }
                return(InputTextBox.GetDataCopy());
            });

            data.FilterComboBox = GetSafeData(() =>
            {
                if (FilterComboBox == null)
                {
                    return(null);
                }
                return(FilterComboBox.GetDataCopy());
            });

            data.SaveButton = GetSafeData(() =>
            {
                if (SaveButton == null)
                {
                    return(null);
                }
                return(SaveButton.GetDataCopy());
            });

            data.CancelButton = GetSafeData(() =>
            {
                if (CancelButton == null)
                {
                    return(null);
                }
                return(CancelButton.GetDataCopy());
            });

            data.FilesList = GetSafeData(() =>
            {
                if (FilesList == null)
                {
                    return(null);
                }
                return(FilesList.GetDataCopy());
            });

            data.ToolBar = GetSafeData(() =>
            {
                if (ToolBar == null)
                {
                    return(null);
                }
                return(ToolBar.GetDataCopy());
            });

            data.ChangeViewButton = GetSafeData(() =>
            {
                if (ChangeViewButton == null)
                {
                    return(null);
                }
                return(ChangeViewButton.GetDataCopy());
            });

            data.HelpButton = GetSafeData(() =>
            {
                if (HelpButton == null)
                {
                    return(null);
                }
                return(HelpButton.GetDataCopy());
            });

            return(data);
        }