Exemplo n.º 1
0
        public T Paste()
        {
            bool isCutMode;
            T    value;

            lock (this.syncRoot)
            {
                if (this.container == null)
                {
                    return(default(T));
                }
                value     = this.container.Value;
                isCutMode = this.container.Mode == ClipMode.Cut;
                if (isCutMode)
                {
                    this.container = null;
                }
            }

            if (isCutMode)
            {
                this.ContentChanged.BeginFire(this, new ChangingEventArgs <T>(value, default(T)));
            }

            return(value);
        }
Exemplo n.º 2
0
        private void SetValue(ClipMode mode, T item)
        {
            var @new = new ClipboardValueContainer(item, mode);
            var old  = Interlocked.Exchange(ref this.container, @new);

            this.ContentChanged.BeginFire(this, new ChangingEventArgs <T>(old != null ? old.Value : default(T), item));
        }