Ejemplo n.º 1
0
        /// <summary>
        /// Tries to copy this clip to the clipboard.
        /// </summary>
        /// <returns>True if clipboard was filled.</returns>
        public bool Copy()
        {
            try
            {
                var args = new ClipboardManager.ClipEventArgs();
                args.Clip = this;

                Copied?.Invoke(this, args);

                System.Windows.Clipboard.SetText(Content);
                return(true);
            }
            catch (System.Runtime.InteropServices.ExternalException e)
            {
                Utility.Logging.Log("Failed to set clipboard: " + e.Message);
                return(false);
            }
        }
Ejemplo n.º 2
0
 public static void UpdateSlab()
 {
     while (slabQueue.Count > 0)
     {
         var slabToPaste = slabQueue.Dequeue();
         Debug.Log("Slab:");
         Debug.Log(slabToPaste);
         if (BoardSessionManager.Board.PushStringToTsClipboard(slabToPaste.SlabText) == PushStringToTsClipboardResult.Success)
         {
             Copied mostRecentCopied_LocalOnly = BoardSessionManager.Board.GetMostRecentCopied_LocalOnly();
             if (mostRecentCopied_LocalOnly != null)
             {
                 Debug.Log("X:" + slabToPaste.Position.x + " y:" + slabToPaste.Position.x + " z:" + slabToPaste.Position.z + " Slab: " + slabToPaste.SlabText);
                 BoardSessionManager.Board.PasteCopied(new Vector3(slabToPaste.Position.x, slabToPaste.Position.y, slabToPaste.Position.z), 0, 0UL);
                 //BoardSessionManager.Board.PasteCopied(new Vector3(slabToPaste.Position.x, slabToPaste.Position.y, slabToPaste.Position.z), 0, 0UL);
             }
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Raises the Copied event</summary>
 /// <param name="e">Event args</param>
 protected virtual void OnCopied(EventArgs e)
 {
     Copied.Raise(this, e);
 }