Ejemplo n.º 1
0
        DialogResult ShowDeleteDialog(object objectToDelete, out DeleteOptionsWindow optionsWindow)
        {
            string titleText;

            if (objectToDelete is ComponentSave)
            {
                titleText = "Delete Component?";
            }
            else if (objectToDelete is ScreenSave)
            {
                titleText = "Delete Screen?";
            }
            else if (objectToDelete is InstanceSave)
            {
                titleText = "Delete Instance?";
            }
            else
            {
                titleText = "Delete?";
            }

            optionsWindow                = new DeleteOptionsWindow();
            optionsWindow.Text           = titleText;
            optionsWindow.Message        = "Are you sure you want to delete:\n" + objectToDelete.ToString();
            optionsWindow.ObjectToDelete = objectToDelete;

            PluginManager.Self.ShowDeleteDialog(optionsWindow, objectToDelete);

            DialogResult result = optionsWindow.ShowDialog();


            return(result);
        }
Ejemplo n.º 2
0
        bool?ShowDeleteDialog(object objectToDelete, out DeleteOptionsWindow optionsWindow)
        {
            string titleText;

            if (objectToDelete is ComponentSave)
            {
                titleText = "Delete Component?";
            }
            else if (objectToDelete is ScreenSave)
            {
                titleText = "Delete Screen?";
            }
            else if (objectToDelete is InstanceSave)
            {
                titleText = "Delete Instance?";
            }
            else if (objectToDelete is BehaviorSave)
            {
                titleText = "Delete Behavior?";
            }
            else
            {
                titleText = "Delete?";
            }

            optionsWindow                = new DeleteOptionsWindow();
            optionsWindow.Title          = titleText;
            optionsWindow.Message        = "Are you sure you want to delete:\n" + objectToDelete.ToString();
            optionsWindow.ObjectToDelete = objectToDelete;

            GumCommands.Self.GuiCommands.PositionWindowByCursor(optionsWindow);

            PluginManager.Self.ShowDeleteDialog(optionsWindow, objectToDelete);

            var result = optionsWindow.ShowDialog();


            return(result);
        }