コード例 #1
0
 public SequenceViewModel(SequenceDescription desc)
 {
     Result      = desc.Result;
     Description = desc.Description;
     Sequence    = desc.Sequence;
     Utf32       = desc.Utf32;
 }
コード例 #2
0
 public SequenceViewModel(CategoryViewModel category, SequenceDescription desc)
 {
     Category = category;
     Category.IsEmpty = false;
     Result = desc.Result;
     Description = desc.Description;
     Sequence = desc.Sequence;
     Utf32 = desc.Utf32;
 }
コード例 #3
0
        private void InsertSequence(KeySequence path, SequenceDescription item)
        {
            if (path.Count == 0)
            {
                m_results.Add(item);
                return;
            }

            if (!m_children.TryGetValue(path[0], out var child))
            {
                m_children.Add(path[0], child = new SequenceNode());
            }

            child.InsertSequence(path.GetRange(1, path.Count - 1), item);
        }
コード例 #4
0
ファイル: SequenceTree.cs プロジェクト: NeilBryant/wincompose
        /// <summary>
        /// Build a list of sequence descriptions by recursively adding our
        /// children to <see cref="list"/>. The output structure is suitable
        /// for the GUI.
        /// </summary>
        private void BuildSequenceDescriptions(List <SequenceDescription> list,
                                               KeySequence path)
        {
            if (m_result != null)
            {
                var item = new SequenceDescription();
                item.Sequence    = path;
                item.Result      = m_result;
                item.Description = m_description;
                item.Utf32       = m_utf32;
                list.Add(item);
            }

            foreach (var pair in m_children)
            {
                var newpath = new KeySequence(path);
                newpath.Add(pair.Key);
                pair.Value.BuildSequenceDescriptions(list, newpath);
            }
        }
コード例 #5
0
        private void InsertSequence(KeySequence path, SequenceDescription item)
        {
            if (path.Count == 0)
            {
                // If this is a conflict, warn about it
                if (m_results.Count > 0 && m_results[0].Result != item.Result)
                {
                    Logger.Warn($"Conflicting sequence for {item.Sequence.FriendlyName}: had {m_results[0].Result}, got {item.Result}");
                }

                // Insert sequence at index 0 to give precedence to user sequences
                m_results.Insert(0, item);
                return;
            }

            if (!m_children.TryGetValue(path[0], out var child))
            {
                m_children.Add(path[0], child = new SequenceNode());
            }

            child.InsertSequence(path.GetRange(1, path.Count - 1), item);
        }
コード例 #6
0
 public SequenceViewModel(SequenceDescription desc) => m_desc = desc;