コード例 #1
0
        public override async Task AddAttributes(AnnotatedCodeBlock block)
        {
            if (Package == null && Project?.FullName != null)
            {
                block.AddAttribute("data-trydotnet-package", Project.FullName);
            }

            var fileName = GetDestinationFileAbsolutePath();

            if (!string.IsNullOrWhiteSpace(fileName))
            {
                block.AddAttribute(
                    "data-trydotnet-file-name",
                    fileName);
            }

            if (ReadOnlyRegionRoundtrip())
            {
                block.AddAttribute("data-trydotnet-injection-point", "replace");
            }

            bool ReadOnlyRegionRoundtrip()
            {
                return(!Editable && !string.IsNullOrWhiteSpace(Region) && SourceFile != null && (DestinationFile == null || SourceFile.Equals(DestinationFile)));
            }

            await base.AddAttributes(block);
        }
コード例 #2
0
ファイル: T4PathWithMacros.cs プロジェクト: larrynung/ForTea
 private bool Equals([NotNull] T4PathWithMacros other) =>
 string.Equals(RawPath, other.RawPath, StringComparison.OrdinalIgnoreCase) &&
 SourceFile.Equals(other.SourceFile);
コード例 #3
0
 protected bool Equals(UnityAssetFindResult other)
 {
     return(SourceFile.Equals(other.SourceFile) && AttachedElement.Equals(other.AttachedElement));
 }
コード例 #4
0
 protected bool Equals(UnityAssetFindResult other)
 {
     return(SourceFile.Equals(other.SourceFile) && OwningElemetLocation.Equals(other.OwningElemetLocation));
 }
コード例 #5
0
 protected bool Equals(UnityAssetOccurrence other)
 {
     return(SourceFile.Equals(other.SourceFile) && AttachedElementLocation.Equals(other.AttachedElementLocation));
 }