private void UpdateIsFixed(object sender, PropertyChangedEventArgs e) { Clear(); MultiTagItems.Clear(); if (IsFixed.Value) { foreach (var fm in FixedMeanings) { TagDescription desc = TagDescriptionMap.Instance[ID3.Version.v2_3]; Frame frame = new Frame(desc, fm); FrameDescription.FrameType type = desc[fm].Type; TagModelItem item = TagModelItemFactory.Create(type); item.Frame = frame; MultiTagModelItem mtmi = MultiTagModelItemFactory.Create(type); mtmi.InitFixed(item); MultiTagModelItems.Add(mtmi); } } adapter.UpdateItems(); }
private void AddTagModelItem(TagModelItem tagModelItem) { MultiTagModelItem multiTagModelItem = FindBy(tagModelItem); if (Object.ReferenceEquals(multiTagModelItem, null) && !IsFixed.Value) { multiTagModelItem = MultiTagModelItemFactory.Create(tagModelItem.Frame.Description.Type); multiTagModelItem.BlockUpdates = BlockUpdates; MultiTagModelItems.Add(multiTagModelItem); } if (!Object.ReferenceEquals(multiTagModelItem, null)) { int index = IsFixed.Value ? TagModelList.SelectedModels.IndexOf(tagModelItem.TagModel) : TagModelList.SelectedModels.IndexOfTagModelItemByFrameId(tagModelItem); int clippedIndex = Math.Min(index, multiTagModelItem.Items.Count); if (!multiTagModelItem.Items.Contains(tagModelItem)) { multiTagModelItem.Items.Insert(clippedIndex, tagModelItem); } } tagModelItemToTagModel[tagModelItem] = tagModelItem.TagModel; }
public static IEnumerable <ID3.FrameDescription> PossibleFrameConversions(MultiTagModelItem item) { var frameDescription = item.FirstItem.Frame.Description; var version = item.FirstItem.Frame.DescriptionMap.Version; var tagDescription = ID3.TagDescriptionMap.Instance[version]; foreach (var frameId in tagDescription.FrameIds) { var otherFrameDescription = tagDescription[frameId]; if (otherFrameDescription.FrameId != frameDescription.FrameId && otherFrameDescription.Type == frameDescription.Type) { yield return(otherFrameDescription); } } }
private void RemoveTagModelItem(TagModelItem tagModelItem) { MultiTagModelItem multiItem = FindBy(tagModelItem); if (!Object.ReferenceEquals(multiItem, null)) { multiItem.BlockUpdates = BlockUpdates; if (multiItem.Items.Contains(tagModelItem)) { multiItem.Items.Remove(tagModelItem); tagModelItemToTagModel.Remove(tagModelItem); } if (multiItem.Items.Count == 0 && !IsFixed.Value) { MultiTagModelItems.Remove(multiItem); } } }
public DropTargetProvider(MultiTagModelItem item) { Item = item; }
public static bool CanConvertFrame(MultiTagModelItem item) { return(item.IsClassIdUnique && !Object.ReferenceEquals(item.FirstItem, null) && item.FirstItem.Frame.Description.Type == ID3.FrameDescription.FrameType.Text); }
public ConvertMultiTagModelItemCommand(MultiTagModelItem item, ID3.FrameDescription frameDesc) : base(new Text(item.FirstItem.FrameId + " -> " + frameDesc.FrameId + ": " + frameDesc.Description)) { Item = item; Description = frameDesc; }