Пример #1
0
        public void RestoreState(object[] data)
        {
            if (data == null)
            {
                return;
            }

            groupCopy      = new Stetic.Wrapper.ActionGroup();
            groupCopy.Name = (string)data [0];

            XmlDocument doc = new XmlDocument();

            doc.LoadXml((string)data [2]);

            // Create the map which links edited action with source actions
            actionCopyMap.Clear();
            foreach (DictionaryEntry e in (Hashtable)data [1])
            {
                Wrapper.Action dupaction = groupCopy.GetAction((string)e.Key);
                Wrapper.Action action    = group.GetAction((string)e.Value);
                actionCopyMap [dupaction] = action;
            }

            groupCopy.SignalAdded   += new Stetic.SignalEventHandler(OnSignalAdded);
            groupCopy.SignalChanged += new Stetic.SignalChangedEventHandler(OnSignalChanged);
        }
Пример #2
0
 void OnProjectReloaded(object s, EventArgs a)
 {
     // Called when the underlying project has changed. Object references need to be updated.
     if (autoCommitChanges)
     {
         if (designer != null)
         {
             if (groupToEdit != null)
             {
                 groupToolbar.ActiveGroup = project.ActionGroups [groupToEdit];
             }
             else
             {
                 Stetic.Wrapper.Container container = project.GetTopLevelWrapper(containerName, true);
                 groupToolbar.ActionGroups = container.LocalActionGroups;
             }
         }
     }
     else
     {
         // We only need to remap the actions
         group = project.ActionGroups [groupToEdit];
         actionCopyMap.Clear();
         foreach (Wrapper.Action dupac in groupCopy.Actions)
         {
             Wrapper.Action ac = group.GetAction(dupac.Name);
             if (ac != null)
             {
                 actionCopyMap [dupac] = ac;
             }
         }
     }
 }
Пример #3
0
		public void RestoreState (object[] data)
		{
			if (data == null)
				return;
			
			groupCopy = new Stetic.Wrapper.ActionGroup ();
			groupCopy.Name = (string) data [0];
			
			XmlDocument doc = new XmlDocument ();
			doc.LoadXml ((string) data [2]);
			
			// Create the map which links edited action with source actions
			actionCopyMap.Clear ();
			foreach (DictionaryEntry e in (Hashtable) data [1]) {
				Wrapper.Action dupaction = groupCopy.GetAction ((string)e.Key);
				Wrapper.Action action = group.GetAction ((string)e.Value);
				actionCopyMap [dupaction] = action;
			}
			
			groupCopy.SignalAdded += new Stetic.SignalEventHandler (OnSignalAdded);
			groupCopy.SignalChanged += new Stetic.SignalChangedEventHandler (OnSignalChanged);
		}
Пример #4
0
		void OnProjectReloaded (object s, EventArgs a)
		{
			// Called when the underlying project has changed. Object references need to be updated.
			if (autoCommitChanges) {
				if (designer != null) {
					if (groupToEdit != null) {
						groupToolbar.ActiveGroup = project.ActionGroups [groupToEdit];
					} else {
						Stetic.Wrapper.Container container = project.GetTopLevelWrapper (containerName, true);
						groupToolbar.ActionGroups = container.LocalActionGroups;
					}
				}
			} else {
				// We only need to remap the actions
				group = project.ActionGroups [groupToEdit];
				actionCopyMap.Clear ();
				foreach (Wrapper.Action dupac in groupCopy.Actions) {
					Wrapper.Action ac = group.GetAction (dupac.Name);
					if (ac != null)
						actionCopyMap [dupac] = ac;
				}
			}
		}