/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public override List <string> GetCategoryNames(ECategoryType type) { List <string> names = null; if (type == ECategoryType.Program) { names = new List <string> { "Synth-Hard", "Synth-Soft", "Synth-Lead", "Synth-Motion", "Synth-Bass", "E.Piano", "Organ", "Keyboard", "Bell", "Strings", "Bad/Choir", "Brass", "Reed/Wind", "Guitar/Plucked", "Bass", "Percussive", "Arpeggio", "SFX/Other" }; } // Else keep empty return(names); }
/// <summary> /// Returns offset from global. /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <returns></returns> protected virtual int CalcCategoryNameOffset(ECategoryType type, int index) { int offset = ByteOffset + PcgOffsetCategories; offset += (type == ECategoryType.Program) ? 0 : SizeOfProgramsCategoriesAndSubCategories; offset += index * CategoryNameLength; return(offset); }
/// <summary> /// /// </summary> /// <param name="patch"></param> /// <returns></returns> public virtual string GetCategoryName(IPatch patch) { ECategoryType type = patch is IProgram ? ECategoryType.Program : ECategoryType.Combi; dynamic category = patch is IProgram ? ((IProgram)patch).GetParam(ParameterNames.ProgramParameterName.Category).Value : ((ICombi)patch).GetParam(ParameterNames.CombiParameterName.Category).Value; return(Util.GetChars(PcgMemory.Content, CalcCategoryNameOffset(type, category), CategoryNameLength)); }
/// <summary> /// Returns offset from global. /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <param name="subIndex"></param> /// <returns></returns> protected override int CalcSubCategoryNameOffset(ECategoryType type, int index, int subIndex) { var offset = ByteOffset + PcgOffsetCategories; // Skip categories; the Kross has no category names in its GLOBAL. offset += index * SubCategoriesSize; offset += subIndex * CategoryNameLength; return(offset); }
/// <summary> /// Returns offset from global. /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <param name="subIndex"></param> /// <returns></returns> protected virtual int CalcSubCategoryNameOffset(ECategoryType type, int index, int subIndex) { int offset = ByteOffset + PcgOffsetCategories; int typeSize = NrOfCategories * (CategoryNameLength + SubCategoriesSize); offset += (type == ECategoryType.Program) ? 0 : typeSize; offset += NrOfCategories * CategoryNameLength; // Categories size offset += index * SubCategoriesSize; offset += subIndex * CategoryNameLength; return(offset); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="category"></param> /// <returns></returns> public LinkedList <string> GetSubCategoryNames(ECategoryType type, int category) { LinkedList <string> categories = new LinkedList <string>(); for (int subCategory = 0; subCategory < NrOfSubCategories; subCategory++) { categories.AddLast( Util.GetChars(PcgMemory.Content, CalcSubCategoryNameOffset(type, category, subCategory), CategoryNameLength)); } return(categories); }
/// <summary> /// Returns offset from global. /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <param name="subIndex"></param> /// <returns></returns> protected override int CalcSubCategoryNameOffset(ECategoryType type, int index, int subIndex) { var offset = ByteOffset + PcgOffsetCategories; var typeSize = PcgMemory.HasSubCategories ? NrOfCategories * NrOfSubCategories * CategoryNameLength : 0; offset += (type == ECategoryType.Program) ? 0 : typeSize; //offset += NrOfCategories*CategoryNameLength; // Categories size offset += index * NrOfSubCategories * CategoryNameLength; offset += subIndex * CategoryNameLength; return(offset); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public virtual List <string> GetCategoryNames(ECategoryType type) { List <string> categories = new List <string>(); for (int category = 0; category < NrOfCategories; category++) { categories.Add( Util.GetChars(PcgMemory.Content, CalcCategoryNameOffset(type, category), CategoryNameLength)); } return(categories); }
/// <summary> /// Returns offset from global. /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <returns></returns> protected override int CalcCategoryNameOffset(ECategoryType type, int index) { var offset = ByteOffset + PcgOffsetCategories; if (!Settings.Default.TrinityCategorySetA) { offset += CategoryNameLength * NrOfCategories; } offset += (type == ECategoryType.Program) ? 0 : SizeOfProgramsCategoriesAndSubCategories; offset += index * CategoryNameLength; return(offset); }
public async Task <IEnumerable <Category> > GetByCategoryTypeAsync(ECategoryType categoryType) { try { var list = await(from c in db.Categories where c.Type == categoryType orderby c.Description select c).ToListAsync(); return(list); } catch (Exception e) { } return(new List <Category>()); }
private void cbCategoryType_SelectedIndexChanged(object sender, EventArgs e) { if (this.refreshing) { return; } this.refreshing = true; ECategoryType categoryType = (ECategoryType)this.cbCategoryType.SelectedIndex; MetaType metaType = (MetaType)this.lbTypes.SelectedItem; switch (categoryType) { case ECategoryType.Integral: metaType.SubType1 = null; metaType.SubType2 = null; metaType.EnumValues = null; break; case ECategoryType.List: if (metaType.SubType1 == null) { metaType.SubType1 = this.model.AllTypes[0]; } metaType.SubType2 = null; metaType.EnumValues = null; break; case ECategoryType.Dictionary: if (metaType.SubType1 == null) { metaType.SubType1 = this.model.AllTypes[0]; } if (metaType.SubType2 == null) { metaType.SubType2 = this.model.AllTypes[0]; } metaType.EnumValues = null; break; case ECategoryType.Enum: metaType.SubType1 = null; metaType.SubType2 = null; metaType.EnumValues = new List <string>(); break; } this.refreshing = false; this.RefreshData(); }
public static string GetDescription(this ECategoryType type) { switch (type) { case ECategoryType.Hot: return("热销"); case ECategoryType.recommend: return("推荐"); case ECategoryType.New: return("新品"); case ECategoryType.Create: return("自建"); default: return(""); } }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public override List <string> GetCategoryNames(ECategoryType type) { var categories = new List <string> { "PIANO", "E.PIANO", "ORGAN", "BELL", "STRINGS", "BRASS", "SYNTH", "LEAD", "SYNTH PAD", "GUITAR", "BASS", "DRUM/SFX", "USER" }; return(categories); }
/// <summary> /// enum으로 바꾸기 /// </summary> /// <param name="category"></param> public void SetCategory(ECategoryType eCategoryType) { switch (eCategoryType) { case ECategoryType.equipmentCategory: equipmentCategoryPanel.SetActive(true); potionCategoryPanel.SetActive(false); crystalAndGoldCategoryPanel.SetActive(false); equipmentCategoryButtonImage.color = Color.green; potionCategoryButtonImage.color = Color.white; crystalAndGoldCategoryButtonImage.color = Color.white; break; case ECategoryType.crystalAndGoldCategory: crystalAndGoldCategoryPanel.SetActive(true); equipmentCategoryPanel.SetActive(false); potionCategoryPanel.SetActive(false); equipmentCategoryButtonImage.color = Color.white; potionCategoryButtonImage.color = Color.white; crystalAndGoldCategoryButtonImage.color = Color.green; break; case ECategoryType.potionCategory: potionCategoryPanel.SetActive(true); equipmentCategoryPanel.SetActive(false); crystalAndGoldCategoryPanel.SetActive(false); equipmentCategoryButtonImage.color = Color.white; potionCategoryButtonImage.color = Color.green; crystalAndGoldCategoryButtonImage.color = Color.white; break; default: Debug.Assert(false, "카테고리 타입이 다름"); break; } }
public MerchantByCategoryTask(ECategoryType categoryType) { this.categoryType = categoryType; }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <param name="name"></param> public override void SetCategoryName(ECategoryType type, int index, string name) { throw new NotSupportedException("Unsupported categories"); //Util.SetChars(_pcgMemory, _pcgMemory.Content, CalcCategoryNameOffset(type, index), CategoryNameLength, name); }
// ReSharper once UnusedMember.Global /// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="index"></param> /// <param name="name"></param> /// <param name="subIndex"></param> public virtual void SetSubCategoryName(ECategoryType type, int index, string name, int subIndex) { Util.SetChars( PcgMemory, PcgMemory.Content, CalcSubCategoryNameOffset(type, index, subIndex), CategoryNameLength, name); }