コード例 #1
0
        /// <summary>
        /// Read file retrun whole file content as a string
        /// </summary>
        /// <param name="currentProperty"></param>
        /// <returns>String with file content</returns>
        public string ReadFile(IToolProperty currentProperty)
        {
            string     input      = string.Empty;
            FileStream fileStream = new FileStream(currentProperty.SourceFile, mode: FileMode.Open);

            using (StreamReader reader = new StreamReader(stream: fileStream))
            {
                input = reader.ReadToEnd();
            }
            return(input);
        }
コード例 #2
0
        /// <summary>
        /// Create a list of IBibItems from raw data as a string
        /// </summary>
        /// <param name="currentProperty">CurrentToolProperties to get specific signs to replace </param>
        /// <param name="line">Raw string with all Bibitems as a string </param>
        /// <returns>IList<IBibItems> </IBibItems></returns>
        public IList <IBibItem> CreateListOfBibItemsFormString(IToolProperty currentProperty, string line)
        {
            var seperatItems = line.Split('@');
            var allItems     = new List <IBibItem>();

            foreach (var singleItem in seperatItems)
            {
                var tempItem = new BibItem();
                tempItem.SetImportentFields(singleItem, currentProperty.ReplacingCharactarsDictionary);
                allItems.Add(tempItem);
            }
            return(allItems);
        }