Ejemplo n.º 1
0
		public void SetSystem()
		{
			var dataObj = new DataObject();

			dataObj.SetText(Text, TextDataFormat.UnicodeText);
			dataObj.SetData(typeof(NELocalClipboard), PID);

			if (IsCut.HasValue)
			{
				var dropList = new StringCollection();
				dropList.AddRange(Strings.ToArray());
				dataObj.SetFileDropList(dropList);
				dataObj.SetData("Preferred DropEffect", new MemoryStream(BitConverter.GetBytes((int)(IsCut == true ? DragDropEffects.Move : DragDropEffects.Copy | DragDropEffects.Link))));
			}

			if (Image != null)
				dataObj.SetImage(Image);

			Clipboard.SetDataObject(dataObj, true);
		}
Ejemplo n.º 2
0
 public override CopyDataObject Copy(bool removeSelection)
 {
     CopyDataObject temp = base.Copy(removeSelection);
     DataObject data = new DataObject();
     data.SetImage(temp.Image);
     XElement rootElement = new XElement(this.GetType().Name);
     rootElement.Add(new XElement("SessionId", sessionString));
     rootElement.Add(textManager.Serialize());
     rootElement.Add(new XElement("payload", temp.XElement));
     MathEditorData med = new MathEditorData { XmlString = rootElement.ToString() };
     data.SetData(med);
     //data.SetText(GetSelectedText());
     if (temp.Text != null)
     {
         data.SetText(temp.Text);
     }
     Clipboard.SetDataObject(data, true);
     if (removeSelection)
     {
         DeSelect();
         AdjustCarets();
     }
     return temp;
 }