public static void Validate(VariableModifiers modifiers, string argumentName)
 {
     if (!IsDefined(modifiers))
     {
         throw FxTrace.Exception.AsError(new InvalidEnumArgumentException(argumentName, (int)modifiers, typeof(VariableModifiers)));
     }
 }
 public static void Validate(VariableModifiers modifiers, string argumentName)
 {
     if (!IsDefined(modifiers))
     {
         throw FxTrace.Exception.AsError(new InvalidEnumArgumentException(argumentName, (int) modifiers, typeof(VariableModifiers)));
     }
 }
 private static bool IsDefined(VariableModifiers modifiers)
 {
     if (modifiers != VariableModifiers.None)
     {
         return ((modifiers & (VariableModifiers.Mapped | VariableModifiers.ReadOnly)) == modifiers);
     }
     return true;
 }
 private static bool IsDefined(VariableModifiers modifiers)
 {
     if (modifiers != VariableModifiers.None)
     {
         return((modifiers & (VariableModifiers.Mapped | VariableModifiers.ReadOnly)) == modifiers);
     }
     return(true);
 }
        public static Variable CreateVariable(string name, Type type, VariableModifiers modifiers)
        {
            Variable variable = (Variable)Activator.CreateInstance(variableGenericType.MakeGenericType(new Type[] { type }));

            variable.Name      = name;
            variable.Modifiers = modifiers;
            return(variable);
        }
Exemplo n.º 6
0
 internal Variable(TypeToken type, string name, VariableModifiers modifiers, CodePoint location, bool generated)
 {
     this.type = type;
     this.name = name;
     this.modifiers = modifiers;
     this.location = location;
     this.generated = generated;
 }
 public VariableGetSetInfo(string name, TypeSpecifier type, bool canGet, bool canSet, VariableModifiers modifiers, TypeSpecifier targetType = null)
 {
     TargetType = targetType;
     Name       = name;
     CanGet     = canGet;
     CanSet     = canSet;
     Type       = type;
     Modifiers  = modifiers;
 }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (parameter is VariableModifiers mask)
            {
                modifiers ^= mask;
                return(modifiers);
            }

            return(VariableModifiers.Private);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is VariableModifiers m && parameter is VariableModifiers mask)
            {
                modifiers = m;
                return((mask & m) != 0);
            }

            return(VariableModifiers.Private);
        }
Exemplo n.º 10
0
 public VariableSpecifier(string name, TypeSpecifier type, MemberVisibility getterVisibility, MemberVisibility setterVisibility,
                          TypeSpecifier declaringType, VariableModifiers modifiers)
 {
     Name             = name;
     Type             = type;
     GetterVisibility = getterVisibility;
     SetterVisibility = setterVisibility;
     DeclaringType    = declaringType;
     Modifiers        = modifiers;
 }
Exemplo n.º 11
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is VariableModifiers m && parameter is VariableModifiers mask)
            {
                modifiers = m;
                return((mask & m) != 0);
            }

            throw new NotImplementedException();
        }
Exemplo n.º 12
0
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (parameter is VariableModifiers mask)
            {
                modifiers ^= mask;
                return(modifiers);
            }

            throw new NotImplementedException();
        }
Exemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the Variable class.
        /// </summary>
        /// <param name="type">
        /// The type of the variable.
        /// </param>
        /// <param name="name">
        /// The name of the variable.
        /// </param>
        /// <param name="modifiers">
        /// Modifiers applied to this variable.
        /// </param>
        /// <param name="location">
        /// The location of the variable.
        /// </param>
        /// <param name="parent">
        /// The parent code part.
        /// </param>
        /// <param name="generated">
        /// Indicates whether the variable is located within a block of generated code.
        /// </param>
        internal Variable(TypeToken type, string name, VariableModifiers modifiers, CodeLocation location, Reference <ICodePart> parent, bool generated)
        {
            Param.Ignore(type);
            Param.AssertValidString(name, "name");
            Param.Ignore(modifiers);
            Param.AssertNotNull(location, "location");
            Param.AssertNotNull(parent, "parent");
            Param.Ignore(generated);

            this.type      = type;
            this.name      = CodeLexer.DecodeEscapedText(name, true);
            this.modifiers = modifiers;
            this.location  = location;
            this.parent    = parent;
            this.generated = generated;
        }
        /// <summary>
        /// Initializes a new instance of the Variable class.
        /// </summary>
        /// <param name="type">
        /// The type of the variable.
        /// </param>
        /// <param name="name">
        /// The name of the variable.
        /// </param>
        /// <param name="modifiers">
        /// Modifiers applied to this variable.
        /// </param>
        /// <param name="location">
        /// The location of the variable.
        /// </param>
        /// <param name="parent">
        /// The parent code part.
        /// </param>
        /// <param name="generated">
        /// Indicates whether the variable is located within a block of generated code.
        /// </param>
        internal Variable(TypeToken type, string name, VariableModifiers modifiers, CodeLocation location, Reference<ICodePart> parent, bool generated)
        {
            Param.Ignore(type);
            Param.AssertValidString(name, "name");
            Param.Ignore(modifiers);
            Param.AssertNotNull(location, "location");
            Param.AssertNotNull(parent, "parent");
            Param.Ignore(generated);

            this.type = type;
            this.name = CodeLexer.DecodeEscapedText(name, true);
            this.modifiers = modifiers;
            this.location = location;
            this.parent = parent;
            this.generated = generated;
        }
Exemplo n.º 15
0
 public VariableSpecifier
 (
     string name,
     TypeSpecifier type,
     MemberVisibility getterVisibility,
     MemberVisibility setterVisibility,
     TypeSpecifier declaringType,
     VariableModifiers modifiers
 )
 {
     this.Name             = name;
     this.Type             = type;
     this.GetterVisibility = getterVisibility;
     this.SetterVisibility = setterVisibility;
     this.DeclaringType    = declaringType;
     this.Modifiers        = modifiers;
 }
Exemplo n.º 16
0
 public VariableLocation(VariableModifiers modifiers, bool isHandle)
     : base()
 {
     _modifiers = modifiers;
     _isHandle  = isHandle;
 }
Exemplo n.º 17
0
 public static Variable Create(string name, Type type, VariableModifiers modifiers)
 {
     return(ActivityUtilities.CreateVariable(name, type, modifiers));
 }
Exemplo n.º 18
0
 public VariableLocation(VariableModifiers modifiers, bool isHandle)
     : base()
 {
     this.modifiers = modifiers;
     this.isHandle  = isHandle;
 }
 public static bool IsMappable(VariableModifiers modifiers)
 {
     return((modifiers & VariableModifiers.Mapped) == VariableModifiers.Mapped);
 }
 public static bool IsReadOnly(VariableModifiers modifiers)
 {
     return((modifiers & VariableModifiers.ReadOnly) == VariableModifiers.ReadOnly);
 }
 private static bool IsDefined(VariableModifiers modifiers)
 {
     return(modifiers == VariableModifiers.None ||
            ((modifiers & (VariableModifiers.Mapped | VariableModifiers.ReadOnly)) == modifiers));
 }
 public static Variable Create(string name, Type type, VariableModifiers modifiers)
 {
     return ActivityUtilities.CreateVariable(name, type, modifiers);
 }
Exemplo n.º 23
0
		public static Variable Create (string name, Type type, VariableModifiers modifiers)
		{
			throw new NotImplementedException ();
		}
Exemplo n.º 24
0
 public static Variable Create(string name, Type type, VariableModifiers modifiers)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 25
0
 static bool IsDefined(VariableModifiers modifiers)
 {
     return (modifiers == VariableModifiers.None ||
         ((modifiers & (VariableModifiers.Mapped | VariableModifiers.ReadOnly)) == modifiers));
 }
Exemplo n.º 26
0
 public static bool IsMappable(VariableModifiers modifiers)
 {
     return (modifiers & VariableModifiers.Mapped) == VariableModifiers.Mapped;
 }
Exemplo n.º 27
0
 public static bool IsReadOnly(VariableModifiers modifiers)
 {
     return (modifiers & VariableModifiers.ReadOnly) == VariableModifiers.ReadOnly;
 }