Ejemplo n.º 1
0
        internal static void SaveFilters(SearchFilter filter, string prefKey)
        {
            var filterStr = Serialize(filter);

            EditorPrefs.SetString(prefKey, filterStr);
        }
Ejemplo n.º 2
0
        public static void SendSearchEvent(SearchEvent evt, SearchContext searchContext, SearchFilter searchFilter)
        {
            evt.useOverrideFilter = searchContext.filterId != null;
            evt.isDeveloperMode   = Utils.IsDeveloperMode();
            evt.preferences       = new PreferenceData()
            {
                closeWindowByDefault = true,
                useDockableWindow    = false,
                trackSelection       = SearchSettings.trackSelection
            };

            var providers = searchContext.providers;

            evt.providerDatas = providers.Select(provider => new ProviderData()
            {
                id        = provider.name.id,
                avgTime   = (long)provider.avgTime,
                isEnabled = evt.useOverrideFilter ? true : searchFilter.IsEnabled(provider.name.id),
                custom    = ""
            }).ToArray();

            Send(EventName.quickSearch, evt);
        }
Ejemplo n.º 3
0
        internal static bool LoadFilters(SearchFilter filter, string prefKey)
        {
            var filtersStr = EditorPrefs.GetString(prefKey, null);

            return(Deserialize(filter, filtersStr));
        }