Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public static void LoadDictionary(StringDict dict, string dictPath, bool ignoreComment = false)
        {
            using var textReader = new StreamReader(dictPath, true);

            foreach (var line in textReader.Lines())
            {
                if (ignoreComment == true && line.StartsWith("#"))
                {
                    continue;
                }
                var tuple = line.Split('=');
                if (tuple.Length == 2 && !dict.ContainsKey(tuple[0]))
                {
                    dict.Add(tuple[0], tuple[1]);
                }
            }
        }
Esempio n. 3
0
        public void AddMissed(String x, bool touched = false)
        {
            if (x == null)
            {
                return;
            }

            x = x.ToLowerInvariant();
            if (dict == null)
            {
                dict = new StringDict <bool>();
                dict.Add(x, touched);
                return;
            }
            if (dict.ContainsKey(x))
            {
                return;
            }
            dict.Add(x, touched);
        }
Esempio n. 4
0
        public void AddFile(String filename)
        {
            String fullName = Path.GetFullPath(filename);

            if (scripts.ContainsKey(fullName))
            {
                return;
            }

            ScriptFileAdmin a = new ScriptFileAdmin(fullName, templateSettings);

            scripts.Add(a.FileName, a);

            foreach (var asm in a.References)
            {
                AddReference(asm);
            }
            foreach (var incl in a.Includes)
            {
                AddFile(incl);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Returns the exists value for the key
 /// </summary>
 public bool Contains(String name)
 {
     return(namedItems.ContainsKey(name));
 }