// **************************************************************************** // Artist/Johnny // **************************************************************************** public virtual ActionResult Artist(string name) { SearchField fld = new SearchField() { P = 2, T = SearchTypes.Contains, V = new string[] { name } }; IList<SearchField> f = new List<SearchField>() { fld }; return Results(f, null, null, null); }
public virtual ActionResult Catalog(string name) { SearchField fld = new SearchField() { P = 16, T = SearchTypes.Contains, V = new string[] { name } }; IList<SearchField> f = new List<SearchField>(); f.Add(fld); return RedirectToAction("Results", new { f = f, p = 0, s = 0, o = 0 }); }
static SearchClauseControl() { SearchField field; m_fields = new List<SearchField>(); // item name m_fields.Add(new SearchField("Name", "t.typeName", SearchField.SearchFieldType.String)); // group name m_fields.Add(new SearchField("Group", "g.groupName", SearchField.SearchFieldType.String)); // category name field = new SearchField("Category", "cat.categoryName", SearchField.SearchFieldType.Enum); field.DataSource = GetFieldOptions("SELECT categoryName AS name FROM invCategories WHERE published = 1 ORDER BY categoryName"); m_fields.Add(field); // flag m_fields.Add(new SearchField("Flag", "f.flagName", SearchField.SearchFieldType.String)); // container m_fields.Add(new SearchField("Container", "ct.typeName", SearchField.SearchFieldType.String)); // container ID m_fields.Add(new SearchField("Container ID", "a.containerID", SearchField.SearchFieldType.Number)); // location m_fields.Add(new SearchField("Location", "locationName", SearchField.SearchFieldType.String)); // owner m_fields.Add(new SearchField("Owner", "a.characterName", SearchField.SearchFieldType.String)); // id m_fields.Add(new SearchField("ID", "a.itemID", SearchField.SearchFieldType.Number)); // quantity m_fields.Add(new SearchField("Count", "a.quantity", SearchField.SearchFieldType.Number)); // volume (the CAST seems to be necessary to get the correct kind of comparison) m_fields.Add(new SearchField("Volume", "CAST(totalVolume AS NUMERIC)", SearchField.SearchFieldType.Number)); // baseprice m_fields.Add(new SearchField("Base Price", "t.basePrice", SearchField.SearchFieldType.Number)); // meta level m_fields.Add(new SearchField("Meta Level", "metaLevel", SearchField.SearchFieldType.Number)); }
public OkEventArgs(SearchField field, bool createNewFilter) { this.SearchField = field; this.CreateNewFilter = createNewFilter; }
public virtual void AddFieldTypes(XmlNode configNode) { Assert.ArgumentNotNull(configNode, "configNode"); var fieldName = XmlUtil.GetAttribute("name", configNode); var storageType = XmlUtil.GetAttribute("storageType", configNode); var indexType = XmlUtil.GetAttribute("indexType", configNode); var vectorType = XmlUtil.GetAttribute("vectorType", configNode); var boost = XmlUtil.GetAttribute("boost", configNode); var exclude = XmlUtil.GetAttribute("exclude", configNode); var searchField = new SearchField(storageType, indexType, vectorType, boost, exclude); FieldTypes.Add(fieldName.ToLowerInvariant(), searchField); if (searchField.Exclude) { _hasFieldTypeExcludes = true; } }
private void AddYearToDate(SearchField searchfield) { this.SetPending(searchfield); this.AddYearToDate(); }
private void AddOnDate(SearchField searchfield, DateTime date) { this.SetPending(searchfield); this.AddOnDate(date); }
public static void InitTreeViewOf(ref AtfStorageTreeView view, ref SearchField field, ref TreeViewState state, TreePurpose purpose, IAtfRecorder recorder, IAtfActionStorage storage) { InitSpecificTreeViewOf(ref view, ref field, ref state, purpose, (s, p) => new AtfStorageTreeView(p, s, recorder, storage)); }
public SearchFieldItem(SearchField searchField, List <SearchField> subSearchFields) { SearchFieldName = searchField.GetLocalized(); SearchFieldSubValues = subSearchFields?.Select((sf) => sf.GetLocalized()).ToList(); }
void InitIfNeeded() { if (m_Initialized) { return; } var cpuHierarchyColumns = new[] { HierarchyFrameDataView.columnName, HierarchyFrameDataView.columnTotalPercent, HierarchyFrameDataView.columnSelfPercent, HierarchyFrameDataView.columnCalls, HierarchyFrameDataView.columnGcMemory, HierarchyFrameDataView.columnTotalTime, HierarchyFrameDataView.columnSelfTime, HierarchyFrameDataView.columnWarningCount }; var gpuHierarchyColumns = new[] { HierarchyFrameDataView.columnName, HierarchyFrameDataView.columnTotalGpuPercent, HierarchyFrameDataView.columnDrawCalls, HierarchyFrameDataView.columnTotalGpuTime }; var profilerColumns = gpuView ? gpuHierarchyColumns : cpuHierarchyColumns; var defaultSortColumn = gpuView ? HierarchyFrameDataView.columnTotalGpuTime : HierarchyFrameDataView.columnTotalTime; var columns = CreateColumns(profilerColumns); var multiColumnHeaderStateData = SessionState.GetString(multiColumnHeaderStatePrefKey, ""); if (!string.IsNullOrEmpty(multiColumnHeaderStateData)) { try { var restoredHeaderState = JsonUtility.FromJson <MultiColumnHeaderState>(multiColumnHeaderStateData); if (restoredHeaderState != null) { m_MultiColumnHeaderState = restoredHeaderState; } } catch {} // Nevermind, we'll just fall back to the default } var headerState = CreateDefaultMultiColumnHeaderState(columns, defaultSortColumn); if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState)) { MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState); } var firstInit = m_MultiColumnHeaderState == null; m_MultiColumnHeaderState = headerState; var multiColumnHeader = new ProfilerFrameDataMultiColumnHeader(m_MultiColumnHeaderState, columns) { height = 25 }; if (firstInit) { multiColumnHeader.ResizeToFit(); } multiColumnHeader.visibleColumnsChanged += OnMultiColumnHeaderChanged; multiColumnHeader.sortingChanged += OnMultiColumnHeaderChanged; // Check if it already exists (deserialized from window layout file or scriptable object) if (m_TreeViewState == null) { m_TreeViewState = new TreeViewState(); } m_TreeView = new ProfilerFrameDataTreeView(m_TreeViewState, multiColumnHeader, cpuModule); m_TreeView.selectionChanged += OnMainTreeViewSelectionChanged; m_TreeView.searchChanged += OnMainTreeViewSearchChanged; m_TreeView.Reload(); m_SearchField = new SearchField(); m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem; if (m_DetailedObjectsView == null) { m_DetailedObjectsView = new ProfilerDetailedObjectsView(detailedObjectsViewPrefKeyPrefix); } m_DetailedObjectsView.gpuView = gpuView; m_DetailedObjectsView.frameItemEvent += FrameItem; if (m_DetailedCallsView == null) { m_DetailedCallsView = new ProfilerDetailedCallsView(detailedCallsViewPrefKeyPrefix); m_DetailedCallsView.profilerSampleNameProvider = cpuModule; } m_DetailedCallsView.frameItemEvent += FrameItem; if (m_DetailedViewSpliterState == null || m_DetailedViewSpliterState.relativeSizes == null || m_DetailedViewSpliterState.relativeSizes.Length == 0) { m_DetailedViewSpliterState = new SplitterState(new[] { SessionState.GetFloat(splitter0StatePrefKey, 70f), SessionState.GetFloat(splitter1StatePrefKey, 30f) }, new[] { 450, 50 }, null); } if (!m_Serialized) { m_DetailedViewType = (DetailedViewType)SessionState.GetInt(detailedViewTypeStatePrefKey, (int)DetailedViewType.None); } m_Serialized = true; m_Initialized = true; }
public int RequestSymbols(SearchField searchField, string searchText, FilterType filterType, string[] filterValue) { _lastRequestNumber++; var reqNo = LookupType.REQ_SYM_SYM.ToString() + _lastRequestNumber.ToString("0000000"); var reqString = string.Format("SBF,{0},{1},{2},{3},{4}\r\n", (searchField == SearchField.Symbol) ? "s" : "d", searchText, (filterType == FilterType.Market) ? "e" : "t", String.Join(" ", filterValue), reqNo); Send(reqString); OnLookupEvent(new LookupEventArgs(reqNo, LookupType.REQ_SYM_SYM, LookupSequence.MessageStart)); return _lastRequestNumber; }
public void AddToSearchField(SearchField searchField) { base.AddObject("SearchField", searchField); }
public static SearchField CreateSearchField(int searchFieldId, int searchTypeId, string description) { SearchField searchField = new SearchField(); searchField.SearchFieldId = searchFieldId; searchField.SearchTypeId = searchTypeId; searchField.Description = description; return searchField; }
/// <summary> /// Ocorre ao alterar o caixa /// </summary> /// <param name="sender">Objeto que disparou o evento</param> /// <param name="args">Argumento do evento gerado</param> private void sfVlrNumeroCaixa_OnSelectedValueChanged(object sender, SearchField.SelectedItemArgs args) { Usuario = PessoaBase.Create(sfUsuario.SelectedItem.GUID) as IUsuario; Inicialize(); PopulateLanc(); }
/// <summary> /// Ocorre ao alterar o operador /// </summary> /// <param name="sender">Objeto que disparou o evento</param> /// <param name="args">Argumento do evento gerado</param> private void sfUsuario_OnSelectedValueChanged(object sender, SearchField.SelectedItemArgs args) { IDisplayValues display = new DisplayValues(); display.Columns.Add(new Parameter { ParameterName = "GUID" }); display.Columns.Add(new Parameter { ParameterName = "Código do Caixa" }); display.Columns.Add(new Parameter { ParameterName = "Nome do Caixa" }); IList<IContaCorrenteCaixa> values = new LancamentoCaixa().Find( new Usuario() { GUID = args.GUID }, Enuns.FrenteCaixa.Lancamento.StatusLancamento.Aberto); display.Values = (from l in values group l by l.Caixa into g let x = g.Key select new object[] { x.GUID, x.EGUID, x.Descricao }).ToArray(); sfVlrNumeroCaixa.DataSource = display; }
/// <summary> /// 获得searchField的值 /// </summary> /// <param name="contract"></param> /// <param name="searchField"></param> /// <returns></returns> public static string GetSearchFieldValue(Contract contract, SearchField searchField) { if (searchField == null) { return(string.Empty); } #region TextField if (searchField.FieldParaBase.Id == Remark.Id) { return (new ContractStringValue(contract).Remark); } if (searchField.FieldParaBase.Id == WorkAgeDecaiml.Id) { return (new ContractStringValue(contract).WorkAgeString); } if (searchField.FieldParaBase.Id == WorkPlace.Id) { return(new ContractStringValue(contract).WorkPlace); } if (searchField.FieldParaBase.Id == Leader.Id) { return(new ContractStringValue(contract).Leader); } if (searchField.FieldParaBase.Id == Name.Id) { return(new ContractStringValue(contract).Name); } if (searchField.FieldParaBase.Id == MobileNum.Id) { return(new ContractStringValue(contract).MobileNum); } #endregion #region DateTimeField if (searchField.FieldParaBase.Id == ContractEndTime.Id) { return (new ContractStringValue(contract).ContractEndTime); } if (searchField.FieldParaBase.Id == ContractStartTime.Id) { return (new ContractStringValue(contract).ContractStartTime); } if (searchField.FieldParaBase.Id == ProbationTime.Id) { return (new ContractStringValue(contract).ProbationTime); } if (searchField.FieldParaBase.Id == ComeDate.Id) { return (new ContractStringValue(contract).ComeDate); } if (searchField.FieldParaBase.Id == LeaveDate.Id) { return (new ContractStringValue(contract).LeaveDate); } #endregion #region NumField if (searchField.FieldParaBase.Id == ContractNum.Id) { return (new ContractStringValue(contract).SocietyWorkAge); } if (searchField.FieldParaBase.Id == SocietyWorkAge.Id) { return (new ContractStringValue(contract).SocietyWorkAge); } if (searchField.FieldParaBase.Id == EmployeeNum.Id) { return (new ContractStringValue(contract).EmployeeNum); } if (searchField.FieldParaBase.Id == AnnualMaintainDays.Id) { return (new ContractStringValue(contract).AnnualMaintainDays); } if (searchField.FieldParaBase.Id == AdjustMaintainDays.Id) { return (new ContractStringValue(contract).AdjustMaintainDays); } #endregion #region StaticEnumField if (searchField.FieldParaBase.Id == EmployeeType.Id) { return(new ContractStringValue(contract).EmployeeType); } #endregion #region ActiveEnumField if (searchField.FieldParaBase.Id == Position.Id) { return(new ContractStringValue(contract).Position); } if (searchField.FieldParaBase.Id == Company.Id) { return(new ContractStringValue(contract).Company); } if (searchField.FieldParaBase.Id == ContractType.Id) { return(new ContractStringValue(contract).ContractType); } #endregion #region TreeActiveEnumField if (searchField.FieldParaBase.Id == Department.Id) { return(new ContractStringValue(contract).Department); } #endregion return(string.Empty); }
protected virtual SearchField PopulateFieldKey(SearchField searchField) { searchField.IsFilterable = this.IsFilterable; searchField.IsSortable = this.IsSortable; return(searchField); }
/// <summary> /// Get a function to access the key field of a search document. /// </summary> /// <param name="async">Whether to run sync or async.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>A Task representing the operation.</returns> private async Task GetKeyFieldAccessorAsync(bool async, CancellationToken cancellationToken) { // Case 1: The user provided an explicit accessor and we're done if (KeyFieldAccessor != null) { return; } // Case 2: Infer the accessor from FieldBuilder try { FieldBuilder builder = new FieldBuilder { Serializer = SearchClient.Serializer }; IDictionary <string, SearchField> fields = builder.BuildMapping(typeof(T)); KeyValuePair <string, SearchField> keyField = fields.FirstOrDefault(pair => pair.Value.IsKey == true); if (!keyField.Equals(default(KeyValuePair <string, SearchField>))) { KeyFieldAccessor = CompileAccessor(keyField.Key); return; } } catch { // Ignore any errors because this type might not have been // designed with FieldBuilder in mind } // Case 3: Fetch the index to find the key Exception failure = null; try { // Call the service to find the name of the key SearchIndexClient indexClient = SearchClient.GetSearchIndexClient(); SearchIndex index = async ? await indexClient.GetIndexAsync(IndexName, cancellationToken).ConfigureAwait(false) : indexClient.GetIndex(IndexName, cancellationToken); SearchField keyField = index.Fields.Single(f => f.IsKey == true); string key = keyField.Name; if (typeof(T).IsAssignableFrom(typeof(SearchDocument))) { // Case 3a: If it's a dynamic SearchDocument, lookup // the name of the key in the dictionary KeyFieldAccessor = (T doc) => (doc as SearchDocument)?.GetString(key); return; } else { // Case 3b: We'll see if there's a property with the // same name and use that as the accessor if (typeof(T).GetProperty(key) != null || typeof(T).GetField(key) != null) { KeyFieldAccessor = CompileAccessor(key); return; } } } catch (Exception ex) { // We'll provide any exceptions as a hint because it could // be something like using the wrong API Key type when // moving from SearchClient up to SearchIndexClient that // potentially could be addressed if the user really wanted failure = ex; } // Case 4: Throw and tell the user to provide an explicit accessor. throw new InvalidOperationException( $"Failed to discover the Key field of document type {typeof(T).Name} for Azure Cognitive Search index {IndexName}. " + $"Please set {typeof(SearchIndexingBufferedSenderOptions<T>).Name}.{nameof(SearchIndexingBufferedSenderOptions<T>.KeyFieldAccessor)} explicitly.", failure);
public void productSearchUsingKeyword(String itemName) { SearchField.SendKeys(itemName + Keys.Enter); }
public RegexTextFinder() { this.searchField = new SearchField(); this.searchField.SetFocus(); }
private void AddInThePastWeek(SearchField searchfield) { this.SetPending(searchfield); this.AddInThePastWeek(); }
public LocalizedReferencePopupWindow(TreeView contents) { m_SearchField = new SearchField(); m_TreeView = contents; }
private void AddParam(SearchField field, Operator @operator, string[] searchterms, ClauseOperator interclauseoperator, ClauseOperator clauseoperator) { if (field == SearchField.Status) { this.StatusClauseAdded = true; } this.groupparams.Add(new GroupClause { SearchField = field, ClauseOperator = clauseoperator, InterClauseOperator = interclauseoperator, Operator = @operator, SearchTerms = searchterms }); }
private void OnFocus() { CreateLanguageReordableList(); RegisterReordableListCallbacks(); searchableEditor = new SearchField(); }
private void SetPending(SearchField searchfield) { this.pendingsearchfield = searchfield; }
public NavigationSearchData(string xmltag) { Id = ""; FieldId = ""; Action = ""; SqlOperator = ""; SearchFrom = ""; SearchTo = ""; SqlType = ""; SearchField = ""; SqlField = ""; ControlType = ""; Static = ""; Dependency = ""; if (xmltag.Trim().StartsWith("<tag")) { var xdoc = new XmlDataDocument(); xdoc.LoadXml(xmltag); var nodtag = xdoc.SelectSingleNode("tag"); if (nodtag != null) { if (nodtag.Attributes["search"] != null) { SearchField = nodtag.Attributes["search"].Value; var s = SearchField.Split('/'); FieldId = s[s.Count() - 1]; ControlType = s[s.Count() - 2]; } if (nodtag.Attributes["id"] != null) { Id = nodtag.Attributes["id"].Value; } if (nodtag.Attributes["action"] != null) { Action = nodtag.Attributes["action"].Value; } if (nodtag.Attributes["sqloperator"] != null) { SqlOperator = nodtag.Attributes["sqloperator"].Value; } if (nodtag.Attributes["searchfrom"] != null) { SearchFrom = nodtag.Attributes["searchfrom"].Value; } if (nodtag.Attributes["searchto"] != null) { SearchTo = nodtag.Attributes["searchto"].Value; } if (nodtag.Attributes["sqltype"] != null) { SqlType = nodtag.Attributes["sqltype"].Value; } if (nodtag.Attributes["sqlfield"] != null) { SqlField = nodtag.Attributes["sqlfield"].Value; } if (nodtag.Attributes["static"] != null) { Static = nodtag.Attributes["static"].Value; } if (nodtag.Attributes["dependency"] != null) { Dependency = nodtag.Attributes["dependency"].Value; } } } }
/// <summary> /// Grab the filter value for the chosen field /// </summary> /// <param name="fieldName"></param> /// <param name="thisField"></param> /// <returns></returns> string filterValue(string fieldName, out SearchField thisField) { string strRetVal = string.Empty; thisField = SearchField.None; switch (fieldName.ToLower()) { case "genre": thisField = SearchField.Genre; strRetVal = selectGenre(); genreAdded = true; break; case "lastfmtag": thisField = SearchField.LastFMTages; strRetVal = selectLastFMTag(); tagAdded = true; break; case "style": thisField = SearchField.Style; strRetVal = selectStyle(); styleAdded = true; break; case "tone": thisField = SearchField.Tone; strRetVal = selectTone(); toneAdded = true; break; case "composer": thisField = SearchField.Composer; strRetVal = selectComposer(); break; case "keyword": thisField = SearchField.Keyword; strRetVal = getKeyword(); keywordAdded = true; break; } return strRetVal; }
void OnEnable() { m_SearchField = new SearchField(); OnHierarchyChange(); }
private static Texture FindTexture(BinaryReader sourceFile, Texture texture, BinaryReader searchFile, SearchField searchField) { sourceFile.BaseStream.Position = texture.Address; using (BinaryReader data = new BinaryReader(new MemoryStream(sourceFile.ReadBytes(texture.Size)))) { uint a; uint b; bool foundTexture = false; foreach (var field in searchField.Field) { if (field.Size < texture.Size) { continue; } searchFile.BaseStream.Position = field.Start; while (searchFile.BaseStream.Position < field.End) { a = searchFile.ReadUInt32(); b = data.ReadUInt32(); if (a != b) { searchFile.BaseStream.Position -= data.BaseStream.Position; searchFile.BaseStream.Position += 4; data.BaseStream.Position = 0; } if (data.BaseStream.Position >= texture.Size) { foundTexture = true; break; } } if (foundTexture) { int address = (int)(searchFile.BaseStream.Position - texture.Size); searchField.CutSearchField(address, address + texture.Size); return(new Texture(texture.Name, address, texture.Format, texture.Width, texture.Height)); } } } return(null); }
/*================================================================================================================================== * Public Methods *=================================================================================================================================*/ #region LIST //---------------------------------------------------------------------------------------------------------------------------------- // LIST //---------------------------------------------------------------------------------------------------------------------------------- public questStatus List(DatabaseId databaseId, out StoredProceduresListViewModel storedProceduresListViewModel) { // Initialize questStatus status = null; storedProceduresListViewModel = null; // Get query options from query string QueryOptions queryOptions = null; BaseListModeler baseListModeler = new BaseListModeler(this.HttpRequestBase, new UserSession()); status = baseListModeler.ParsePagingOptions(this.HttpRequestBase, out queryOptions); if (!questStatusDef.IsSuccess(status)) { return(status); } // Set up query options. // TEMPORARY: OPTIMIZE THIS List <SearchField> searchFieldList = new List <SearchField>(); SearchField searchField = new SearchField(); searchField.Name = "DatabaseId"; searchField.SearchOperation = SearchOperation.Equal; searchField.Type = typeof(int); searchField.Value = databaseId.Id.ToString(); searchFieldList.Add(searchField); SearchOptions searchOptions = new SearchOptions(); searchOptions.SearchFieldList = searchFieldList; queryOptions.SearchOptions = searchOptions; QueryResponse queryResponse = null; // Get Database storedProcedures List <StoredProcedure> storedProceduresetList = null; StoredProceduresMgr storedProceduresMgr = new StoredProceduresMgr(this.UserSession); status = storedProceduresMgr.List(queryOptions, out storedProceduresetList, out queryResponse); if (!questStatusDef.IsSuccess(status)) { return(status); } // Sort by name storedProceduresetList.Sort(delegate(StoredProcedure i1, StoredProcedure i2) { return(i1.Name.CompareTo(i2.Name)); }); // Transfer model. // TODO: USE BaseListModeler to xfer queryOptions to QueryOptionsStoredProcedureModel. storedProceduresListViewModel = new StoredProceduresListViewModel(this.UserSession); QueryResponseViewModel queryResponseViewModel = null; status = TransferQueryResponse(queryResponse, out queryResponseViewModel); if (!questStatusDef.IsSuccess(status)) { return(status); } storedProceduresListViewModel.QueryResponse = queryResponseViewModel; foreach (Quest.Functional.MasterPricing.StoredProcedure storedProcedure in storedProceduresetList) { StoredProcedureLineItemViewModel storedProcedureLineItemViewModel = new StoredProcedureLineItemViewModel(); BufferMgr.TransferBuffer(storedProcedure, storedProcedureLineItemViewModel); storedProceduresListViewModel.Items.Add(storedProcedureLineItemViewModel); } return(new questStatus(Severity.Success)); }
/// <summary> /// 判断各类字段是否满足条件 /// </summary> /// <param name="searchField"></param> /// <param name="contract"></param> /// <returns></returns> public static bool IsNeedCondition(SearchField searchField, Contract contract) { #region TextField if (searchField.FieldParaBase.Id == WorkPlace.Id || searchField.FieldParaBase.Id == Leader.Id || searchField.FieldParaBase.Id == Name.Id || searchField.FieldParaBase.Id == MobileNum.Id || searchField.FieldParaBase.Id == Remark.Id) { return(((TextField)searchField.ConditionField).DoCompare(GetSearchFieldValue(contract, searchField))); } #endregion #region DateTimeField DateTime dtTryParseTemp; if (searchField.FieldParaBase.Id == ProbationTime.Id || searchField.FieldParaBase.Id == ComeDate.Id || searchField.FieldParaBase.Id == LeaveDate.Id || searchField.FieldParaBase.Id == ContractEndTime.Id || searchField.FieldParaBase.Id == ContractStartTime.Id) { return(((DateTimeField)searchField.ConditionField).DoCompare( DateTime.TryParse(GetSearchFieldValue(contract, searchField), out dtTryParseTemp) ? dtTryParseTemp : new DateTime?())); } #endregion #region NumField decimal dTryParseTemp; if (searchField.FieldParaBase.Id == SocietyWorkAge.Id || searchField.FieldParaBase.Id == EmployeeNum.Id || searchField.FieldParaBase.Id == AnnualMaintainDays.Id || searchField.FieldParaBase.Id == AdjustMaintainDays.Id || searchField.FieldParaBase.Id == ContractNum.Id) { return(((NumField)searchField.ConditionField).DoCompare( decimal.TryParse(GetSearchFieldValue(contract, searchField), out dTryParseTemp) ? dTryParseTemp : new decimal?())); } if (searchField.FieldParaBase.Id == WorkAgeDecaiml.Id) { return(((NumField)searchField.ConditionField).DoCompare( decimal.TryParse(new ContractStringValue(contract).WorkAgeDecaiml, out dTryParseTemp) ? dTryParseTemp : new decimal?())); } #endregion #region StaticEnumField if (searchField.FieldParaBase.Id == WorkType.Id || searchField.FieldParaBase.Id == EmployeeType.Id || searchField.FieldParaBase.Id == PositionGrade.Id) { return (((StaticEnumField)searchField.ConditionField).DoCompare(GetSearchFieldValue(contract, searchField))); } #endregion #region ActiveEnumField if (searchField.FieldParaBase.Id == Position.Id || searchField.FieldParaBase.Id == Company.Id || searchField.FieldParaBase.Id == ContractType.Id) { return (((ActiveEnumField)searchField.ConditionField).DoCompare(GetSearchFieldValue(contract, searchField))); } #endregion #region TreeActiveEnumField if (searchField.FieldParaBase.Id == Department.Id) { return (contract != null && contract.Employee.Account != null && contract.Employee.Account.Dept != null && contract.Employee.Account.Dept.Name != null ? ((TreeActiveEnumField)searchField.ConditionField).DoCompare(DepartmentTree, contract.Employee.Account.Dept.Id) : ((TreeActiveEnumField)searchField.ConditionField).DoCompare(null)); } #endregion return(true); //找不到则认为查询条件无效,直接通过过滤 }
/// <summary> /// Returns the full name of a field. /// </summary> /// <param name="field">Field.</param> /// <returns>Full name of the field.</returns> private string GetFullName(SearchField field) { return field != null ? (field.Property.Parent != null ? string.Format("{0}:{1}.{2}", string.IsNullOrEmpty(field.Name) ? "*" : field.Name, field.Property.Parent.Name, field.Property.Name) : string.Format("{0}:{1}", field.Name, field.Property.Name)) : string.Empty; }
void InitIfNeeded() { if (m_Initialized) { return; } var cpuHierarchyColumns = new[] { HierarchyFrameDataView.columnName, HierarchyFrameDataView.columnTotalPercent, HierarchyFrameDataView.columnSelfPercent, HierarchyFrameDataView.columnCalls, HierarchyFrameDataView.columnGcMemory, HierarchyFrameDataView.columnTotalTime, HierarchyFrameDataView.columnSelfTime, HierarchyFrameDataView.columnWarningCount }; var gpuHierarchyColumns = new[] { HierarchyFrameDataView.columnName, HierarchyFrameDataView.columnTotalGpuPercent, HierarchyFrameDataView.columnDrawCalls, HierarchyFrameDataView.columnTotalGpuTime }; var profilerColumns = gpuView ? gpuHierarchyColumns : cpuHierarchyColumns; var defaultSortColumn = gpuView ? HierarchyFrameDataView.columnTotalGpuTime : HierarchyFrameDataView.columnTotalTime; var columns = CreateColumns(profilerColumns); var headerState = CreateDefaultMultiColumnHeaderState(columns, defaultSortColumn); if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState)) { MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState); } var firstInit = m_MultiColumnHeaderState == null; m_MultiColumnHeaderState = headerState; var multiColumnHeader = new ProfilerFrameDataMultiColumnHeader(m_MultiColumnHeaderState, columns) { height = 25 }; if (firstInit) { multiColumnHeader.ResizeToFit(); } // Check if it already exists (deserialized from window layout file or scriptable object) if (m_TreeViewState == null) { m_TreeViewState = new TreeViewState(); } m_TreeView = new ProfilerFrameDataTreeView(m_TreeViewState, multiColumnHeader); m_TreeView.selectionChanged += OnMainTreeViewSelectionChanged; m_TreeView.searchChanged += OnMainTreeViewSearchChanged; m_TreeView.Reload(); m_CpuProfilerOptions = SessionState.GetInt(k_CpuProfilerHierarchyViewOptionsPrefKey, m_CpuProfilerOptions); m_SearchField = new SearchField(); m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem; if (m_DetailedObjectsView == null) { m_DetailedObjectsView = new ProfilerDetailedObjectsView(); } m_DetailedObjectsView.gpuView = gpuView; m_DetailedObjectsView.frameItemEvent += FrameItem; if (m_DetailedCallsView == null) { m_DetailedCallsView = new ProfilerDetailedCallsView(); } m_DetailedCallsView.frameItemEvent += FrameItem; if (m_DetailedViewSpliterState == null || m_DetailedViewSpliterState.relativeSizes == null || m_DetailedViewSpliterState.relativeSizes.Length == 0) { m_DetailedViewSpliterState = new SplitterState(new[] { 70f, 30f }, new[] { 450, 50 }, null); } m_Initialized = true; }
/// <summary> /// Registers new search field that corresponds to a given object shape property. /// </summary> /// <param name="property">Object shape property.</param> /// <param name="name">Field name.</param> /// <param name="updateIndexes">Value indicating whether to update indexes.</param> private void RegisterFieldInternal(ObjectProperty property, string name, bool updateIndexes) { SearchField field = null; string[] freeTextSearchableProperties = { "Name", "Description", "Tags" }; System.Action tryAddField = () => { string fullName = GetFullName(field); if (!_fullNameToField.ContainsKey(fullName)) { _fields.Add(field); _fullNameToField.Add(fullName, _fields.Count - 1); if (updateIndexes) UpdateIndexes(); } }; if (property != null && IsValidSearchFieldProperty(property)) { field = new SearchField(); field.Name = name; if (string.IsNullOrEmpty(name)) field.Name = property.Name; field.Property = property; tryAddField(); if (string.IsNullOrEmpty(name) && freeTextSearchableProperties.Any(p => string.Compare(p, property.Name, StringComparison.InvariantCultureIgnoreCase) == 0)) { field = new SearchField(); field.Name = string.Empty; field.Property = property; tryAddField(); } } }
private void AddPrices(ISearchDocument document, IEnumerable<FashionVariant> variants) { var prices = _priceService.GetCatalogEntryPrices(variants.Select(x => new CatalogKey(_appContext.ApplicationId, x.Code))).ToList(); var validPrices = prices.Where(x => x.ValidFrom <= DateTime.Now && (x.ValidUntil == null || x.ValidUntil >= DateTime.Now)); foreach (var marketPrices in validPrices.GroupBy(x => x.MarketId)) { foreach (var currencyPrices in marketPrices.GroupBy(x => x.UnitPrice.Currency)) { var topPrice = currencyPrices.OrderByDescending(x => x.UnitPrice).FirstOrDefault(); if (topPrice == null) continue; var variationPrice = new SearchField(IndexingHelper.GetOriginalPriceField(topPrice.MarketId, topPrice.UnitPrice.Currency), topPrice.UnitPrice.Amount); var discountPrice = new SearchField(IndexingHelper.GetPriceField(topPrice.MarketId, topPrice.UnitPrice.Currency), _promotionService.GetDiscountPrice(topPrice.CatalogKey, topPrice.MarketId, topPrice.UnitPrice.Currency).UnitPrice.Amount); document.Add(variationPrice); document.Add(discountPrice); } } }
public IEnumerable <IDecoderItem> Search(string text, List <EasySearchRefField> refFields) { SearchField field = ParseSearchText(text); return(Search(field, text, refFields)); }
public static void InitTreeViewOf(ref AtfStorageTreeView view, ref SearchField field, ref TreeViewState state, TreePurpose purpose, IAtfIntegrator integrator) { InitSpecificTreeViewOf(ref view, ref field, ref state, purpose, (s, p) => new AtfStorageTreeView(p, s, integrator)); }
public abstract IEnumerable <IDecoderItem> Search(SearchField field, string text, List <EasySearchRefField> refFields);
public List <CatalogSearchResultViewModel> SearchCatalogForDescription(SearchField field, string searchQuery, Dispatcher dispatcher) { List <CatalogSearchResultViewModel> results = new List <CatalogSearchResultViewModel>(); try { Debug.WriteLine($"Searching for '{searchQuery}' in the {field} from catalog located at {Settings.CatalogServiceUrl}"); using (var catCon = new RuleCatalogConnection(new Uri(Settings.CatalogServiceUrl), TimeSpan.FromSeconds(60), Settings.CatalogUsername, Settings.CatalogPassword)) { var ruleApps = catCon.GetAllRuleApps().Where(ra => ra.Key.IsLatest); int processedRuleApps = 0; foreach (var ruleApp in ruleApps) { var ruleAppDefInfo = ruleApp.Key; var ruleAppInfo = ruleApp.Value; Debug.WriteLine($"Searching Rule App {ruleAppDefInfo.Name} v{ruleAppDefInfo.PublicRevision} {ruleAppInfo.LastLabelName}"); var ruleAppRef = new CatalogRuleApplicationReference(Settings.CatalogServiceUrl, ruleAppDefInfo.Name, Settings.CatalogUsername, Settings.CatalogPassword, ruleAppDefInfo.PublicRevision); var ruleAppDef = ruleAppRef.GetRuleApplicationDef(); var entities = ((IEnumerable <EntityDef>)ruleAppDef.Entities); foreach (var entity in entities) { foreach (var ruleSet in entity.GetAllRuleSets()) { switch (field) { case SearchField.Description: if (ruleSet.Comments.Contains(searchQuery, StringComparison.InvariantCultureIgnoreCase)) { dispatcher.BeginInvoke(new Action(() => { Results.Add(new CatalogSearchResultViewModel(ruleAppDefInfo, ruleSet, ruleSet.Comments, Settings)); })); } break; case SearchField.Name: if (ruleSet.Name.Contains(searchQuery, StringComparison.InvariantCultureIgnoreCase)) { dispatcher.BeginInvoke(new Action(() => { Results.Add(new CatalogSearchResultViewModel(ruleAppDefInfo, ruleSet, ruleSet.Name, Settings)); })); } break; case SearchField.Note: var matchingNote = ruleSet.Notes.FirstOrDefault(n => n.Text.Contains(searchQuery, StringComparison.InvariantCultureIgnoreCase)); if (matchingNote != null) { dispatcher.BeginInvoke(new Action(() => { Results.Add(new CatalogSearchResultViewModel(ruleAppDefInfo, ruleSet, matchingNote.Text, Settings)); })); } break; } foreach (RuleElementDef rule in ruleSet.GetAllRuleElements()) { switch (field) { case SearchField.Description: if (rule.Comments.Contains(searchQuery, StringComparison.InvariantCultureIgnoreCase)) { dispatcher.BeginInvoke(new Action(() => { Results.Add(new CatalogSearchResultViewModel(ruleAppDefInfo, ruleSet, rule.Comments, Settings, rule)); })); } break; case SearchField.Name: if (rule.Name.Contains(searchQuery, StringComparison.InvariantCultureIgnoreCase)) { dispatcher.BeginInvoke(new Action(() => { Results.Add(new CatalogSearchResultViewModel(ruleAppDefInfo, ruleSet, rule.Name, Settings, rule)); })); } break; case SearchField.Note: var matchingNote = rule.Notes.FirstOrDefault(n => n.Text.Contains(searchQuery, StringComparison.InvariantCultureIgnoreCase)); if (matchingNote != null) { dispatcher.BeginInvoke(new Action(() => { Results.Add(new CatalogSearchResultViewModel(ruleAppDefInfo, ruleSet, matchingNote.Text, Settings, rule)); })); } break; } } } } dispatcher.BeginInvoke(new Action(() => { Progress = (int)(++processedRuleApps / (double)ruleApps.Count() * 100); })); } } } catch (Exception ex) { Debug.WriteLine("Error occurred: " + ex.ToString()); } return(results); }
protected void SetupSearchField() { m_SearchField = new SearchField(); m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem; }
private void AddBetweenDates(SearchField searchfield, DateTime after, DateTime before) { this.SetPending(searchfield); this.AddBetweenDates(after, before); }
private void CreateTreeView() { _treeViewState ??= new TreeViewState(); var nameColumn = new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Name"), headerTextAlignment = TextAlignment.Center, canSort = false, width = 350, minWidth = 50, autoResize = true, allowToggleVisibility = false }; var iconColumn = new MultiColumnHeaderState.Column() { headerContent = new GUIContent(EditorGUIUtility.FindTexture("FilterByType"), "Asset type"), headerTextAlignment = TextAlignment.Center, canSort = false, width = 40, minWidth = 50, autoResize = true, allowToggleVisibility = false }; var descriptionColumn = new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Description"), headerTextAlignment = TextAlignment.Center, canSort = false, width = 200, minWidth = 50, autoResize = true, allowToggleVisibility = false }; var headerState = new MultiColumnHeaderState(new[] { nameColumn, iconColumn, descriptionColumn }); var multiColumnHeader = new MultiColumnHeader(headerState); // カラムヘッダーとともにTreeViewを作成 _treeView = new AssetManagementView(_treeViewState, multiColumnHeader); //Assetのpathの取得 string str = ""; if (Directory.Exists(dir)) { Directory.CreateDirectory(dir); } if (!File.Exists(path)) { var fs = File.Create(path); using (StreamWriter sr = new StreamWriter(fs)) { sr.WriteAsync("{\"dir\": \"Assets\"}"); } } using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.ReadWrite)) using (StreamReader sr = new StreamReader(fs)) { str = sr.ReadToEnd(); } var settings = JsonUtility.FromJson <Settings>(str); if (settings.dir == null) { return; } //取得 var l = AssetDatabase.GetAllAssetPaths().Where(p => p.StartsWith(settings.dir)).ToList(); var prefab = l.Where(p => p.EndsWith(".prefab")); var mat = l.Where(p => p.EndsWith(".mat")); var matRoot = BuildRoot("Material", mat.ToArray()); var prefabRoot = BuildRoot("Prefab", prefab.ToArray()); // TreeViewを初期化 _treeView.Setup(new List <AssetElement> { prefabRoot, matRoot }.ToArray()); // SearchFieldを初期化 _searchField = new SearchField(); _searchField.downOrUpArrowKeyPressed += _treeView.SetFocusAndEnsureSelectedItem; }
private void AddLastYear(SearchField searchfield) { this.SetPending(searchfield); this.AddLastYear(); }
public override void OnOpen() { searchField = new SearchField(); }
private void AddParam(SearchField field, Operator @operator, string[] searchterms) { AddParam(field, @operator, searchterms, ClauseOperator.OR, ClauseOperator.AND); }
private void OnEnable() { searchField = new SearchField(); searchField.SetFocus(); typeListView = new ComponentTypeListView(new TreeViewState(), types, typeSelections, previouslySelected, ComponentFilterChanged); }
private void AddParam(SearchField field, Operator @operator, string searchterm) { if (field == SearchField.Status) { this.StatusClauseAdded = true; } this.valueparams.Add(new ValueClause { ClauseOperator = ClauseOperator.AND, SearchField = field, Operator = @operator, Value = searchterm }); }
public static string TextFieldAutoComplete(SearchField searchField, string input, string[] source, System.Func<string, string> display, int maxShownCount = 5, float levenshteinDistance = 0.5f) { Rect rect = EditorGUILayout.GetControlRect(); return TextFieldAutoComplete(searchField, rect, input, source, display, maxShownCount, levenshteinDistance); }
private void AddYesterday(SearchField searchfield) { this.SetPending(searchfield); this.AddYesterday(); }
/// <summary>A textField to popup a matching popup, based on developers input values.</summary> /// <param name="input">string input.</param> /// <param name="source">the data of all possible values (string).</param> /// <param name="maxShownCount">the amount to display result.</param> /// <param name="levenshteinDistance"> /// value between 0f ~ 1f, /// - more then 0f will enable the fuzzy matching /// - 1f = anything thing is okay. /// - 0f = require full match to the reference /// - recommend 0.4f ~ 0.7f /// </param> /// <returns>output string.</returns> public static string TextFieldAutoComplete(SearchField searchField, Rect position, string input, string[] source, System.Func<string, string> display, int maxShownCount = 5, float levenshteinDistance = 0.5f) { if (input == null) return string.Empty; tag = m_AutoCompleteField + GUIUtility.GetControlID(FocusType.Passive); int uiDepth = GUI.depth; GUI.SetNextControlName(tag); string rst = searchField.OnGUI(position, input); if (input.Length > 0 && searchField.HasFocus()) { if (m_AutoCompleteLastInput != input || // input changed m_EditorFocusAutoComplete != tag) // another field. { // Update cache m_EditorFocusAutoComplete = tag; m_AutoCompleteLastInput = input; List<string> uniqueSrc = new List<string>(new HashSet<string>(source)); // remove duplicate int srcCnt = uniqueSrc.Count; m_CacheCheckList = new List<string>(System.Math.Min(maxShownCount, srcCnt)); // optimize memory alloc // Start with - slow for (int i = 0; i < srcCnt && m_CacheCheckList.Count < maxShownCount; i++) { if (uniqueSrc[i].ToLower().StartsWith(input.ToLower())) { m_CacheCheckList.Add(uniqueSrc[i]); uniqueSrc.RemoveAt(i); srcCnt--; i--; } } // Contains - very slow if (m_CacheCheckList.Count == 0) { for (int i = 0; i < srcCnt && m_CacheCheckList.Count < maxShownCount; i++) { if (uniqueSrc[i].ToLower().Contains(input.ToLower())) { m_CacheCheckList.Add(uniqueSrc[i]); uniqueSrc.RemoveAt(i); srcCnt--; i--; } } } // Levenshtein Distance - very very slow. if (levenshteinDistance > 0f && // only developer request input.Length > 3 && // 3 characters on input, hidden value to avoid doing too early. m_CacheCheckList.Count < maxShownCount) // have some empty space for matching. { levenshteinDistance = Mathf.Clamp01(levenshteinDistance); string keywords = input.ToLower(); for (int i = 0; i < srcCnt && m_CacheCheckList.Count < maxShownCount; i++) { int distance = LevenshteinDistance(uniqueSrc[i], keywords, caseSensitive: false); bool closeEnough = (int)(levenshteinDistance * uniqueSrc[i].Length) > distance; if (closeEnough) { m_CacheCheckList.Add(uniqueSrc[i]); uniqueSrc.RemoveAt(i); srcCnt--; i--; } } } } // Draw recommend keyward(s) if (m_CacheCheckList.Count > 0) { int cnt = m_CacheCheckList.Count; float height = cnt * EditorGUIUtility.singleLineHeight; Rect area = position; area = new Rect(area.x, area.y - height, area.width, height); GUI.depth -= 10; // GUI.BeginGroup(area); // area.position = Vector2.zero; GUI.BeginClip(area); Rect line = new Rect(0, 0, area.width, EditorGUIUtility.singleLineHeight); Event e = Event.current; //if control key is pressed if (e.type == EventType.KeyDown) { if (e.keyCode == KeyCode.Tab || e.keyCode == KeyCode.Return) return m_CacheCheckList[0]; } for (int i = 0; i < cnt; i++) { var style = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; style.normal.background = TextureTools.MakeTex((int)line.width, (int)line.height, new Color(.82f, .82f, .82f)); if (GUI.Button(line, display(m_CacheCheckList[i]), style))//, EditorStyles.toolbarDropDown)) { rst = m_CacheCheckList[i]; GUI.changed = true; GUI.FocusControl(""); // force update } line.y += line.height; } GUI.EndClip(); //GUI.EndGroup(); GUI.depth += 10; } } return rst; }
public long Search(SearchField sf) { #region preflight checks if (RecordTemplate == null && DataFiles != null && DataFiles.Count > 0) return -1; int startfile = 0; // Create a new stream if one doesn't exit. if (queryDataStream == null) queryDataStream = DataFiles[0].dataStream; else { // Find the datafile our query stream belongs to foreach (var file in DataFiles) if (file.dataStream == queryDataStream) break; else startfile++; } #endregion // some shortcuts int reclen = RecordTemplate.RecLength; FileStream stream = queryDataStream; #region Logic /* // 1 // Goto beginning of next record (positionincurrentrecord = (currentposition in stream % reclength) // (Seek for (record length - psitionincurrentrecord)) // if its the end of the file // and its the first time on this start file // switch the indicator // and if its not the first time on this file // return no find // and there is only 1 file // go to the beginning of the file // and a next file exists // rewind the query stream // go to the next file // go to the beginning // and a first file exists // rewind the query string // goto the first file // goto the beginnging // endif // // foreach indfield // seek to indfield start position // read indfield // if match for ind value && there is another field in the list // continue to next field; (seek for (nextFieldStart - thisFieldStart + thisFieldLength)) // if match for list value && no more in the list // test query // return found or break to next record;(whatever that number is) // if !match for list value // goto 1 // Otherwise * seek to the search field * read the value * test the value * break if no match * return record id if found */ #endregion #region new // loops for each record in the file. for (int currfile = -1; currfile < DataFiles.Count; ) { #region handle DataFile and sets us at the beginning of a record for reading // Figure out the beginning of the next whole record if (stream.Position != 0) { long currRecBegin = reclen - (stream.Position % reclen); stream.Seek((currRecBegin), SeekOrigin.Current); } // Checks to see if we're at the end // get the next page if we're at the end // return if we've cycled back to where we started if (stream.Position + sf.searchField.Size >= stream.Length) { if (currfile == startfile) return -1; else if (DataFiles.Count == 1) { currfile = startfile; stream.Seek(0, SeekOrigin.Begin); } else { if (currfile == -1) currfile = startfile; if (DataFiles.Count > currfile) { stream.Seek(0, SeekOrigin.Begin); stream = DataFiles[currfile++].dataStream; stream.Seek(0, SeekOrigin.Begin); } else { stream.Seek(0, SeekOrigin.Begin); stream = DataFiles[0].dataStream; currfile = 0; stream.Seek(0, SeekOrigin.Begin); } } } #endregion #region Search the Record if (sf.indFields.Count != 0) { int f = 1; int laststart = 0; int lastlength = 0; foreach (var ifield in sf.indFields) { stream.Seek((ifield.Value.startPosition - laststart + lastlength), SeekOrigin.Current); ifield.Value.ReadValue(stream); if (ifield.Value.ToString() == sf.Key && f < sf.indFields.Count) { laststart = ifield.Value.startPosition; lastlength = ifield.Value.Size; continue; } if (ifield.Value.ToString() == sf.Key && f == sf.indFields.Count) { stream.Seek((sf.searchField.startPosition - ifield.Value.startPosition + ifield.Value.Size), SeekOrigin.Current); sf.searchField.ReadValue(stream); if (sf.searchField.ToString() == sf.Query) { int numrecs = 0; for (int z = 0; z < currfile; z++) numrecs += DataFiles[z].RecordCount; // beginning of the found record //recs in file /files before this one //because the lookup is based on real numbers return ((stream.Position - sf.searchField.startPosition) / reclen) + numrecs + 1; } else break; } if (ifield.Value.ToString() != sf.Key) { break; } } } else { currfile = 0; if(sf.searchField.isNullable) stream.Seek((sf.searchField.startPosition - 1), SeekOrigin.Current); else stream.Seek((sf.searchField.startPosition), SeekOrigin.Current); sf.searchField.ReadValue(stream); if (sf.searchField.Equals(sf.Query)) { int numrecs = 0; for (int z = 0; z < currfile; z++) numrecs += DataFiles[z].RecordCount; return ((stream.Position - sf.searchField.startPosition) / reclen) + numrecs + 1; } else continue; } #endregion } return -1; #endregion #region old //// Figure out the beginning of the next whole record //if(stream.Position != 0) // currRecBegin = reclen - (stream.Position % reclen); ////// Set it back a record length minus our field length so when we ////if(currRecBegin > (reclen - field.Size)) //// currRecBegin = currRecBegin - (reclen - field.Size); //// Set to the beginning of the next record search field //queryDataStream.Seek((currRecBegin + field.startPosition), SeekOrigin.Current); //bool cycled = false; //for (int i = page; i < DataFiles.Count; i++) //{ // do // { // field.ReadValue(queryDataStream); // if (field.Equals(query)) // // beginning of the found record //recs in file /files before this one //because the lookup is based on real numbers // return ((stream.Position - field.startPosition) / reclen) + (i * reclen) + 1; // // Read the next record if there is room // if (stream.Position < reclen + stream.Length) // stream.Seek(reclen - field.Size, SeekOrigin.Current); // else break; // } while (true) ; // // If we hit the end of the file and need a new page // if (page == ++i) // { // if(cycled == true) // return -1; // stream.Seek(0, SeekOrigin.Begin); // i--; // cycled = true; // continue; // } // if (i == DataFiles.Count && page != 0 && i + 1 != page) // { // // reset our current stream // stream.Seek(0, SeekOrigin.Begin); // // Get a new stream // stream = DataFiles[i + 1].dataStream; // // set it to zero // stream.Seek(field.startPosition, SeekOrigin.Begin); // continue; // } //} #endregion }
private static void ProcessSubdirectory(ClassHelper source, TextureDirectory sourceDir, ClassHelper current, TextureDirectory currentDir, SearchField searchField, Dictionary <int, int?> paletteDictionary, bool top = false) { //check if any subdirectories exist foreach (var subdir in sourceDir.Folders) { //create a temp subdirectory TextureDirectory currentSubDir = new TextureDirectory(subdir.Name, 0, currentDir.Size); //attach currentDir.Folders.Add(currentSubDir); //process subdirectory ProcessSubdirectory(source, subdir, current, currentSubDir, searchField, paletteDictionary); //all textures are found/loaded into the subfolder. //subdir addr/size set } foreach (var sourceTexture in sourceDir.Textures.OrderBy(x => x.Address)) { Texture foundTexture = null; try { if (sourceTexture.Format == "jpeg") { foundTexture = FindJpeg(source, sourceTexture, current, searchField); } else { foundTexture = FindTexture(source, sourceTexture, current, searchField); } } catch { } if (foundTexture == null) { sb.AppendLine($"Texture: {sourceTexture} not found."); } else { if ((sourceTexture.Format == "ci8" || sourceTexture.Format == "ci4") && ShouldFindPalette(paletteDictionary, sourceTexture, ref foundTexture)) { var foundPalTexture = FindPalette(source, sourceDir, current, searchField, sourceTexture); if (foundPalTexture != null) { paletteDictionary.Add((int)sourceTexture.Palette, foundPalTexture.Address); foundTexture.Palette = foundPalTexture.Address; currentDir.Textures.Add(foundPalTexture); } } currentDir.Textures.Add(foundTexture); } } //needs to re-adjust texture offsets as well. oops. ////if not the top node, update current folder address/size //if (!top && currentDir.Textures.Count != 0) //{ // var min = currentDir.Textures.Min(x => x.Address); // var max = currentDir.Textures // .Aggregate((maxVal, x) => x.Address > maxVal.Address ? x : maxVal); // currentDir.Address = min; // currentDir.Size = max.Address + max.Size - min; //} }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMesclarCarregarDAV)); this.tabVlrDocto = new System.Windows.Forms.TabPage(); this.mkFinal = new OpenPOS.Desktop.ComponentModel.MaskedNumber(); this.lblIntervaloValorE = new System.Windows.Forms.Label(); this.lblValorIntervalo = new System.Windows.Forms.Label(); this.mkNmInicio = new OpenPOS.Desktop.ComponentModel.MaskedNumber(); this.tabData = new System.Windows.Forms.TabPage(); this.lblIntervalo = new System.Windows.Forms.Label(); this.lblPeriodo = new System.Windows.Forms.Label(); this.dtFinal = new System.Windows.Forms.DateTimePicker(); this.dtInicio = new System.Windows.Forms.DateTimePicker(); this.tabPesquisar = new System.Windows.Forms.TabControl(); this.tabNrDocumento = new System.Windows.Forms.TabPage(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.mkTxtFinal = new System.Windows.Forms.MaskedTextBox(); this.mkTxtInicio = new System.Windows.Forms.MaskedTextBox(); this.grpBoxFiltros = new System.Windows.Forms.GroupBox(); this.btnPesquisar = new System.Windows.Forms.Button(); this.treeViewDAV = new System.Windows.Forms.TreeView(); this.btnConfirmar = new System.Windows.Forms.Button(); this.btnCancelar = new System.Windows.Forms.Button(); this.treeViewDAVsSelcionados = new System.Windows.Forms.TreeView(); this.btnRight = new System.Windows.Forms.Button(); this.btnLeft = new System.Windows.Forms.Button(); this.imagelistTreeViews = new System.Windows.Forms.ImageList(this.components); this.tabCliente = new System.Windows.Forms.TabPage(); this.sfCliente = new OpenPOS.Desktop.ComponentModel.SearchField(); this.lblCliente = new System.Windows.Forms.Label(); this.tabVlrDocto.SuspendLayout(); this.tabData.SuspendLayout(); this.tabPesquisar.SuspendLayout(); this.tabNrDocumento.SuspendLayout(); this.grpBoxFiltros.SuspendLayout(); this.tabCliente.SuspendLayout(); this.SuspendLayout(); // // tabVlrDocto // this.tabVlrDocto.Controls.Add(this.mkFinal); this.tabVlrDocto.Controls.Add(this.lblIntervaloValorE); this.tabVlrDocto.Controls.Add(this.lblValorIntervalo); this.tabVlrDocto.Controls.Add(this.mkNmInicio); this.tabVlrDocto.Location = new System.Drawing.Point(4, 25); this.tabVlrDocto.Name = "tabVlrDocto"; this.tabVlrDocto.Padding = new System.Windows.Forms.Padding(3); this.tabVlrDocto.Size = new System.Drawing.Size(857, 46); this.tabVlrDocto.TabIndex = 1; this.tabVlrDocto.Text = "Valor do Documento"; this.tabVlrDocto.UseVisualStyleBackColor = true; // // mkFinal // this.mkFinal.AlwaysLocked = false; this.mkFinal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.mkFinal.CustomFormat = "{0:0}"; this.mkFinal.Format = OpenPOS.Enuns.Desktop.ComponentModel.MaskedNumberFormat.Valor; this.mkFinal.Location = new System.Drawing.Point(235, 14); this.mkFinal.Name = "mkFinal"; this.mkFinal.NegativeNumbers = true; this.mkFinal.Size = new System.Drawing.Size(100, 22); this.mkFinal.TabIndex = 3; this.mkFinal.Text = "0,00"; this.mkFinal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.mkFinal.Value = 0D; // // lblIntervaloValorE // this.lblIntervaloValorE.AutoSize = true; this.lblIntervaloValorE.Location = new System.Drawing.Point(213, 16); this.lblIntervaloValorE.Name = "lblIntervaloValorE"; this.lblIntervaloValorE.Size = new System.Drawing.Size(16, 16); this.lblIntervaloValorE.TabIndex = 2; this.lblIntervaloValorE.Text = "a"; // // lblValorIntervalo // this.lblValorIntervalo.AutoSize = true; this.lblValorIntervalo.Location = new System.Drawing.Point(6, 16); this.lblValorIntervalo.Name = "lblValorIntervalo"; this.lblValorIntervalo.Size = new System.Drawing.Size(95, 16); this.lblValorIntervalo.TabIndex = 1; this.lblValorIntervalo.Text = "Intervalo entre:"; // // mkNmInicio // this.mkNmInicio.AlwaysLocked = false; this.mkNmInicio.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.mkNmInicio.CustomFormat = "{0:0}"; this.mkNmInicio.Format = OpenPOS.Enuns.Desktop.ComponentModel.MaskedNumberFormat.Valor; this.mkNmInicio.Location = new System.Drawing.Point(107, 14); this.mkNmInicio.Name = "mkNmInicio"; this.mkNmInicio.NegativeNumbers = true; this.mkNmInicio.Size = new System.Drawing.Size(100, 22); this.mkNmInicio.TabIndex = 0; this.mkNmInicio.Text = "0,00"; this.mkNmInicio.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.mkNmInicio.Value = 0D; // // tabData // this.tabData.Controls.Add(this.lblIntervalo); this.tabData.Controls.Add(this.lblPeriodo); this.tabData.Controls.Add(this.dtFinal); this.tabData.Controls.Add(this.dtInicio); this.tabData.Location = new System.Drawing.Point(4, 25); this.tabData.Name = "tabData"; this.tabData.Padding = new System.Windows.Forms.Padding(3); this.tabData.Size = new System.Drawing.Size(857, 46); this.tabData.TabIndex = 0; this.tabData.Text = "Período"; this.tabData.UseVisualStyleBackColor = true; // // lblIntervalo // this.lblIntervalo.AutoSize = true; this.lblIntervalo.Location = new System.Drawing.Point(14, 16); this.lblIntervalo.Name = "lblIntervalo"; this.lblIntervalo.Size = new System.Drawing.Size(62, 16); this.lblIntervalo.TabIndex = 3; this.lblIntervalo.Text = "Intervalo:"; // // lblPeriodo // this.lblPeriodo.AutoSize = true; this.lblPeriodo.Location = new System.Drawing.Point(361, 16); this.lblPeriodo.Name = "lblPeriodo"; this.lblPeriodo.Size = new System.Drawing.Size(16, 16); this.lblPeriodo.TabIndex = 2; this.lblPeriodo.Text = "a"; // // dtFinal // this.dtFinal.Location = new System.Drawing.Point(383, 12); this.dtFinal.Name = "dtFinal"; this.dtFinal.Size = new System.Drawing.Size(275, 22); this.dtFinal.TabIndex = 1; // // dtInicio // this.dtInicio.Location = new System.Drawing.Point(82, 12); this.dtInicio.Name = "dtInicio"; this.dtInicio.Size = new System.Drawing.Size(273, 22); this.dtInicio.TabIndex = 0; // // tabPesquisar // this.tabPesquisar.Controls.Add(this.tabData); this.tabPesquisar.Controls.Add(this.tabVlrDocto); this.tabPesquisar.Controls.Add(this.tabNrDocumento); this.tabPesquisar.Controls.Add(this.tabCliente); this.tabPesquisar.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tabPesquisar.Location = new System.Drawing.Point(11, 21); this.tabPesquisar.Name = "tabPesquisar"; this.tabPesquisar.SelectedIndex = 0; this.tabPesquisar.Size = new System.Drawing.Size(865, 75); this.tabPesquisar.TabIndex = 0; // // tabNrDocumento // this.tabNrDocumento.Controls.Add(this.label2); this.tabNrDocumento.Controls.Add(this.label1); this.tabNrDocumento.Controls.Add(this.mkTxtFinal); this.tabNrDocumento.Controls.Add(this.mkTxtInicio); this.tabNrDocumento.Location = new System.Drawing.Point(4, 25); this.tabNrDocumento.Name = "tabNrDocumento"; this.tabNrDocumento.Padding = new System.Windows.Forms.Padding(3); this.tabNrDocumento.Size = new System.Drawing.Size(857, 46); this.tabNrDocumento.TabIndex = 2; this.tabNrDocumento.Text = "Número do Documento"; this.tabNrDocumento.UseVisualStyleBackColor = true; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(213, 18); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(16, 16); this.label2.TabIndex = 3; this.label2.Text = "a"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(6, 18); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(95, 16); this.label1.TabIndex = 2; this.label1.Text = "Intervalo entre:"; // // mkTxtFinal // this.mkTxtFinal.Location = new System.Drawing.Point(235, 15); this.mkTxtFinal.Name = "mkTxtFinal"; this.mkTxtFinal.Size = new System.Drawing.Size(100, 22); this.mkTxtFinal.TabIndex = 1; // // mkTxtInicio // this.mkTxtInicio.Location = new System.Drawing.Point(107, 15); this.mkTxtInicio.Name = "mkTxtInicio"; this.mkTxtInicio.Size = new System.Drawing.Size(100, 22); this.mkTxtInicio.TabIndex = 0; // // grpBoxFiltros // this.grpBoxFiltros.Controls.Add(this.btnPesquisar); this.grpBoxFiltros.Controls.Add(this.tabPesquisar); this.grpBoxFiltros.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.grpBoxFiltros.Location = new System.Drawing.Point(12, 79); this.grpBoxFiltros.Name = "grpBoxFiltros"; this.grpBoxFiltros.Size = new System.Drawing.Size(906, 153); this.grpBoxFiltros.TabIndex = 2; this.grpBoxFiltros.TabStop = false; this.grpBoxFiltros.Text = "Filtros"; // // btnPesquisar // this.btnPesquisar.Location = new System.Drawing.Point(775, 109); this.btnPesquisar.Name = "btnPesquisar"; this.btnPesquisar.Size = new System.Drawing.Size(101, 35); this.btnPesquisar.TabIndex = 1; this.btnPesquisar.Text = "Pesquisar"; this.btnPesquisar.UseVisualStyleBackColor = true; this.btnPesquisar.Click += new System.EventHandler(this.btnPesquisar_Click); // // treeViewDAV // this.treeViewDAV.AllowDrop = true; this.treeViewDAV.CheckBoxes = true; this.treeViewDAV.FullRowSelect = true; this.treeViewDAV.HideSelection = false; this.treeViewDAV.Location = new System.Drawing.Point(12, 248); this.treeViewDAV.Name = "treeViewDAV"; this.treeViewDAV.Size = new System.Drawing.Size(422, 247); this.treeViewDAV.TabIndex = 3; this.treeViewDAV.Tag = "DAV\'s "; // // btnConfirmar // this.btnConfirmar.Location = new System.Drawing.Point(705, 515); this.btnConfirmar.Name = "btnConfirmar"; this.btnConfirmar.Size = new System.Drawing.Size(101, 35); this.btnConfirmar.TabIndex = 2; this.btnConfirmar.Text = "Confirmar"; this.btnConfirmar.UseVisualStyleBackColor = true; this.btnConfirmar.Click += new System.EventHandler(this.btnConfirmar_Click); // // btnCancelar // this.btnCancelar.Location = new System.Drawing.Point(812, 515); this.btnCancelar.Name = "btnCancelar"; this.btnCancelar.Size = new System.Drawing.Size(101, 35); this.btnCancelar.TabIndex = 4; this.btnCancelar.Text = "Cancelar"; this.btnCancelar.UseVisualStyleBackColor = true; this.btnCancelar.Click += new System.EventHandler(this.btnCancelar_Click); // // treeViewDAVsSelcionados // this.treeViewDAVsSelcionados.AllowDrop = true; this.treeViewDAVsSelcionados.CheckBoxes = true; this.treeViewDAVsSelcionados.FullRowSelect = true; this.treeViewDAVsSelcionados.HideSelection = false; this.treeViewDAVsSelcionados.Location = new System.Drawing.Point(491, 250); this.treeViewDAVsSelcionados.Name = "treeViewDAVsSelcionados"; this.treeViewDAVsSelcionados.Size = new System.Drawing.Size(422, 245); this.treeViewDAVsSelcionados.TabIndex = 5; this.treeViewDAVsSelcionados.Tag = "DAV\'s Selecionados"; // // btnRight // this.btnRight.BackColor = System.Drawing.Color.Transparent; this.btnRight.BackgroundImage = global::OpenPOS.Desktop.ComponentModel.Properties.Resources.seta_direita; this.btnRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.btnRight.FlatAppearance.BorderSize = 0; this.btnRight.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRight.ForeColor = System.Drawing.SystemColors.ControlText; this.btnRight.Location = new System.Drawing.Point(440, 324); this.btnRight.Name = "btnRight"; this.btnRight.Size = new System.Drawing.Size(45, 48); this.btnRight.TabIndex = 6; this.btnRight.UseVisualStyleBackColor = true; this.btnRight.Click += new System.EventHandler(this.btnRight_Click); // // btnLeft // this.btnLeft.BackColor = System.Drawing.Color.Transparent; this.btnLeft.BackgroundImage = global::OpenPOS.Desktop.ComponentModel.Properties.Resources.seta_esquerda; this.btnLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.btnLeft.FlatAppearance.BorderSize = 0; this.btnLeft.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLeft.Location = new System.Drawing.Point(440, 378); this.btnLeft.Name = "btnLeft"; this.btnLeft.Size = new System.Drawing.Size(45, 39); this.btnLeft.TabIndex = 7; this.btnLeft.UseVisualStyleBackColor = false; this.btnLeft.Click += new System.EventHandler(this.btnLeft_Click); // // imagelistTreeViews // this.imagelistTreeViews.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imagelistTreeViews.ImageStream"))); this.imagelistTreeViews.TransparentColor = System.Drawing.Color.Transparent; this.imagelistTreeViews.Images.SetKeyName(0, "cancel18x17.png"); this.imagelistTreeViews.Images.SetKeyName(1, "ok18x17.png"); // // tabCliente // this.tabCliente.BackColor = System.Drawing.SystemColors.Control; this.tabCliente.Controls.Add(this.lblCliente); this.tabCliente.Controls.Add(this.sfCliente); this.tabCliente.Location = new System.Drawing.Point(4, 25); this.tabCliente.Name = "tabCliente"; this.tabCliente.Size = new System.Drawing.Size(857, 46); this.tabCliente.TabIndex = 3; this.tabCliente.Text = "Cliente"; // // sfCliente // this.sfCliente.BackColor = System.Drawing.Color.White; this.sfCliente.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.sfCliente.DataSource = null; this.sfCliente.DontClearMe = false; this.sfCliente.Location = new System.Drawing.Point(3, 22); this.sfCliente.MaxDropDownHeight = 0; this.sfCliente.Name = "sfCliente"; this.sfCliente.Size = new System.Drawing.Size(404, 21); this.sfCliente.TabIndex = 0; // // lblCliente // this.lblCliente.AutoSize = true; this.lblCliente.Location = new System.Drawing.Point(3, 3); this.lblCliente.Name = "lblCliente"; this.lblCliente.Size = new System.Drawing.Size(52, 16); this.lblCliente.TabIndex = 1; this.lblCliente.Text = "Cliente:"; // // FormMesclarCarregarDAV // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(926, 557); this.Controls.Add(this.btnLeft); this.Controls.Add(this.btnRight); this.Controls.Add(this.treeViewDAVsSelcionados); this.Controls.Add(this.btnCancelar); this.Controls.Add(this.btnConfirmar); this.Controls.Add(this.treeViewDAV); this.Controls.Add(this.grpBoxFiltros); this.Name = "FormMesclarCarregarDAV"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Carregar/Mesclar DAV"; this.tabVlrDocto.ResumeLayout(false); this.tabVlrDocto.PerformLayout(); this.tabData.ResumeLayout(false); this.tabData.PerformLayout(); this.tabPesquisar.ResumeLayout(false); this.tabNrDocumento.ResumeLayout(false); this.tabNrDocumento.PerformLayout(); this.grpBoxFiltros.ResumeLayout(false); this.tabCliente.ResumeLayout(false); this.tabCliente.PerformLayout(); this.ResumeLayout(false); }
private static Texture FindJpeg(ClassHelper source, Texture texture, ClassHelper current, SearchField searchField) { return(null); }
/// <summary> /// Generate a filtered playlist /// </summary> /// <param name="searchField"></param> /// <param name="strSearchValue"></param> void genFilterPlaylist(SearchField searchField, string strSearchValue) { switch (searchField) { case SearchField.Genre: if (artistPlayList.Count == 0) { // If have not selected list then run though and add matching artists foreach (DBArtistInfo artistData in fullArtistList) { if (string.Equals(artistData.Genre, strSearchValue, StringComparison.OrdinalIgnoreCase) || artistData.Genre.Contains(strSearchValue,StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } else { // This is a filter on previous list, run though and remove non-matching artists List<DBArtistInfo> workingArtistList = new List<DBArtistInfo>(artistPlayList); artistPlayList.Clear(); foreach (DBArtistInfo artistData in workingArtistList) { if (string.Equals(artistData.Genre, strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } break; case SearchField.LastFMTages: if (artistPlayList.Count == 0) { foreach (DBArtistInfo artistData in fullArtistList) { foreach (string tag in artistData.Tag) { if (String.Equals(tag, strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } } else { List<DBArtistInfo> workingArtistList = new List<DBArtistInfo>(artistPlayList); artistPlayList.Clear(); foreach (DBArtistInfo artistData in workingArtistList) { foreach (string tag in artistData.Tag) { if (String.Equals(tag, strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } } break; case SearchField.Tone: if (artistPlayList.Count == 0) { foreach (DBArtistInfo artistData in fullArtistList) { if (artistData.Tones.Contains(strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } else { List<DBArtistInfo> workingArtistList = new List<DBArtistInfo>(artistPlayList); artistPlayList.Clear(); foreach (DBArtistInfo artistData in workingArtistList) { if (artistData.Tones.Contains(strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } break; case SearchField.Style: if (artistPlayList.Count == 0) { foreach (DBArtistInfo artistData in fullArtistList) { if (artistData.Styles.Contains(strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } else { List<DBArtistInfo> workingArtistList = new List<DBArtistInfo>(artistPlayList); artistPlayList.Clear(); foreach (DBArtistInfo artistData in workingArtistList) { if (artistData.Styles.Contains(strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } break; case SearchField.Composer: // If we have an empty list but we have a composer chosen then grab all artists and filter out just tracks with that composer during the facade build if (artistPlayList.Count == 0 && selectedComposer != "None") artistPlayList = DBArtistInfo.GetAll(); break; case SearchField.Keyword: if (artistPlayList.Count == 0) { foreach (DBArtistInfo artistData in fullArtistList) { if (artistData.bioContent.Contains(strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } else { List<DBArtistInfo> workingArtistList = new List<DBArtistInfo>(artistPlayList); artistPlayList.Clear(); foreach (DBArtistInfo artistData in workingArtistList) { if (artistData.bioContent.Contains(strSearchValue, StringComparison.OrdinalIgnoreCase)) artistPlayList.Add(artistData); } } break; default: break; } buildFacade(); }
private static Texture FindTexture(ClassHelper source, Texture texture, ClassHelper current, SearchField searchField) { source.File.Stream.Position = 0; BinaryReader dbg = new BinaryReader(source.File); BinaryReader ntsc = new BinaryReader(current.File); { return(FindTexture(dbg, texture, ntsc, searchField)); } }