Example #1
0
        public void SaveSheet(string name)
        {
            var currentDisplay = this.CurrentDisplay;

            if (currentDisplay != null)
            {
                var info = currentDisplay.Info;
                if (!string.IsNullOrEmpty(info.Name) && info.Name != name)
                {
                    var dialog = Registry.Factory.Create <IMessageBoxShow>();
                    if (dialog.Show("Question", string.Format($"Do you want to copy sheet {info.Name} as {name}"),
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        info      = SceneManager.SheetStore.CreateSceneInfo();
                        info.Name = name;
                    }
                }
                if (string.IsNullOrEmpty(info.Name))
                {
                    info.Name = name;
                }

                SceneManager.SaveInGraph(currentDisplay.Data, currentDisplay.Layout, info);
                currentDisplay.Info = info;
                FavoriteManager.AddToSheets(currentDisplay.Data.Graph, currentDisplay.DataId);
            }
        }