//Make handlers for scheduler from profiles private Handler.IHandler[] MakeHandlers(JSONProfile profile) { Handler.IHandler[] handlers = new Handler.IHandler[GlobalSetting.KeyMaxNumber]; for (int i = 0; i < handlers.Length; i++) { handlers[i] = ModeFactory.Get(profile.jSONModes[i].Name).CreateHanlder(profile.jSONModes[i].Set); } return(handlers); }
public bool AddNewProfile(string name) { var profile = new JSONProfile(); profile.Check(); profile.Name = name; Array.Resize(ref cc.profileContainer.jSONProfiles, cc.profileContainer.jSONProfiles.Length + 1); cc.profileContainer.jSONProfiles[cc.profileContainer.jSONProfiles.Length - 1] = profile; if (!cc.profileContainer.Save()) { Array.Resize(ref cc.profileContainer.jSONProfiles, cc.profileContainer.jSONProfiles.Length - 1); return(false); } return(true); }
public void Check() { if (jSONProfiles.Length > GlobalSetting.ProfileMaxNumber) { Array.Resize(ref jSONProfiles, GlobalSetting.ProfileMaxNumber); } for (int i = 0; i < jSONProfiles.Length; i++) { if (jSONProfiles[i] == null) { jSONProfiles[i] = new JSONProfile(); } jSONProfiles[i].Check(); } }
public void Create() { CurrentProfileIndex = 0; jSONProfiles = new JSONProfile[1]; jSONProfiles[0] = new JSONProfile(); }