Пример #1
0
        /// <summary>
        /// Citeste si incarca fragmentele de cod
        /// </summary>
        /// <param name="filePath">Locatia fisierului cu fragmente de cod</param>
        /// <returns></returns>
        public bool ParseFile(string filePath)
        {
            _filePath = filePath;
            FragmenteDeCod = new FragmenteDeCodHolder();

            try
            {
                var xmls = new System.Xml.Serialization.XmlSerializer(typeof(FragmenteDeCodHolder));
                var streamReader = new System.IO.StreamReader(filePath, false);
                FragmenteDeCod = (FragmenteDeCodHolder)xmls.Deserialize(streamReader);

                return true;
            }
            catch (Exception e)
            {
                ExceptionsHandler.Instance.AddException(e, Messages.ERROR_LOAD_CODE_SNIPPETS);
                return false;
            }
        }
Пример #2
0
 private FragmenteDeCodHandler()
 {
     FragmenteDeCod = new FragmenteDeCodHolder();
 }