private void StardLifeSearch()
        {
            SuitFiles = new List <string>();
            ProgramsView.Items.Clear();
            try
            {
                for (int i = 0; i < Files.Count; i++)
                {
                    if (Regex.IsMatch(Files[i].Name, Sourcer.ArrayToString(Regex.Replace(CommandBox.Text, "(^|^\\s+)-\\s+", "").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries), ' '), RegexOptions.IgnoreCase))
                    {
                        var some      = new FileToImageIconConverter(Files[i].FullName);
                        var imgSource = some.Icon;

                        var stItem = new StackPanel()
                        {
                            Orientation = Orientation.Horizontal
                        };

                        stItem.Children.Add(new Image()
                        {
                            Source = imgSource,
                            Margin = new Thickness(20, 5, 20, 5),
                            Width  = 20,
                            Height = 20
                        });

                        stItem.Children.Add(new TextBlock()
                        {
                            Text       = Files[i].Name,
                            FontFamily = new FontFamily("Bahnschrift"),
                            Margin     = new Thickness(20, 5, 20, 5)
                        });

                        ProgramsView.Items.Add(stItem);
                        SuitFiles.Add(Files[i].FullName);
                    }
                }
            }
            catch { }
        }
        public MainWindow()
        {
            InitializeComponent();
            userActivity.KeyDown += UserActivity_KeyDown;
            userActivity.KeyUp   += UserActivity_KeyUp;

            TextCorrecter.GetSource();
            using (var reader = new XmlTextReader("LML_Data\\Highlight.xshd"))
                CommandBox.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);

            if (Settings.Default.IsFirstLaunch)
            {
                Settings.Default.IsFirstLaunch = false;
                Sourcer.CommandSourceUpdate();
            }

            IntelWords = IntelReader.GetArray("ShortCuts>Inputs").ToList();
            for (int i = 0; i < IntelWords.Count; i++)
            {
                IntelWords[i] = IntelWords[i].Replace("/", "");

                if (Regex.IsMatch(IntelWords[i], "[|]"))
                {
                    var words = IntelWords[i].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    IntelWords[i] = words[0];

                    for (int j = 1; j < words.Length; j++)
                    {
                        IntelWords.Add(words[j]);
                    }
                }
            }

            Files = FileSearcher.GetFilesFast(@"C:\ProgramData\Microsoft\Windows\Start Menu\Programs", "*.*");

            CommandBox.TextArea.TextEntering += IntellisenseTextEntering;
            CommandBox.TextArea.TextEntered  += IntellisenseTextEntered;
        }
Exemple #3
0
 public void Execute(string[] args) =>
 Sourcer.CommandSourceUpdate();