public static uint ConstCodeAdd(string code, bool state) { //int ind = ConstCodes.Count; uint ID = IDCounter; IDCounter++; //Make room for the new ConstCode //Array.Resize(ref ConstCodes, ind + 1); //Set the values ConstCode c = new ConstCode(); c.Codes.codes = code; c.Codes.state = state; //ConstCodes[ind].Codes.codes = code; //ConstCodes[ind].Codes.state = state; c.Codes = ParseCodeString(code, c.Codes); //ConstCodes[ind].Codes = code; c.ID = ID; ConstCodes.Add(c); //If the state is true make sure that ConstantWriting is on if (state) { Form1.ConstantLoop = 1; } //Return the ID return(ID); }
/* * Sets the code with an ID of ID's state to state */ public static void ConstCodeSetState(uint ID, bool state) { for (int ind = 0; ind < ConstCodes.Count; ind++) { if (ConstCodes[ind].ID == ID) { ConstCode c = ConstCodes[ind]; c.Codes.state = state; ConstCodes[ind] = c; if (state) { Form1.ConstantLoop = 1; } break; } } }