private void OnGetTextButtonClick(NEventArgs args) { NDataObject dataObject = NClipboard.GetDataObject(); object data = dataObject.GetData(NDataFormat.TextFormat); if (data != null) { m_TextBox.Text = (string)data; } }
private void OnGetRTFButtonClick(NEventArgs args) { NDataObject dataObject = NClipboard.GetDataObject(); byte[] data = dataObject.GetRTF(); if (data != null) { m_RichText.LoadFromStream(new MemoryStream(data), new NRtfTextFormat()); } }
private void OnGetRasterButtonClick(NEventArgs args) { // get a data object from the clipboard NDataObject dataObject = NClipboard.GetDataObject(); // try get a raster from the data object object data = dataObject.GetData(NDataFormat.RasterFormat); if (data == null) { return; } // place it inside the image box NRaster raster = (NRaster)data; m_ImageBox.Image = new NImage(raster); m_ImageBox.Visibility = ENVisibility.Visible; }