~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/SmartTagTransactions.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.ComponentModel;
 
6
using System.ComponentModel.Design;
 
7
using System.Windows.Forms;
 
8
 
 
9
namespace ICSharpCode.Reports.Addin.Designer
 
10
{
 
11
        /// <summary>
 
12
        /// Description of SmartTagTransactions.
 
13
        /// </summary>
 
14
        public class SmartTagTransactions
 
15
        {
 
16
                IDesignerHost host;
 
17
                IComponentChangeService changeService;
 
18
                DesignerTransaction transaction;
 
19
                Control ctrl;
 
20
                DesignerActionList actionList;
 
21
                
 
22
                public SmartTagTransactions(string transactionname,DesignerActionList list,Control ctrl)
 
23
                {
 
24
                        
 
25
                        this.actionList = list;
 
26
                        this.ctrl = ctrl;
 
27
                        host = (IDesignerHost)this.actionList.GetService(typeof(IDesignerHost));
 
28
                        this.transaction = host.CreateTransaction(transactionname);
 
29
                        changeService = (IComponentChangeService)this.actionList.GetService(typeof(IComponentChangeService));
 
30
                        changeService.OnComponentChanging(ctrl,null);                                                      
 
31
                }
 
32
                
 
33
                
 
34
                
 
35
                public void Commit ()
 
36
                {
 
37
                        changeService.OnComponentChanged (ctrl,null,null,null);
 
38
                        this.transaction.Commit();
 
39
                        DesignerActionUIService designerActionUISvc = 
 
40
                                (DesignerActionUIService)this.actionList.GetService(typeof(DesignerActionUIService));
 
41
                        designerActionUISvc.Refresh(this.actionList.Component);
 
42
                                                                                    
 
43
                }
 
44
        }
 
45
}