Пример #1
0
        private void DeleteParameter(int index)
        {
            var window = (IVisjectSurfaceWindow)Values[0];
            var action = new AddRemoveParamAction
            {
                Window = window,
                IsAdd  = false,
                Index  = index,
            };

            window.VisjectSurface.Undo.AddAction(action);
            action.Do();
        }
Пример #2
0
        private void OnAddParameterItemClicked(ItemsListContextMenu.Item item)
        {
            var type   = (ScriptType)item.Tag;
            var window = (IVisjectSurfaceWindow)Values[0];
            var asset  = window?.VisjectAsset;

            if (asset == null || !asset.IsLoaded)
            {
                return;
            }
            var action = new AddRemoveParamAction
            {
                Window = window,
                IsAdd  = true,
                Name   = StringUtils.IncrementNameNumber("New parameter", x => OnParameterRenameValidate(null, x)),
                Type   = type,
                Index  = window.VisjectSurface.Parameters.Count,
            };

            window.VisjectSurface.Undo.AddAction(action);
            action.Do();
        }