コード例 #1
0
        private void BiSave_OnItemClick(object sender, ItemClickEventArgs e)
        {
            var list = GridControl.ItemsSource as List <CellMapping>;

            if (!list.HasFile())
            {
                var window = new FileNameInputWindow();
                if (window.GetShowDialog())
                {
                    list.SaveAs(Context, window.FileName, out var id, "");
                }
            }
            else
            {
                list.Save(Context);
            }
        }
コード例 #2
0
        //save as
        private void BarItem_OnItemClick(object sender, ItemClickEventArgs e)
        {
            var window = new FileNameInputWindow();

            if (window.GetShowDialog())
            {
                var fileName = window.FileName;
                var list     = GridControl.ItemsSource as List <CellMapping>;
                if (!list.SaveAs(Context, fileName, out var fileId, ""))
                {
                    if (MessageBox.Show("The file has exists!", "File exists", MessageBoxButton.OKCancel) ==
                        MessageBoxResult.OK)
                    {
                        list.SaveWithFileId(Context, fileId);
                    }
                }
            }
        }