public async Task <ViewImage> GetImageAsync(ViewImage VIimage) { var image = _database.Table <ViewImage>() .Where(i => i.Path == VIimage.Path) .FirstOrDefaultAsync(); return(await image); }
private void barButtonItem16_ItemClick(object sender, ItemClickEventArgs e) { if (!CheckExistForm("ViewImage")) { ViewImage form = new ViewImage(); form.MdiParent = this; form.Show(); } }
/// <summary> /// Create the views of this content. /// </summary> /// <param name="doc">The <see cref="Document"/> object this content is associated with.</param> /// <returns>A <see cref="ViewCollection"/> object containing the views.</returns> public ViewCollection GetContentViews(Document doc) { var views = new ViewCollection(); foreach (Imaging dataSet in this.contentList) { var view = new ViewImage(doc, dataSet, dataSet.Name, dataSet.ExperimentType); views.Add(view); } return(views); }
public void AddImageAsync(ViewImage image) { try { _database.Insert(image); } catch (Exception ex) { StatusMessage = $"Error occurred, image {image} was not saved {ex.Message}"; } }
/// <summary> /// Create the views of this content. /// </summary> /// <param name="doc">The <see cref="Document"/> object this content is associated with.</param> /// <returns>A <see cref="ViewCollection"/> object containing the views.</returns> public ViewCollection GetContentViews(Document doc) { ViewCollection views = new ViewCollection(); foreach (Imaging dataSet in contentList) { ViewImage view = new ViewImage(doc, dataSet, dataSet.Name); ViewImageController viewCtrl = new ViewImageController(doc, view); views.Add(view); } return(views); }
public ActionResult GetSlide() { byte[] image = _imageHolder.GetImage(); Guid guid = _imageHolder.Guid; MemoryStream stream = new MemoryStream(image); string converted = Convert.ToBase64String(stream.ToArray()); ViewImage viewImage = new ViewImage() { Image = converted, Guid = guid }; return(Json(viewImage)); }
public ItemDetailViewModel(ViewImage image) { //IsNewImage = image == null; if (image != null) { VMimage = image; VMimageIDnum = image.IDnum; VMimagePath = image.Path; VMimageResult = image.Result; VMimageVIData = image.VIData; } else { VMimage = new ViewImage(); } }
public async Task SetView(bool switchSort = true) { Properties.Settings.Default.LibraryView = viewPosters; Properties.Settings.Default.Save(); lib.PanelPosters.Opacity = 0; if (viewPosters) { ViewImage.SetResourceReference(Image.SourceProperty, "ListIcon"); await lib.RenderList(); viewPosters = false; } else { ViewImage.SetResourceReference(Image.SourceProperty, "PosterIcon"); await lib.RenderPosters(); viewPosters = true; } SetSort(switchSort); }
void HandleCursorChanged(object sender, EventArgs e) { TreeSelection selection = tree.Selection; TreeModel model; TreeIter iter; Value v; string name, type; object value; View view = null; if (!selection.GetSelected(out model, out iter)) { return; } v = new Value(); store.GetValue(iter, 0, ref v); name = v.Val as string; v = new Value(); store.GetValue(iter, 1, ref v); type = v.Val as string; v = new Value(); store.GetValue(iter, 2, ref v); value = v.Val; // Create a view based on what we got switch (type) { case "System.IO.MemoryStream": MemoryStream stream = value as MemoryStream; if (name.EndsWith(".xaml")) { stream.Position = 0; using (MemoryStream clone = new MemoryStream(stream.ToArray())) { using (StreamReader t = new StreamReader(clone)) { view = new ViewText(t.ReadToEnd()); } } } else if (name.EndsWith(".png") || name.EndsWith(".jpg")) { using (MemoryStream clone = new MemoryStream(stream.ToArray())) { view = new ViewImage(clone); } } else { Console.WriteLine("Don't know what to do with a {0} in a {1}", name, type); } break; case "System.String": if (value != null) { view = new ViewText((string)value); } break; default: Console.WriteLine("Unhandled case: {0}", type); break; } // Remove previous views and add the new one while (box.Children.Length > 1) { box.Remove(box.Children [1]); } if (view != null) { box.PackStart(view.GetView(), true, true, 0); box.ShowAll(); } }
public ActionResult ViewImage(string date, string name, string imagePath, string thumbPath) { viewImage = new ViewImage(date, name, imagePath, thumbPath); return(View(viewImage)); }
public ItemDetailViewModel() { VMimage = new ViewImage(); }
public ItemDetailViewModel(ViewImage image = null) { IsNewImage = image == null; VMimage = image ?? new ViewImage(); }
void HandleCursorChanged (object sender, EventArgs e) { TreeSelection selection = tree.Selection; TreeModel model; TreeIter iter; Value v; string name, type; object value; View view = null; if (!selection.GetSelected (out model, out iter)) return; v = new Value (); store.GetValue (iter, 0, ref v); name = v.Val as string; v = new Value (); store.GetValue (iter, 1, ref v); type = v.Val as string; v = new Value (); store.GetValue (iter, 2, ref v); value = v.Val; // Create a view based on what we got switch (type) { case "System.IO.MemoryStream": MemoryStream stream = value as MemoryStream; if (name.EndsWith (".xaml")) { stream.Position = 0; using (MemoryStream clone = new MemoryStream (stream.ToArray ())) { using (StreamReader t = new StreamReader (clone)) { view = new ViewText (t.ReadToEnd ()); } } } else if (name.EndsWith (".png") || name.EndsWith (".jpg")) { using (MemoryStream clone = new MemoryStream (stream.ToArray ())) { view = new ViewImage (clone); } } else { Console.WriteLine ("Don't know what to do with a {0} in a {1}", name, type); } break; case "System.String": if (value != null) view = new ViewText ((string) value); break; default: Console.WriteLine ("Unhandled case: {0}", type); break; } // Remove previous views and add the new one while (box.Children.Length > 1) box.Remove (box.Children [1]); if (view != null) { box.PackStart (view.GetView (), true, true, 0); box.ShowAll (); } }