Beispiel #1
0
 public void AddActiveGUIObject(string path)
 {
     if(mainGuiObject == null)
     {
         mainGuiObject = new ActiveGUIObject();
         mainGuiObject.Active = true;
     }
     if(mainGuiObject !=null)
     {
         mainGuiObject.AddGuiObject(path);
     }
 }
Beispiel #2
0
    public void AddGuiObject(string path,GUIButtonDelegate bdelegate,bool ActivatedOnStart)
    {
        if(ActiveGuiObjects == null)
        {
            ActiveGuiObjects = new List<ActiveGUIObject>();
        }
        if(ActiveGuiObjects !=null)
        {
            Active = ActivatedOnStart;

            if (path.Contains("/"))
            {
                string folder = path.Substring(0, path.IndexOf('/'));
                string cutoff = path.Substring(path.IndexOf('/') + 1);

                foreach (var AGO in ActiveGuiObjects)
                {
                    if (AGO.name.ToLowerInvariant() == folder.ToLowerInvariant())
                    {
                        AGO.AddGuiObject(cutoff, bdelegate,ActivatedOnStart);
                        return;
                    }
                }

                if(AllfatherGuiObject==null){AllfatherGuiObject = this;}
                ActiveGUIObject newAGO = new ActiveGUIObject(folder, AllfatherGuiObject);
                newAGO.AddGuiObject(cutoff, bdelegate, ActivatedOnStart);
                ActiveGuiObjects.Add(newAGO);
            }
            else
            {
                foreach (var AGO in ActiveGuiObjects)
                {
                    if (AGO.name.ToLowerInvariant() == path.ToLowerInvariant())
                    {
                        if (bdelegate != null)
                        {
                            buttonDelegate = bdelegate;
                        }
                        return;
                    }
                }
                if (AllfatherGuiObject == null) { AllfatherGuiObject = this; }
                ActiveGUIObject newAGO = new ActiveGUIObject(path, AllfatherGuiObject);
                newAGO.buttonDelegate = bdelegate;
                newAGO.Active = ActivatedOnStart;
                ActiveGuiObjects.Add(newAGO);
            }
        }
    }
Beispiel #3
0
 public ActiveGUIObject(string n,ActiveGUIObject fatherObject)
 {
     name = n;
     AllfatherGuiObject = fatherObject;
 }