public void AddReference(String loc) { if (String.IsNullOrEmpty(loc)) { return; } String fname = Path.GetFileName(loc); String fnameext = fname + ".dll"; String name = Path.GetFileNameWithoutExtension(loc); if (_refs.ContainsKey(loc)) { return; } if (_refs.ContainsKey(fnameext)) { return; } if (_refs.ContainsKey(fname)) { return; } if (_refs.ContainsKey(name)) { return; } _cp.ReferencedAssemblies.Add(loc); _refs.OptAdd(loc, null); _refs.OptAdd(fnameext, null); _refs.OptAdd(fname, null); _refs.OptAdd(name, null); }
public bool TryReplace(ref String val) { if (String.IsNullOrEmpty(val)) { return(false); } bool replaced = false; for (int i = 0; i < replacers.Count; i++) { if (!replacers[i].TryReplace(ref val)) { continue; } replaced = true; if ((flags & ReplacerFlags.EvaluateAll) == 0) { return(true); } } if (replaced) { return(true); } //Optional administrate missed. if (!String.IsNullOrEmpty(val) && missed != null && missed.Count < maxMissed) { missed.OptAdd(val, null); } return(false); }