internal void InsertComment(ScriptData beforeScript, string comment) { if (beforeScript == null) { comments.Add(comment); return; } if (!scriptComments.ContainsKey(beforeScript)) { comments.Add(comment); return; } int idx = scriptComments[beforeScript]; if (idx == 0) // not assigned yet { comments.Add(comment); return; } comments.Insert(idx, comment); foreach (var pair in scriptComments) { if (pair.Value >= idx) { scriptComments[pair.Key] += 1; } } }
internal void SetComment(ScriptData script, string comment) { if (!scriptComments.ContainsKey(script)) { scriptComments.Add(script, 0); } comments.Add(comment); scriptComments[script] = comments.Count - 1; }
internal void SetComment(ScriptData script, string comment) { if (!scriptComments.ContainsKey(script)) scriptComments.Add(script, 0); comments.Add(comment); scriptComments[script] = comments.Count - 1; }
internal void InsertComment(ScriptData beforeScript, string comment) { if (beforeScript == null) { comments.Add(comment); return; } if (!scriptComments.ContainsKey(beforeScript)) { comments.Add(comment); return; } int idx = scriptComments[beforeScript]; if (idx == 0) { // not assigned yet comments.Add(comment); return; } comments.Insert(idx, comment); foreach (var pair in scriptComments) { if (pair.Value >= idx) scriptComments[pair.Key] += 1; } }