Ejemplo n.º 1
0
    void DrawButtonsSection()
    {
        GUILayout.BeginArea(_buttonsSection);

        EditorGUILayout.Space();

        if (string.IsNullOrEmpty(_cardData.cardName) || string.IsNullOrEmpty(_cardData.cardDescription))
        {
            EditorGUILayout.HelpBox("Cards needs a [Card name] and [Card description] before it can be created",
                                    MessageType.Warning);
        }
        else if (!_canSave)
        {
            //TODO:: error prevention for saving without action
            EditorGUILayout.HelpBox("All actions needs to be assigned before it can be created", MessageType.Warning);
        }
        else if (GUILayout.Button("Save card", GUILayout.Height(40)))
        {
            SaveCard();
        }

        EditorGUILayout.Space();

        if (GUILayout.Button("Create new action", GUILayout.Height(40)))
        {
            ActionSettings.OpenWindow();
        }

        GUILayout.EndArea();
    }
Ejemplo n.º 2
0
        protected override void RunTool()
        {
            var tool = new AutoRestRunner(FileSystem, Environment, ProcessRunner, Tools, new FakeLog());

            ActionSettings?.Invoke(Settings);
            var directoryPath = tool.Generate(InputFile, Settings);
        }
Ejemplo n.º 3
0
        protected override void RunTool()
        {
            var tool = new NewmanRunner(FileSystem, Environment, ProcessRunner, Tools, new FakeLog());

            ActionSettings?.Invoke(Settings);
            tool.RunTool(InputFile, Settings);
        }
Ejemplo n.º 4
0
 public RepositoryAction(ActionSettings settings)
 {
     _useShellExecute = settings.Shell.GetValueOrDefault(false);
     _nameTemplate    = settings.Name;
     _commandTemplate = GetCommand(settings.Program, settings.Args);
     _searchFilter    = settings.SearchFilter;
 }
Ejemplo n.º 5
0
 private void TrackActions(ActionSettings actionSettings)
 {
     if (actionSettings != null)
     {
         disposableList.Add(
             actionSettings
             .Changed
             .Subscribe(x => SetModified()));
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Environment settings where an action is being used to apply the settings.
        /// </summary>
        /// <typeparam name="TSettings"></typeparam>
        /// <param name="action"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public EnvironmentBuilder With <TSettings>(Action <TSettings> action, TSettings settings)
        {
            var hs = new ActionSettings <TSettings>(action)
            {
                Settings = settings
            };

            _settings[typeof(IEnvironmentBuilderComponent <TSettings>)] = hs;

            return(this);
        }
        private void btnSaveActionSettings_Click(object sender, EventArgs e)
        {
            ActionSettings actionSettings = new ActionSettings();

            actionSettings.DisableStandardSave = chkDisableStandardSaveButton.Checked;
            actionSettings.DisableDefaultdSave = chkDisableDefaultSaveButton.Checked; actionSettings.DisableStandardSave = chkDisableStandardSaveButton.Checked;
            actionSettings.DisableLastSave     = chkDisableLastUsedSaveButton.Checked;

            Option.SaveActionSettings(actionSettings);

            MessageBox.Show(UserInterfaceStrings.ActionSettinsChanged, UserInterfaceStrings.Settings, MessageBoxButtons.OK);
        }
Ejemplo n.º 8
0
        public static void SaveActionSettings(ActionSettings settings)
        {
            if (Optiondb.ActionSettings.Count == 0)
            {
                Optiondb.ActionSettings.AddActionSettingsRow(Optiondb.ActionSettings.NewActionSettingsRow());
            }
            DataSet_Config.ActionSettingsRow row = Optiondb.ActionSettings[0];
            row.DisableStandardSave = settings.DisableStandardSave;
            row.DisableDefaultSave  = settings.DisableDefaultdSave;
            row.DisableLastSave     = settings.DisableLastSave;

            Save();
        }
Ejemplo n.º 9
0
        public NoteSettingsObject()
        {
            Cash       = true;
            Tournament = true;

            FacingUnopened       = true;
            Facing2PlusLimpers   = true;
            FacingRaisersCallers = true;
            Facing1Limper        = true;
            Facing1Raiser        = true;
            Facing2Raisers       = true;

            TypeNoLimit      = true;
            TypePotLimit     = true;
            TypeLimit        = true;
            PlayersNo34      = true;
            PlayersNo56      = true;
            PlayersNoHeadsUp = true;
            PlayersNoMax     = true;
            PlayersNoMinVal  = 2;
            PlayersNoMaxVal  = 10;

            PositionBB     = true;
            PositionButton = true;
            PositionCutoff = true;
            PositionEarly  = true;
            PositionMiddle = true;
            PositionSB     = true;

            ExcludedStakes            = new List <Stake>();
            ExcludedCardsList         = new List <string>();
            SelectedFilters           = new ObservableCollection <FilterObject>();
            SelectedFiltersComparison = new ObservableCollection <FilterObject>();

            FlopHvSettings  = new HandValueSettings();
            TurnHvSettings  = new HandValueSettings();
            RiverHvSettings = new HandValueSettings();

            FlopTextureSettings  = new FlopTextureSettings();
            TurnTextureSettings  = new TurnTextureSettings();
            RiverTextureSettings = new RiverTextureSettings();

            FlopActions    = new ActionSettings();
            TurnActions    = new ActionSettings();
            RiverActions   = new ActionSettings();
            PreflopActions = new ActionSettings();
        }
Ejemplo n.º 10
0
    /// <summary>
    /// Processes the command key.
    /// </summary>
    /// <seealso cref="M:System.Windows.Forms.Form.ProcessCmdKey(Message@,Keys)"/>
    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
        if (Globals.IsReady)
        {
            switch (keyData)
            {
            // Top menu system
            case Keys.Alt | Keys.S:
                ActionSettings.ShowDropDown();
                return(true);

            case Keys.Alt | Keys.I:
                ActionInformation.ShowDropDown();
                return(true);

            case Keys.F9:
                ActionPreferences.PerformClick();
                return(true);

            case Keys.Alt | Keys.Control | Keys.F4:
                ActionExit.PerformClick();
                return(true);

            case Keys.Escape:
                if (!EditESCtoExit.Checked || EditMeanings.IsCurrentCellInEditMode)
                {
                    break;
                }
                ActionExit.PerformClick();
                return(true);

            // Rotate view
            case Keys.Control | Keys.Shift | Keys.Tab:
                if (Globals.AllowClose)
                {
                    SetView(Settings.CurrentView.Previous(ViewMode.Notebook));// TODO notebook remove when ready
                }
                return(true);

            case Keys.Control | Keys.Tab:
                if (Globals.AllowClose)
                {
                    SetView(Settings.CurrentView.Next(ViewMode.Notebook));// TODO notebook remove when ready
                }
                return(true);

            // Change view
            case Keys.F1:
                ActionViewAnalysis.PerformClick();
                return(true);

            case Keys.F2:
                ActionViewLetters.PerformClick();
                return(true);

            case Keys.F3:
                if (!Globals.IsDebugExecutable)
                {
                    break;                         // TODO remove when ready
                }
                ActionViewNotebook.PerformClick();
                return(true);

            // Application functions
            case Keys.F5:
            case Keys.Control | Keys.F:
                ActionSearchTerm.PerformClick();
                return(true);

            case Keys.Control | Keys.N:
                ActionNewInstance.PerformClick();
                return(true);

            // Top menu system
            case Keys.Alt | Keys.T:
                ActionTools.ShowDropDown();
                return(true);

            case Keys.Alt | Keys.L:
                if (ActionWebLinks.Enabled)
                {
                    ActionWebLinks.ShowDropDown();
                }
                return(true);

            // Data edition
            case Keys.Control | Keys.S:
                ActionSave.PerformClick();
                return(true);

            case Keys.Control | Keys.Back:
                ActionUndo.Focus();
                ActionUndo.PerformClick();
                return(true);
            }
        }
        // Letters navigation
        if (Globals.AllowClose && Settings.CurrentView == ViewMode.Letters)
        {
            switch (keyData)
            {
            case Keys.Control | Keys.Home:
                LettersNavigator.ActionFirst.PerformClick();
                return(true);

            case Keys.Control | Keys.End:
                LettersNavigator.ActionLast.PerformClick();
                return(true);

            case Keys.Control | Keys.PageUp:
                LettersNavigator.ActionPrevious.PerformClick();
                return(true);

            case Keys.Control | Keys.PageDown:
                LettersNavigator.ActionNext.PerformClick();
                return(true);
            }
        }
        return(base.ProcessCmdKey(ref msg, keyData));
    }
Ejemplo n.º 11
0
 public static void OpenWindow()
 {
     _window         = (ActionSettings)GetWindow(typeof(ActionSettings));
     _window.minSize = new Vector2(250, 200);
     _window.Show();
 }
        private void ReloadSettings()
        {
            Option.Read();

            DirectorySettings dirSettings = Option.GetDirectorySettings();

            if (dirSettings != null)
            {
                if (!String.IsNullOrWhiteSpace(dirSettings.DefaultFolderTag) && !String.IsNullOrWhiteSpace(dirSettings.DefaultFolder))
                {
                    DefaultFolderName = dirSettings.DefaultFolder;
                    DefaultFolderTag  = dirSettings.DefaultFolderTag;
                }
            }

            LabelSettings labelSettings = Option.GetLabelSettings();

            if (labelSettings != null)
            {
                if (labelSettings.LoginExampleInstanceUrl != null)
                {
                    LabelLoginExampleInstanceUrl = labelSettings.LoginExampleInstanceUrl;
                }
                if (labelSettings.Title != null)
                {
                    LabelTitle = labelSettings.Title;
                }
            }

            ActionSettings actionSettings = Option.GetActionSettings();

            if (actionSettings != null)
            {
                chkDisableStandardSaveButton.Checked = actionSettings.DisableStandardSave;
                chkDisableDefaultSaveButton.Checked  = actionSettings.DisableDefaultdSave;
                chkDisableLastUsedSaveButton.Checked = actionSettings.DisableLastSave;
            }

            ImageSettings imageSettings = Option.GetimageSettings();

            if (imageSettings != null)
            {
                if (!String.IsNullOrWhiteSpace(imageSettings.Logo))
                {
                    System.Drawing.Image img = System.Drawing.Image.FromFile(imageSettings.Logo);
                    if (img.Width > 570 || img.Height > 90)
                    {
                        pictureBoxLogo.SizeMode = PictureBoxSizeMode.StretchImage;
                    }
                    else
                    {
                        pictureBoxLogo.SizeMode = PictureBoxSizeMode.CenterImage;
                    }

                    pictureBoxLogo.ImageLocation = imageSettings.Logo;

                    pictureBoxLogoConfig.ImageLocation = imageSettings.Logo;
                    currentlogo = imageSettings.Logo;
                }
                else
                {
                    pictureBoxLogo.Image    = Properties.Resources.logoalfresco;
                    pictureBoxLogo.SizeMode = PictureBoxSizeMode.CenterImage;

                    pictureBoxLogoConfig.Image = Properties.Resources.logoalfresco;
                    currentlogo = null;
                }

                if (!String.IsNullOrWhiteSpace(imageSettings.HeadImage))
                {
                    pictureBoxImageConfig.ImageLocation = imageSettings.HeadImage;
                    currentImage = imageSettings.HeadImage;
                }
                else
                {
                    pictureBoxImageConfig.Image = Properties.Resources.logoalfrescosmall;
                    currentImage = null;
                }

                if (!String.IsNullOrWhiteSpace(imageSettings.Icon))
                {
                    pictureBoxIconConfig.ImageLocation = imageSettings.Icon;
                    currentIcon = imageSettings.Icon;
                    this.Icon   = new Icon(currentIcon);
                }
                else
                {
                    pictureBoxIconConfig.Image = Properties.Resources.alfresco;
                    currentIcon = null;
                    //this.Icon = new Icon("Resources/alfresco.ico");
                }
            }
        }
        public string Serialise(ActionSettings actionSettings)
        {
            var serialisedActionSettings = _serialiser.Serialise(actionSettings);

            return _encryptor.Encrypt(serialisedActionSettings);
        }
Ejemplo n.º 14
0
        private static List <ObligatoryAction> GetObligatoryActions(ActionSettings actionSettings)
        {
            var list = new List <ObligatoryAction>();

            if (actionSettings.FirstType == ActionTypeEnum.Any && actionSettings.SecondType == ActionTypeEnum.Any &&
                actionSettings.FirstType == ActionTypeEnum.Any && actionSettings.FourthType == ActionTypeEnum.Any)
            {
                return(list);
            }

            var firstAction = new ObligatoryAction
            {
                ActionType = actionSettings.FirstType,
                MaxValue   = actionSettings.FirstMaxValue,
                MinValue   = actionSettings.FirstMinValue
            };

            list.Add(firstAction);

            if (actionSettings.SecondType == ActionTypeEnum.Any && actionSettings.ThirdType == ActionTypeEnum.Any &&
                actionSettings.FourthType == ActionTypeEnum.Any)
            {
                return(list);
            }

            var secondAction = new ObligatoryAction
            {
                ActionType = actionSettings.SecondType,
                MaxValue   = actionSettings.SecondMaxValue,
                MinValue   = actionSettings.SecondMinValue
            };

            list.Add(secondAction);

            if (actionSettings.ThirdType == ActionTypeEnum.Any && actionSettings.FourthType == ActionTypeEnum.Any)
            {
                return(list);
            }

            var thirdAction = new ObligatoryAction
            {
                ActionType = actionSettings.ThirdType,
                MaxValue   = actionSettings.ThirdMaxValue,
                MinValue   = actionSettings.ThirdMinValue
            };

            list.Add(thirdAction);

            if (actionSettings.FourthType == ActionTypeEnum.Any)
            {
                return(list);
            }

            var fourthdAction = new ObligatoryAction
            {
                ActionType = actionSettings.FourthType,
                MaxValue   = actionSettings.FourthMaxValue,
                MinValue   = actionSettings.FourthMinValue
            };

            list.Add(fourthdAction);

            return(list);
        }
        public string Serialise(ActionSettings actionSettings)
        {
            var serialisedActionSettings = _serialiser.Serialise(actionSettings);

            return(_encryptor.Encrypt(serialisedActionSettings));
        }
        private void ReloadSettings()
        {
            Option.Read();

            LabelSettings labelSettings = Option.GetLabelSettings();
            if (labelSettings != null)
            {
                if (labelSettings.Title != null)
                {
                    LabelTitle = labelSettings.Title;
                }
            }

            ActionSettings actionSettings = Option.GetActionSettings();
            if (actionSettings != null)
            {
                btnUploadSelectedFolder.Visible = !actionSettings.DisableStandardSave;
                btnUploadDefaultFolder.Visible = !actionSettings.DisableDefaultdSave;
                btnUploadLastFolder.Visible = !actionSettings.DisableLastSave;
                pnltxtDefaultFolder.Visible = !actionSettings.DisableDefaultdSave;
                pnltxtLastFolder.Visible = !actionSettings.DisableLastSave;
            }

            DirectorySettings dirSettings = Option.GetDirectorySettings();
            if (dirSettings != null)
            {
                DefaultFolderTag = dirSettings.DefaultFolderTag;
                DefaultFolderName = dirSettings.DefaultFolder;

                if (!String.IsNullOrWhiteSpace(DefaultFolderTag))
                {
                    btnUploadDefaultFolder.Enabled = true;

                }
                else
                {
                    btnUploadDefaultFolder.Enabled = false;
                }

                LastUsedFolder = dirSettings.LastUsedFolder;
                LastUsedFolderTag = dirSettings.LastUsedFolderTag;

                if (!String.IsNullOrWhiteSpace(LastUsedFolderTag))
                {
                    btnUploadLastFolder.Enabled = true;

                }
                else
                {
                    btnUploadLastFolder.Enabled = false;
                }
            }


            ImageSettings imageSettings = Option.GetimageSettings();
            if (imageSettings != null)
            {
                if (!String.IsNullOrWhiteSpace(imageSettings.HeadImage))
                {
                    pictureBoxHeadImage.ImageLocation = imageSettings.HeadImage;
                }
                else
                {
                    pictureBoxHeadImage.Image = Properties.Resources.logoalfrescosmall;
                }
                try
                {
                    if (!String.IsNullOrWhiteSpace(imageSettings.Icon))
                    {
                        this.Icon = new Icon(imageSettings.Icon);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString()); //added
                }

            }
        }