public FormDesignerEventTree(FormHostingContainer container)
 {
     InitializeComponent();
     _container = container;
     _container.ActiveHostingChanged    += new FormHostingContainer.OnActiveHostingChangedHandler(_container_ActiveHostingChanged);
     _container.HostingSelectionChanged += new FormHostingContainer.OnHostingSelectionChangedHandler(_container_HostingSelectionChanged);
     this.Icon    = DrawingTool.ImageToIcon(IconsLibrary.Event);
     this.TabText = Language.Current.FormDesignerEventTree_TabText;
     Unity.ApplyResource(this);
     _eventTreeView.AllowDrop          = true;
     _eventTreeView.AfterSelect       += new TreeViewEventHandler(_eventTreeView_AfterSelect);
     _eventTreeView.EventChanged      += new EventTreeView.OnEventChangedHandler(_eventTreeView_EventChanged);
     _eventTreeView.EventOrderChanged += new EventTreeView.OnEventOrderChangedHandler(_eventTreeView_EventOrderChanged);
     this.Controls.Add(_eventTreeView);
     InitToolStrip();
     this.Controls.Add(_toolStrip.View);
     _toolStrip.View.UpdateStatus();
     _undounitAction = new Action <SEUndoUnitAbstract, SEUndoEngine.Type>(
         delegate(SEUndoUnitAbstract unit, SEUndoEngine.Type type)
     {
         if (unit is SEUndoUnitEventEdit)
         {
             SEUndoUnitEventEdit undoUnit = unit as SEUndoUnitEventEdit;
             if (undoUnit != null && ((EventBase)undoUnit.Value).HostEntity == this._eventTreeView.Entity)
             {
                 _eventTreeView.ReBuild();
             }
         }
         else if (unit is SEUndoTransaction)
         {
             SEUndoTransaction undoUnit = unit as SEUndoTransaction;
             if (undoUnit != null && undoUnit.GetAllUnits().Length > 0)
             {
                 SEUndoUnitEventEdit eventUnit = undoUnit.GetAllUnits()[0] as SEUndoUnitEventEdit;
                 if (eventUnit != null && ((EventBase)eventUnit.Value).HostEntity == this._eventTreeView.Entity)
                 {
                     _eventTreeView.ReBuild();
                 }
             }
         }
     });
 }
Esempio n. 2
0
 public FormDesignerEvents()
 {
     InitializeComponent();
     Unity.ApplyResource(this);
 }