public static void SearchItem()
 {
     var searchItem = new ItemFilter
     {
         Key = MainView.View.TKey.Text
     };
     if (SharedRegEx.IsValidRegex(searchItem.Key))
     {
         searchItem.RegEx = new Regex(searchItem.Key, SharedRegEx.DefaultOptions);
     }
     if (!String.IsNullOrWhiteSpace(searchItem.Key))
     {
         PluginViewModel.Instance.Filter = searchItem;
     }
     MainView.View.TKey.Text = "";
 }
        public static List<ItemShow> SearchItemInItemWarehouse(ItemFilter filter)
        {
            LoadWarehouse();
            List<ItemShow> result = new List<ItemShow>();
            Regex regex = new Regex(@"-雇员(?<id>\d+)");
            foreach (KeyValuePair<String, List<ItemFullInfo>> catalog in _warehouse)
            {
                foreach (var item in catalog.Value)
                {

                    if (item.Desc != null && item.Desc.Name != null && filter.RegEx.IsMatch(item.Desc.Name))
                    {
                        if (_locationName.ContainsKey(item.Location.Type))
                        {
                            String lLocation = _locationName[item.Location.Type];
                            Match m = regex.Match(catalog.Key);
                            if (m.Success)
                            {
                                lLocation += m.Groups["id"].Value;

                            }
                            if (item.Info.IsHQ)
                            {
                                item.Desc.Name += "[HQ]";
                            }
                            ItemShow i = new ItemShow() { Key = item.Desc.Name, Character = item.Location.Character, Location = lLocation, Amount = item.Info.Amount };
                            result.Add(i);
                        }

                    }
                }
            }

            return result;
        }