private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if ((this._executingUnit == null) && (this.CurrentUnit != null))
     {
         PopUnitReason reason = e.TransactionCommitted ? PopUnitReason.TransactionCommit : PopUnitReason.TransactionCancel;
         this.CheckPopUnit(reason);
     }
 }
Esempio n. 2
0
 /// <summary>
 ///  Called by the designer host when it is entering or leaving a batch operation.  Here we queue up selection notification and we turn off our UI.
 /// </summary>
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction)
     {
         _state[s_stateTransaction] = false;
         FlushSelectionChanges();
     }
 }
 private void DesignerTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction && (this.relatedComponentTransaction != null))
     {
         this.inTransaction = false;
         IDesignerHost service = this.serviceProvider.GetService(typeof(IDesignerHost)) as IDesignerHost;
         service.TransactionClosed -= new DesignerTransactionCloseEventHandler(this.DesignerTransactionClosed);
         this.RecreateInternal(this.relatedComponentTransaction);
         this.relatedComponentTransaction = null;
     }
 }
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction)
     {
         this._inTransaction = false;
         if (this._deferredSelChange)
         {
             this._deferredSelChange = false;
             this.OnSelectionChanged(this, EventArgs.Empty);
         }
     }
 }
Esempio n. 5
0
        private void ShowDesignerActionUI(object sender, DesignerTransactionCloseEventArgs e)
        {
            DesignerActionUIService service = (DesignerActionUIService)this.GetService(typeof(DesignerActionUIService));

            if (service != null)
            {
                service.ShowUI(this.Component);
            }
            IDesignerHost host = (IDesignerHost)this.GetService(typeof(IDesignerHost));

            if (host != null)
            {
                host.TransactionClosed -= new DesignerTransactionCloseEventHandler(this.ShowDesignerActionUI);
            }
        }
 protected override void OnCommit()
 {
     if (this.host != null)
     {
         Debug.Assert(this.host.TransactionDescriptions != null, "End batch operation with no desription?!?");
         string s = (string) this.host.TransactionDescriptions.Pop();
         if (--this.host.TransactionCount == 0)
         {
             DesignerTransactionCloseEventArgs dtc = new DesignerTransactionCloseEventArgs(true);
             this.host.OnTransactionClosing(dtc);
             this.host.OnTransactionClosed(dtc);
         }
         this.host = null;
     }
 }
Esempio n. 7
0
		private void OnTransactionClosed (object sender, DesignerTransactionCloseEventArgs args)
		{
			// Console.WriteLine ("TransactionClosed: Commited: " + args.TransactionCommitted.ToString ());
			IDesignerHost host = GetRequiredService (typeof (IDesignerHost)) as IDesignerHost;
			if (!host.InTransaction) { // the "top-most"/last transaction was closed (currentUnit one)
				_currentUnit.Close ();
				if (args.TransactionCommitted) {
					AddUndoUnit (_currentUnit);
				} else {
					_currentUnit.Undo ();
					DiscardUndoUnit (_currentUnit);
				}
				_currentUnit = null;
			}
		}
        protected override void OnCancel() {
            if (host != null) {
                Debug.Assert(host.TransactionDescriptions != null, "End batch operation with no desription?!?");
                string s =  (string)host.TransactionDescriptions.Pop();

				// If this is the last transaction to be closed, have the host raise
				// closing/closed events.
				//
                if (--host.TransactionCount == 0) {
                    DesignerTransactionCloseEventArgs dtc = new DesignerTransactionCloseEventArgs(false);
                    host.OnTransactionClosing(dtc);
                    host.OnTransactionClosed(dtc);
                }
                host = null;
            }
        }
        /// <summary>
        ///  Called by the designer host when it is entering or leaving a batch
        ///  operation.  Here we queue up selection notification and we turn off
        ///  our UI.
        /// </summary>
        private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
        {
            if (!e.LastTransaction)
            {
                return;
            }

            _inTransaction = false;
            if (!_deferredSelChange)
            {
                return;
            }

            _deferredSelChange = false;
            OnSelectionChanged(this, EventArgs.Empty);
        }
Esempio n. 10
0
 internal void OnTransactionClosing(DesignerTransactionCloseEventArgs e) {
     if (TransactionClosing != null)
         TransactionClosing(this, e);
 }
		void TransactionClose(object sender, DesignerTransactionCloseEventArgs e)
		{
			if (shouldUpdateSelectableObjects) {
				// update the property pad after the transaction is *really* finished
				// (including updating the selection)
				this.Control.BeginInvoke(new MethodInvoker(UpdatePropertyPad));
				shouldUpdateSelectableObjects = false;
			}
		}
 internal void OnTransactionClosed(DesignerTransactionCloseEventArgs e)
 {
     if (this.TransactionClosed != null)
     {
         this.TransactionClosed(this, e);
     }
 }
Esempio n. 13
0
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e) {
     if (e.LastTransaction) {
         // We should not refresh the grid if the selectedObject is no longer sited.
         IComponent currentSelection = SelectedObject as IComponent;
         if (currentSelection != null)
         {
             if (currentSelection.Site == null) //The component is not logically sited...so clear the PropertyGrid Selection..
             {
                 //Setting to null... actually will clear off the state information so that ProperyGrid is in sane State.
                 this.SelectedObject = null;
                 return;
             }
         }
         SetFlag(BatchMode, false);
         if (GetFlag(FullRefreshAfterBatch)) {
             this.SelectedObjects = currentObjects;
             SetFlag(FullRefreshAfterBatch, false);
         }
         else if (GetFlag(BatchModeChange)){
             Refresh(false);
         }
         SetFlag(BatchModeChange, false);
     }
 }
 protected override void OnCommit()
 {
     if (this._host != null)
     {
         if (this._host._transactions.Peek() != this)
         {
             string description = ((DesignerTransaction) this._host._transactions.Peek()).Description;
             throw new InvalidOperationException(System.Design.SR.GetString("DesignerHostNestedTransaction", new object[] { base.Description, description }));
         }
         this._host.IsClosingTransaction = true;
         try
         {
             this._host._transactions.Pop();
             DesignerTransactionCloseEventArgs e = new DesignerTransactionCloseEventArgs(true, this._host._transactions.Count == 0);
             this._host.OnTransactionClosing(e);
             this._host.OnTransactionClosed(e);
         }
         finally
         {
             this._host.IsClosingTransaction = false;
             this._host = null;
         }
     }
 }
Esempio n. 15
0
 protected override void OnCommit()
 {
     if (this._host != null)
     {
         string text1 = (string) this._host._transactionStack.Pop();
         if (this._host._transactionStack.Count == 0)
         {
             DesignerTransactionCloseEventArgs e = new DesignerTransactionCloseEventArgs(true);
             this._host.OnTransactionClosing(e);
             this._host.OnTransactionClosed(e);
         }
         this._host = null;
     }
 }
		void TransactionClose(object sender, DesignerTransactionCloseEventArgs e)
		{
			if (shouldUpdateSelectableObjects) {
				// update the property pad after the transaction is *really* finished
				// (including updating the selection)
				SD.MainThread.InvokeAsyncAndForget(UpdatePropertyPad);
				shouldUpdateSelectableObjects = false;
			}
		}
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction && this.NeedRefresh)
     {
         this.Refresh();
     }
 }
 private void ShowDesignerActionUI(object sender, DesignerTransactionCloseEventArgs e)
 {
     DesignerActionUIService service = (DesignerActionUIService) this.GetService(typeof(DesignerActionUIService));
     if (service != null)
     {
         service.ShowUI(this.Component);
     }
     IDesignerHost host = (IDesignerHost) this.GetService(typeof(IDesignerHost));
     if (host != null)
     {
         host.TransactionClosed -= new DesignerTransactionCloseEventHandler(this.ShowDesignerActionUI);
     }
 }
		protected virtual void OnTransactionClosing(DesignerTransactionCloseEventArgs e)
		{
			if (TransactionClosing != null) {
				TransactionClosing(this, e);
			}
		}
 private void OnTransactionClosing(object sender, DesignerTransactionCloseEventArgs e)
 {
     ISelectionService service = this.GetService(typeof(ISelectionService)) as ISelectionService;
     if ((service != null) && (this.Table != null))
     {
         ICollection selectedComponents = service.GetSelectedComponents();
         bool flag = false;
         foreach (object obj2 in selectedComponents)
         {
             Control control = obj2 as Control;
             if ((control != null) && (control.Parent == this.Table))
             {
                 flag = true;
                 break;
             }
         }
         if (service.GetComponentSelected(this.Table) || flag)
         {
             this.Table.SuspendLayout();
             this.EnsureAvailableStyles();
             this.Table.ResumeLayout(false);
             this.Table.PerformLayout();
         }
     }
 }
 ///     Called by the designer host when it is entering or leaving a batch
 ///     operation.  Here we queue up selection notification and we turn off
 ///     our UI.
 private void DesignerHost_TransactionClosed(object sender, DesignerTransactionCloseEventArgs e) {
     batchMode = false;
     FlushSelectionChanges();
 }
 private void InvalidateGlyphOnLastTransaction(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction)
     {
         IDesignerHost host = (this.serviceProvider != null) ? (this.serviceProvider.GetService(typeof(IDesignerHost)) as IDesignerHost) : null;
         if (host != null)
         {
             host.TransactionClosed -= new DesignerTransactionCloseEventHandler(this.InvalidateGlyphOnLastTransaction);
         }
         if (this.relatedGlyphTransaction != null)
         {
             this.relatedGlyphTransaction.InvalidateOwnerLocation();
         }
         this.relatedGlyphTransaction = null;
     }
 }
Esempio n. 23
0
 protected virtual void OnTransactionClosing(DesignerTransactionCloseEventArgs e)
 {
     DesignerTransactionCloseEventHandler handler = (DesignerTransactionCloseEventHandler) this.Events[TransactionClosingEvent];
     if (handler != null)
     {
         handler(this, e);
     }
 }
Esempio n. 24
0
		void TransactionClose(object sender, DesignerTransactionCloseEventArgs e)
		{
			if (shouldUpdateSelectableObjects) {
				// update the property pad after the transaction is *really* finished
				// (including updating the selection)
				//roman//WorkbenchSingleton.SafeThreadAsyncCall(UpdatePropertyPad);
				VisualPascalABC.VisualPABCSingleton.MainForm.BeginInvoke((Action)UpdatePropertyPad, new object[0]);//roman//
			    shouldUpdateSelectableObjects = false;
			}
            VisualPascalABC.VisualPABCSingleton.MainForm.UpdateUndoRedoEnabled();
		}
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction)
     {
         IComponent selectedObject = this.SelectedObject as IComponent;
         if ((selectedObject != null) && (selectedObject.Site == null))
         {
             this.SelectedObject = null;
         }
         else
         {
             this.SetFlag(0x10, false);
             if (this.GetFlag(0x80))
             {
                 this.SelectedObjects = this.currentObjects;
                 this.SetFlag(0x80, false);
             }
             else if (this.GetFlag(0x100))
             {
                 this.Refresh(false);
             }
             this.SetFlag(0x100, false);
         }
     }
 }
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if ((this._executingUnit == null) && (this.CurrentUnit != null))
     {
         PopUnitReason reason = e.TransactionCommitted ? PopUnitReason.TransactionCommit : PopUnitReason.TransactionCancel;
         this.CheckPopUnit(reason);
     }
 }
 private void OnTransactionClosing(DesignerTransactionCloseEventArgs e)
 {
     DesignerTransactionCloseEventHandler handler = this._events[EventTransactionClosing] as DesignerTransactionCloseEventHandler;
     if (handler != null)
     {
         handler(this, e);
     }
 }
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction)
     {
         this.batchMode = false;
         if (this.batchChanged)
         {
             this.batchChanged = false;
             ((ISelectionUIService) this).SyncSelection();
         }
         if (this.batchSync)
         {
             this.batchSync = false;
             ((ISelectionUIService) this).SyncComponent(null);
         }
     }
 }
 internal void OnTransactionClosing(bool commit)
 {
     if (TransactionClosing != null)
     {
         DesignerTransactionCloseEventArgs e = new DesignerTransactionCloseEventArgs(commit);
         try
         {
             TransactionClosing(this,e);
         }
         catch{}
     }
 }
Esempio n. 30
0
		public void this_OnTransactionClosed (object o, DesignerTransactionCloseEventArgs args)
		{
			if (args.TransactionCommitted && this.activated) {
				System.Threading.Thread serializerThread = new System.Threading.Thread (new System.Threading.ThreadStart(SerializeDocument));
				serializerThread.Start ();
			}
		}
Esempio n. 31
0
		void TransactionClose(object sender, DesignerTransactionCloseEventArgs e)
		{
			if (shouldUpdateSelectableObjects) {
				// update the property pad after the transaction is *really* finished
				// (including updating the selection)
//				WorkbenchSingleton.SafeThreadAsyncCall(UpdatePropertyPad);
				shouldUpdateSelectableObjects = false;
			}
		}
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// designertransactioncloseeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this DesignerTransactionCloseEventHandler designertransactioncloseeventhandler, Object sender, DesignerTransactionCloseEventArgs e, AsyncCallback callback)
        {
            if(designertransactioncloseeventhandler == null) throw new ArgumentNullException("designertransactioncloseeventhandler");

            return designertransactioncloseeventhandler.BeginInvoke(sender, e, callback, null);
        }
Esempio n. 33
0
		private void OnTransactionClosed (object sender, DesignerTransactionCloseEventArgs args)
		{
			// Console.WriteLine ("TransactionClosed: Commited: " + args.TransactionCommitted.ToString ());
			IDesignerHost host = GetRequiredService (typeof (IDesignerHost)) as IDesignerHost;
			if (!host.InTransaction) { // the "top-most"/last transaction was closed (currentUnit one)
				_currentUnit.Close ();
				if (args.TransactionCommitted) {
					AddUndoUnit (_currentUnit);
				} else {
					_currentUnit.Undo ();
					DiscardUndoUnit (_currentUnit);
				}
				_currentUnit = null;
			}
		}
 private void OnTransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
 {
     if (e.LastTransaction)
     {
         this._inTransaction = false;
         if (this._deferredSelChange)
         {
             this._deferredSelChange = false;
             this.OnSelectionChanged(this, EventArgs.Empty);
         }
     }
 }