/// <summary>
        /// Updates the list of auto complete entries.
        /// </summary>
        public void RefreshAutoCompleteEntries()
        {
            Items.Clear();

            var directions = App.Settings.ProfileSettings.DirectionList.Select(x => x.Name).Distinct();
            var aliases    = App.Settings.ProfileSettings.AliasList.Select(x => x.AliasExpression).Distinct();

            foreach (var item in directions)
            {
                var cmd = new AutoCompleteCommand {
                    Command = $"#go {item}"
                };
                Items.Add(cmd);
            }

            foreach (var item in aliases)
            {
                var cmd = new AutoCompleteCommand {
                    Command = $"#a {item}"
                };
                Items.Add(cmd);
            }

            // Add the available hash commands into the auto complete box.
            foreach (var hashCmd in App.MainWindow.Interp.HashCommands)
            {
                var cmd = new AutoCompleteCommand {
                    Command = hashCmd.Name
                };
                Items.Add(cmd);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Updates the list of auto complete entries.
        /// </summary>
        public void RefreshAutoCompleteEntries()
        {
            Items.Clear();

            var directions = App.Settings.ProfileSettings.DirectionList.Select(x => x.Name).Distinct();
            var aliases    = App.Settings.ProfileSettings.AliasList.Select(x => x.AliasExpression).Distinct();

            // TODO - Directions based soley off of the room your in
            //string room = Utilities.GetVariable("Room");
            //var directions = AppSettings.DirectionList.Where(x => x.StartingRoom == room).Select(x => x.Name).Distinct();

            foreach (var item in directions)
            {
                var cmd = new AutoCompleteCommand();
                cmd.Command = $"#go {item}";
                Items.Add(cmd);
            }

            foreach (var item in aliases)
            {
                var cmd = new AutoCompleteCommand();
                cmd.Command = $"#a {item}";
                Items.Add(cmd);
            }
        }