Exemplo n.º 1
0
        internal void NotifyWidgetNameChanged(object obj, string oldName, string newName, bool isRoot)
        {
            WidgetComponent c = obj != null ? (WidgetComponent)App.GetComponent(obj, null, null) : null;

            if (c != null)
            {
                c.UpdateName(newName);
            }

            if (isRoot)
            {
                WidgetInfo wi = GetWidget(oldName);
                if (wi != null)
                {
                    wi.NotifyNameChanged(newName);
                }
            }

            GuiDispatch.InvokeSync(
                delegate {
                if (c != null)
                {
                    if (ComponentNameChanged != null)
                    {
                        ComponentNameChanged(this, new ComponentNameEventArgs(this, c, oldName));
                    }
                }
            }
                );
        }
Exemplo n.º 2
0
        internal void NotifyChanged(string rootWidgetName)
        {
            GuiDispatch.InvokeSync(
                delegate {
                if (Changed != null)
                {
                    Changed(this, EventArgs.Empty);
                }

                // TODO: Optimize
                foreach (ProjectItemInfo it in widgets)
                {
                    if (it.Name == rootWidgetName)
                    {
                        it.NotifyChanged();
                    }
                }
                foreach (ProjectItemInfo it in groups)
                {
                    if (it.Name == rootWidgetName)
                    {
                        it.NotifyChanged();
                    }
                }
            }
                );
        }
Exemplo n.º 3
0
 internal void NotifyComponentTypesChanged()
 {
     GuiDispatch.InvokeSync(delegate {
         if (ComponentTypesChanged != null)
         {
             ComponentTypesChanged(this, EventArgs.Empty);
         }
     });
 }
Exemplo n.º 4
0
 internal void NotifyProjectReloading()
 {
     GuiDispatch.InvokeSync(delegate {
         if (ProjectReloading != null)
         {
             ProjectReloading(this, EventArgs.Empty);
         }
     });
 }
Exemplo n.º 5
0
 public void NotifyRootWidgetChanging()
 {
     GuiDispatch.InvokeSync(
         delegate { if (!disposed)
                    {
                        designer.NotifyRootWidgetChanging();
                    }
         }
         );
 }
Exemplo n.º 6
0
 internal void NotifySelectionChanged(object ob, bool canCut, bool canCopy, bool canPaste, bool canDelete)
 {
     GuiDispatch.InvokeSync(
         delegate { if (!disposed)
                    {
                        designer.NotifySelectionChanged(ob, canCut, canCopy, canPaste, canDelete);
                    }
         }
         );
 }
Exemplo n.º 7
0
 public void NotifyChanged()
 {
     GuiDispatch.InvokeSync(
         delegate { if (!disposed)
                    {
                        designer.NotifyChanged();
                    }
         }
         );
 }
Exemplo n.º 8
0
 internal void NotifyModifiedChanged()
 {
     GuiDispatch.InvokeSync(
         delegate {
         if (ModifiedChanged != null)
         {
             ModifiedChanged(this, EventArgs.Empty);
         }
     }
         );
 }
Exemplo n.º 9
0
 internal void NotifySignalChanged(object obj, string name, Signal oldSignal, Signal signal)
 {
     GuiDispatch.InvokeSync(delegate {
         if (SignalChanged != null)
         {
             Component c = App.GetComponent(obj, name, null);
             if (c != null)
             {
                 SignalChanged(this, new ComponentSignalEventArgs(this, c, oldSignal, signal));
             }
         }
     });
 }
Exemplo n.º 10
0
 internal void NotifyActionGroupRemoved(string group)
 {
     GuiDispatch.InvokeSync(delegate {
         ActionGroupInfo gi = GetActionGroup(group);
         if (gi != null)
         {
             groups.Remove(gi);
             if (ActionGroupsChanged != null)
             {
                 ActionGroupsChanged(this, EventArgs.Empty);
             }
         }
     });
 }
Exemplo n.º 11
0
 internal string ImportFile(string filePath)
 {
     if (importFileDelegate != null)
     {
         string res = null;
         GuiDispatch.InvokeSync(delegate {
             res = importFileDelegate(filePath);
         });
         return(res);
     }
     else
     {
         return(filePath);
     }
 }
Exemplo n.º 12
0
 internal void NotifyActionGroupAdded(string group)
 {
     GuiDispatch.InvokeSync(delegate {
         ActionGroupInfo gi = GetActionGroup(group);
         if (gi == null)
         {
             gi = new ActionGroupInfo(this, group);
             groups.Add(gi);
         }
         if (ActionGroupsChanged != null)
         {
             ActionGroupsChanged(this, EventArgs.Empty);
         }
     });
 }
Exemplo n.º 13
0
 internal void NotifyWidgetRemoved(string name)
 {
     GuiDispatch.InvokeSync(
         delegate {
         WidgetInfo wi = GetWidget(name);
         if (wi != null)
         {
             widgets.Remove(wi);
             if (WidgetRemoved != null)
             {
                 WidgetRemoved(this, new WidgetInfoEventArgs(this, wi));
             }
         }
     }
         );
 }
Exemplo n.º 14
0
 internal void NotifyWidgetAdded(object obj, string name, string typeName)
 {
     GuiDispatch.InvokeSync(
         delegate {
         Component c = App.GetComponent(obj, name, typeName);
         if (c != null)
         {
             WidgetInfo wi = GetWidget(c.Name);
             if (wi == null)
             {
                 wi = new WidgetInfo(this, c);
                 widgets.Add(wi);
             }
             if (WidgetAdded != null)
             {
                 WidgetAdded(this, new WidgetInfoEventArgs(this, wi));
             }
         }
     }
         );
 }