Beispiel #1
0
        private void DoTest()
        {
            StackHashScriptFileData currentScriptData = listViewScripts.SelectedItem as StackHashScriptFileData;

            if (currentScriptData != null)
            {
                _clientLogic.AdminTestScript(currentScriptData.Name);
            }
        }
Beispiel #2
0
        private void listViewScripts_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            StackHashScriptFileData currentScriptData = listViewScripts.SelectedItem as StackHashScriptFileData;

            if (currentScriptData != null)
            {
                _reselectScriptName = currentScriptData.Name;
            }

            UpdateState();
        }
Beispiel #3
0
        private void DoStartDelete()
        {
            StackHashScriptFileData currentScriptData = listViewScripts.SelectedItem as StackHashScriptFileData;

            if (currentScriptData != null)
            {
                if ((_clientLogic.CurrentScript == null) ||
                    (string.Compare(currentScriptData.Name, _clientLogic.CurrentScript.Name, StringComparison.OrdinalIgnoreCase) != 0))
                {
                    // need to load the script first
                    _actionOnScriptReady = ActionOnScriptReady.Delete;
                    _clientLogic.AdminGetScript(currentScriptData.Name);
                }
                else
                {
                    DoDelete();
                }
            }
        }
Beispiel #4
0
        private void UpdateState()
        {
            StackHashScriptFileData currentScriptData = listViewScripts.SelectedItem as StackHashScriptFileData;

            if (currentScriptData == null)
            {
                buttonTest.IsEnabled   = false;
                buttonEdit.IsEnabled   = false;
                buttonDelete.IsEnabled = false;

                menuItemTest.IsEnabled   = false;
                menuItemEdit.IsEnabled   = false;
                menuItemDelete.IsEnabled = false;
            }
            else
            {
                buttonTest.IsEnabled = _clientLogic.CurrentCab != null;
                buttonEdit.IsEnabled = true;

                menuItemTest.IsEnabled = _clientLogic.CurrentCab != null;
                menuItemEdit.IsEnabled = true;

                if (currentScriptData.IsReadOnly)
                {
                    buttonEdit.Content     = Properties.Resources.ButtonText_View;
                    buttonDelete.IsEnabled = false;

                    menuItemEdit.Header      = Properties.Resources.MenuText_ViewScript;
                    menuItemDelete.IsEnabled = false;
                }
                else
                {
                    buttonEdit.Content     = Properties.Resources.ButtonText_Edit;
                    buttonDelete.IsEnabled = true;

                    menuItemEdit.Header      = Properties.Resources.MenuText_EditScript;
                    menuItemDelete.IsEnabled = true;
                }
            }
        }