public ReplacingAllowedPrefixCharsScopePoint(ITemplateScopePoint innerScopePoint, IDocument document, int caretOffset, char[] allowedPrefixChars)
            : base(innerScopePoint)
        {
            this.allowedPrefixChars = allowedPrefixChars;

            Prefix = CalcPrefix(document, caretOffset);
        }
        public ReplacingAllowedPrefixCharsScopePoint(ITemplateScopePoint innerScopePoint, DocumentOffset caretOffset, char[] allowedPrefixChars)
            : base(innerScopePoint)
        {
            this.allowedPrefixChars = allowedPrefixChars;

            Prefix = CalcPrefix(caretOffset);
        }
コード例 #3
0
 public override string Present(ITemplateScopePoint point)
 {
     if (point is InUnityShaderLabFile)
     {
         return("Anywhere in Unity ShaderLab file");
     }
     return(base.Present(point));
 }
コード例 #4
0
 public override string Present(ITemplateScopePoint point)
 {
     if (point is InGodotCSharpProject)
     {
         return("In Godot project");
     }
     return(base.Present(point));
 }
        public ReplacingAllowedPrefixCharsScopePoint(ITemplateScopePoint innerScopePoint, IDocument document, int caretOffset, char[] allowedPrefixChars)
            : base(innerScopePoint)
        {
            this.allowedPrefixChars = allowedPrefixChars;

            // ReSharper disable DoNotCallOverridableMethodsInConstructor
            Prefix = CalcPrefix(document, caretOffset);
            // ReSharper restore DoNotCallOverridableMethodsInConstructor
        }
コード例 #6
0
        public ReplacingAllowedPrefixCharsScopePoint(ITemplateScopePoint innerScopePoint, IDocument document, int caretOffset, char[] allowedPrefixChars)
            : base(innerScopePoint)
        {
            this.allowedPrefixChars = allowedPrefixChars;

// ReSharper disable DoNotCallOverridableMethodsInConstructor
            Prefix = CalcPrefix(document, caretOffset);
// ReSharper restore DoNotCallOverridableMethodsInConstructor
        }
コード例 #7
0
 public override string Present(ITemplateScopePoint point)
 {
     if (point is MustBeInUnityType)
     {
         return("In Unity type where type members are allowed");
     }
     if (point is InUnityShaderLabFile)
     {
         return("Anywhere in Unity ShaderLab file");
     }
     return(base.Present(point));
 }
コード例 #8
0
        // The real scope point is called, and passed in the allowed scope point from the template definition
        public override bool IsSubsetOf(ITemplateScopePoint allowed)
        {
            if (!base.IsSubsetOf(allowed))
            {
                return(false);
            }

            if (allowed is MustBeInProjectWithUnityVersion allowedScopePoint)
            {
                var allowedVersion = allowedScopePoint.myActualVersion;
                return(allowedVersion <= myActualVersion);
            }

            return(true);
        }
コード例 #9
0
 public override string Present(ITemplateScopePoint point)
 {
     if (point is IsAvailableForClassAttribute)
     {
         return("In C# file where class attribute is available");
     }
     if (point is InUnityCSharpProject)
     {
         return("In Unity project");
     }
     if (point is MustBeInUnityType)
     {
         return("In Unity type where type members are allowed");
     }
     if (point is InUnityShaderLabFile)
     {
         return("In Unity ShaderLab file");
     }
     return(base.Present(point));
 }
コード例 #10
0
        public override string Present(ITemplateScopePoint point)
        {
            switch (point)
            {
            case InUnityCSharpProject _:
                return("In Unity project");

            case MustBeInUnityCSharpFile _:
                return("In Unity C# file");

            case MustBeInUnityType _:
                return("In Unity type where type members are allowed");

            case MustBeInUnitySerializableType _:
                return("In Unity serializable type where type members are allowed");

            case InUnityShaderLabFile _:
                return("In Unity ShaderLab file");

            default:
                return(base.Present(point));
            }
        }
コード例 #11
0
 public virtual bool IsSubsetOf(ITemplateScopePoint other)
 {
     return(innerScopePoint.IsSubsetOf(other));
 }
コード例 #12
0
 protected DelegatingScopePoint(ITemplateScopePoint innerScopePoint)
 {
     this.innerScopePoint = innerScopePoint;
 }
コード例 #13
0
 public bool IsSubsetOf(ITemplateScopePoint other)
 {
     return innerScopePoint.IsSubsetOf(other);
 }
コード例 #14
0
        public DelegatingScopePoint(ITemplateScopePoint innerScopePoint, IDocument document, int caretOffset)
        {
            this.innerScopePoint = innerScopePoint;

            Prefix = CalcPrefix(document, caretOffset);
        }
コード例 #15
0
 protected DelegatingScopePoint(ITemplateScopePoint innerScopePoint)
 {
     this.innerScopePoint = innerScopePoint;
 }
コード例 #16
0
        public DelegatingScopePoint(ITemplateScopePoint innerScopePoint, IDocument document, int caretOffset)
        {
            this.innerScopePoint = innerScopePoint;

            Prefix = CalcPrefix(document, caretOffset);
        }