/// <summary> /// Dodaje ili modificra argument u listi /// </summary> /// <param name="argName">Naziv argumenta</param> /// <param name="argType">Tip argumenta</param> /// <param name="arg">Objekt argumenta</param> /// <param name="overwrite">Ako argument postoji, overwritati?</param> /// <returns>True ako ej sve u redu, False ako nije</returns> public bool AddArgument(string argName, string argType, Object arg, bool overwrite) { foreach(ArgumentObject argObject in listOfArguments) { if(string.Equals(argObject.Name, argName)) { if (!overwrite) return false; argObject.Argument = arg; argObject.Type = argType; return true; } } ArgumentObject newArgument = new ArgumentObject(argName, argType, arg); listOfArguments.Add(newArgument); return true; }
/// <summary> /// Dodaje ili modificra argument u listi /// </summary> /// <param name="argName">Naziv argumenta</param> /// <param name="argType">Tip argumenta</param> /// <param name="arg">Objekt argumenta</param> /// <param name="overwrite">Ako argument postoji, overwritati?</param> /// <returns>True ako ej sve u redu, False ako nije</returns> public bool AddArgument(string argName, string argType, Object arg, bool overwrite) { foreach (ArgumentObject argObject in listOfArguments) { if (string.Equals(argObject.Name, argName)) { if (!overwrite) { return(false); } argObject.Argument = arg; argObject.Type = argType; return(true); } } ArgumentObject newArgument = new ArgumentObject(argName, argType, arg); listOfArguments.Add(newArgument); return(true); }