Пример #1
0
        private void ClearKeyBindings()
        {
            foreach (var keyBinding in KeyBindings)
            {
                keyBinding.Edited -= OnEdited;
            }

            KeyBindings.Clear();
        }
Пример #2
0
    private void KeyBindCopy(KeyBindings from, KeyBindings to)
    {
        to.Clear();

        foreach (string key in from.Keys)
        {
            to.Add(key, from[key]);
        }
    }
Пример #3
0
        private void InitializeViewModelProperties(ShellProfile shellProfile)
        {
            SelectedTerminalTheme = TerminalThemes.FirstOrDefault(t => t.Id == shellProfile.TerminalThemeId);
            Id               = shellProfile.Id;
            Name             = shellProfile.Name;
            Arguments        = shellProfile.Arguments;
            Location         = shellProfile.Location;
            WorkingDirectory = shellProfile.WorkingDirectory;
            SelectedTabTheme = TabThemes.FirstOrDefault(t => t.Id == shellProfile.TabThemeId);
            PreInstalled     = shellProfile.PreInstalled;

            KeyBindings.Clear();
            foreach (var keyBinding in shellProfile.KeyBindings.Select(x => new KeyBinding(x)).ToList())
            {
                KeyBindings.Add(keyBinding);
            }
        }
    void OnValidate()
    {
        if (filename == "")
        {
            filename = "default.json";
        }

        if (Save)
        {
            SaveData(filename);
            Save = false;
        }
        if (Load)
        {
            string filePath = Path.Combine(Application.streamingAssetsPath, filename);

            if (File.Exists(filePath))
            {
                LoadData(filename);
            }
            Load = false;
        }
        if (New_File)
        {
            Keyboard.Clear();
            Mouse.Clear();
            J1Axis.Clear();
            J1Buttons.Clear();
            J2Axis.Clear();
            J2Buttons.Clear();
            J3Axis.Clear();
            J3Buttons.Clear();
            J4Axis.Clear();
            J4Buttons.Clear();

            New_File = false;
        }
    }
Пример #5
0
 /// <summary>
 /// Kills the hotkeys.
 /// </summary>
 protected virtual void KillHotkeys()
 {
     KeyBindings.Clear();
 }