/// <summary> /// Initializes a new instance of the <see cref="ResourceLanguage" /> class. /// </summary> /// <param name="container">The containing resource entity.</param> /// <param name="cultureKey">The culture key.</param> /// <param name="file">The .resx file having all the localization.</param> /// <exception cref="System.InvalidOperationException"> /// </exception> internal ResourceLanguage([NotNull] ResourceEntity container, [NotNull] CultureKey cultureKey, [NotNull] ProjectFile file) { Container = container; CultureKey = cultureKey; ProjectFile = file; _configuration = container.Container.Configuration; try { _document = file.Load(); } catch (XmlException ex) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidResourceFileError, file.FilePath), ex); } if (DocumentRoot == null) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidResourceFileError, file.FilePath)); } var defaultNamespace = DocumentRoot.GetDefaultNamespace(); _dataNodeName = defaultNamespace.GetName(@"data"); _valueNodeName = defaultNamespace.GetName(@"value"); _commentNodeName = defaultNamespace.GetName(@"comment"); UpdateNodes(); }
public bool IncludeFile(ProjectFile file) { return(_fileExclusionFilter?.IsMatch(file.RelativeFilePath) != true); }
public bool IsSourceFile(ProjectFile file) { return(_extensions.Contains(file.Extension, StringComparer.OrdinalIgnoreCase)); }
private void OnChanged() { ProjectFile.Changed(_document); Container.Container.OnLanguageChanged(this); }
public ProjectFileEventArgs([NotNull] ResourceLanguage language, [NotNull] ProjectFile projectFile) { Language = language; ProjectFile = projectFile; }
internal CodeReference([NotNull] ProjectFile projectFile, int lineNumber, [NotNull][ItemNotNull] IList <string> lineSegments) { ProjectFile = projectFile; LineNumber = lineNumber; LineSegments = lineSegments; }