private async void RecoverValues(string entry) { foreach (WorkModel.WorkEntry e in NewBook.Entries) { if (entry == e.Name) { NewEntry = e; break; } } if (NewEntry.ImageChanged) { ImageSource = (StreamImageSource)Xamarin.Forms.ImageSource.FromStream(() => new MemoryStream(NewEntry.NewImageData)); } else { NewEntry.OldImagePath = NewEntry.ImagePath; ImageSource = await FileManager.GetImage(NewEntry.ImagePath); } NewName = NewEntry.Name; Description = NewEntry.Description; foreach (WorkTag t in NewEntry.Tags) { CurrentTags.Add(t); } }
private void OnAddTag() { Tag tag = new Tag(NewTag, NewValue); CurrentTags.Add(tag); NewTag = ""; NewValue = ""; }
private void OnAddTag() { WorkTag tag = new WorkTag(NewTag, NewValue); NewEntry.Tags.Add(tag); CurrentTags.Add(tag); NewTag = ""; NewValue = ""; }
/// <summary> /// Adds the given tag to the list of selected tags, if it is not already added. /// </summary> /// <param name="parameter">The tag to add, as a string.</param> public void AddTag(object parameter) { string tag = parameter as string; if (!CurrentTags.Contains(tag)) { CurrentTags.Add(tag); } }
/// <summary> /// Adds a tag to the current image. /// </summary> /// <param name="tag"></param> void AddTagToImage(Tag tag) { if (CurrentTags.Contains(tag)) { return; } CurrentTags.Add(tag); foreach (var image in _selectedItems) { if (image == SelectedImage) { continue; } _imageTags[image.FilePath].Add(tag); } RegisterTagEvents(tag, true); }
private void Create() { CurrentTags.Clear(); tagDictionary.Clear(); foreach (var device in myDevices.Values) { foreach (var tag in device.Collection.GetAllTags()) { if (tagDictionary.ContainsKey(tag.Name)) { continue; } TagResult aTag = new TagResult(tag); tagDictionary.Add(tag.Name, aTag); tag.TagStatusChanged += Tag_TagStatusChanged; CurrentTags.Add(aTag); } } DeviceCount = myDevices.Count; Status = LiveDataViewModelStatuses.Ready; }
private void Create() { CurrentTags.Clear(); tagDictionary.Clear(); foreach (var device in myDevices.Values) { var readTags = from item in device.Collection.GetAllTags() where item.TagDirection == Kr.Communication.SmartModbusMaster.TagManagement.Types.Direction.Read select item; foreach (var tag in device.Collection.GetAllTags()) { if (tagDictionary.ContainsKey(tag.Name)) { continue; } TagResult aTag = new TagResult(tag); tagDictionary.Add(tag.Name, aTag); tag.TagStatusChanged += Tag_TagStatusChanged; CurrentTags.Add(aTag); } } DeviceCount = myDevices.Count; Status = LiveDataViewModelStatuses.Ready; }