public StringValidation(IResourceManager mgr, ICalendarPropertyListContainer obj, IList<string> stringList, string propertyName)
     : base(mgr)
 {
     Container = obj;
     StringList = stringList;
     PropertyName = propertyName;
 }
 public PropertyValuesValidation(IResourceManager mgr, ICalendarPropertyListContainer container, string componentName, string propertyName, List<string> possibleValues)
     : base(mgr)
 {
     Container = container;
     ComponentName = componentName;
     PropertyName = propertyName;
     PossibleValues = possibleValues;
 }
        public PropertyCountValidation(IResourceManager mgr, ICalendarPropertyListContainer container, string componentName, string[] propertyNames, bool missingInsteadOfRequired)
            : base(mgr)
        {
            MissingInsteadOfRequired = missingInsteadOfRequired;

            MinCount = 0;
            MaxCount = 1;

            Container = container;
            ComponentName = componentName;
            PropertyNames = propertyNames;
        }
 public iCalDateTimePropertyValidation(IResourceManager mgr, ICalendarPropertyListContainer obj, string propertyName)
     : base(mgr, obj, propertyName)
 {
 }
Beispiel #5
0
        public ICalendarProperty  property(

            ISerializationContext ctx,
            ICalendarPropertyListContainer c

            ) //throws RecognitionException, TokenStreamException
        {
            ICalendarProperty p = null;;

            IToken n = null;
            IToken m = null;

            string v;


            {
                switch (LA(1))
                {
                case IANA_TOKEN:
                {
                    n = LT(1);
                    match(IANA_TOKEN);

                    p      = new CalendarProperty(n.getLine(), n.getColumn());
                    p.Name = n.getText().ToUpper();

                    break;
                }

                case X_NAME:
                {
                    m = LT(1);
                    match(X_NAME);

                    p      = new CalendarProperty(m.getLine(), m.getColumn());
                    p.Name = m.getText().ToUpper();

                    break;
                }

                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                }
            }

            ISerializationProcessor <ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor <ICalendarProperty>)) as ISerializationProcessor <ICalendarProperty>;

            // Do some pre-processing on the property
            if (processor != null)
            {
                processor.PreDeserialization(p);
            }

            if (c != null)
            {
                // Add the property to the container, as the parent object(s)
                // may be needed during deserialization.
                c.Properties.Add(p);
            }

            // Push the property onto the serialization context stack
            ctx.Push(p);
            IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == SEMICOLON))
                    {
                        match(SEMICOLON);
                        parameter(ctx, p);
                    }
                    else
                    {
                        goto _loop24_breakloop;
                    }
                }
                _loop24_breakloop :;
            }        // ( ... )*
            match(COLON);
            v = value();

            // Deserialize the value of the property
            // into a concrete iCalendar data type,
            // a list of concrete iCalendar data types,
            // or string value.
            object deserialized = dataMapSerializer.Deserialize(new StringReader(v));

            if (deserialized != null)
            {
                // Try to determine if this is was deserialized as a *list*
                // of concrete types.
                Type targetType       = dataMapSerializer.TargetType;
                Type listOfTargetType = typeof(IList <>).MakeGenericType(targetType);
                if (listOfTargetType.IsAssignableFrom(deserialized.GetType()))
                {
                    // We deserialized a list - add each value to the
                    // resulting object.
                    foreach (var item in (IEnumerable)deserialized)
                    {
                        p.AddValue(item);
                    }
                }
                else
                {
                    // We deserialized a single value - add it to the object.
                    p.AddValue(deserialized);
                }
            }

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == CRLF))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        goto _loop26_breakloop;
                    }
                }
                _loop26_breakloop :;
            }        // ( ... )*

            // Do some final processing on the property:
            if (processor != null)
            {
                processor.PostDeserialization(p);
            }

            // Notify that the property has been loaded
            p.OnLoaded();

            // Pop the property off the serialization context stack
            ctx.Pop();

            return(p);
        }
Beispiel #6
0
	public ICalendarProperty  property(
		
	ISerializationContext ctx,	
	ICalendarPropertyListContainer c

	) //throws RecognitionException, TokenStreamException
{
		ICalendarProperty p = null;;
		
		IToken  n = null;
		IToken  m = null;
		
			string v;
		
		
		{
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			{
				n = LT(1);
				match(IANA_TOKEN);
				
						p = new CalendarProperty(n.getLine(), n.getColumn());
						p.Name = n.getText().ToUpper();
					
				break;
			}
			case X_NAME:
			{
				m = LT(1);
				match(X_NAME);
				
						p = new CalendarProperty(m.getLine(), m.getColumn());
						p.Name = m.getText().ToUpper();
					
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		
			ISerializationProcessor<ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor<ICalendarProperty>)) as ISerializationProcessor<ICalendarProperty>;
			// Do some pre-processing on the property
			if (processor != null)
				processor.PreDeserialization(p);
		
			if (c != null)
			{
				// Add the property to the container, as the parent object(s)
				// may be needed during deserialization.
				c.Properties.Add(p);
			}
		
			// Push the property onto the serialization context stack
			ctx.Push(p);
			IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==SEMICOLON))
				{
					match(SEMICOLON);
					parameter(ctx, p);
				}
				else
				{
					goto _loop24_breakloop;
				}
				
			}
_loop24_breakloop:			;
		}    // ( ... )*
		match(COLON);
		v=value();
		
			// Deserialize the value of the property
			// into a concrete iCalendar data type,
			// a list of concrete iCalendar data types,
			// or string value.
			object deserialized = dataMapSerializer.Deserialize(new StringReader(v));
		if (deserialized != null)
		{
				// Try to determine if this is was deserialized as a *list*
				// of concrete types.
		Type targetType = dataMapSerializer.TargetType;
		Type listOfTargetType = typeof(IList<>).MakeGenericType(targetType);
		if (listOfTargetType.IsAssignableFrom(deserialized.GetType()))
		{
					// We deserialized a list - add each value to the
					// resulting object.
		foreach (var item in (IEnumerable)deserialized)
		p.AddValue(item);
		}
		else
		{
					// We deserialized a single value - add it to the object.
		p.AddValue(deserialized);
		}
		}
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==CRLF))
				{
					match(CRLF);
				}
				else
				{
					goto _loop26_breakloop;
				}
				
			}
_loop26_breakloop:			;
		}    // ( ... )*
		
			// Do some final processing on the property:
			if (processor != null)
				processor.PostDeserialization(p);
		
			// Notify that the property has been loaded
			p.OnLoaded();
			
			// Pop the property off the serialization context stack
			ctx.Pop();
		
		return p;
	}
 public PropertyCountValidation(IResourceManager mgr, ICalendarPropertyListContainer container, string componentName, string propertyName, int minOccurrences, int maxOccurrences)
     : this(mgr, container, componentName, propertyName)
 {
     MinCount = minOccurrences;
     MaxCount = maxOccurrences;
 }
 public PropertyCountValidation(IResourceManager mgr, ICalendarPropertyListContainer container, string componentName, string propertyName, bool missingInsteadOfRequired)
     : this(mgr, container, componentName, new string[] { propertyName }, missingInsteadOfRequired)
 {
 }
 public PropertyCountValidation(IResourceManager mgr, ICalendarPropertyListContainer container, string componentName, string propertyName)
     : this(mgr, container, componentName, new string[] { propertyName }, false)
 {
 }
 public PropertyValidation(IResourceManager mgr, ICalendarPropertyListContainer obj, string propertyName)
     : base(mgr)
 {
     Container = obj;
     PropertyName = propertyName;
 }
Beispiel #11
0
	public ICalendarProperty  property(
		
	ISerializationContext ctx,	
	ICalendarPropertyListContainer c

	) //throws RecognitionException, TokenStreamException
{
		ICalendarProperty p = null;;
		
		IToken  n = null;
		IToken  m = null;
		
			string v;
		
		
		{
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			{
				n = LT(1);
				match(IANA_TOKEN);
				
						p = new CalendarProperty(n.getLine(), n.getColumn());
						p.Name = n.getText().ToUpper();
					
				break;
			}
			case X_NAME:
			{
				m = LT(1);
				match(X_NAME);
				
						p = new CalendarProperty(m.getLine(), m.getColumn());
						p.Name = m.getText().ToUpper();
					
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		
			ISerializationProcessor<ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor<ICalendarProperty>)) as ISerializationProcessor<ICalendarProperty>;
			// Do some pre-processing on the property
			if (processor != null)
				processor.PreDeserialization(p);
		
			if (c != null)
			{
				// Add the property to the container, as the parent object(s)
				// may be needed during deserialization.
				c.Properties.Add(p);
			}
		
			// Push the property onto the serialization context stack
			ctx.Push(p);
            IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==SEMICOLON))
				{
					match(SEMICOLON);
					parameter(ctx, p);
				}
				else
				{
					goto _loop24_breakloop;
				}
				
			}
_loop24_breakloop:			;
		}    // ( ... )*
		match(COLON);
		v=value();
		
			// Deserialize the value of the property
			// into a concrete iCalendar data type,
			// or string value.
            p.Value = dataMapSerializer.Deserialize(new StringReader(v));
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==CRLF))
				{
					match(CRLF);
				}
				else
				{
					goto _loop26_breakloop;
				}
				
			}
_loop26_breakloop:			;
		}    // ( ... )*
		
			// Do some final processing on the property:
			if (processor != null)
				processor.PostDeserialization(p);
		
			// Notify that the property has been loaded
			p.OnLoaded();
			
			// Pop the property off the serialization context stack
			ctx.Pop();
		
		return p;
	}
Beispiel #12
0
        public ICalendarProperty  property(

            ISerializationContext ctx,
            ICalendarPropertyListContainer c

            ) //throws RecognitionException, TokenStreamException
        {
            ICalendarProperty p = null;;

            IToken n = null;
            IToken m = null;

            string v;


            {
                switch (LA(1))
                {
                case IANA_TOKEN:
                {
                    n = LT(1);
                    match(IANA_TOKEN);

                    p      = new CalendarProperty(n.getLine(), n.getColumn());
                    p.Name = n.getText().ToUpper();

                    break;
                }

                case X_NAME:
                {
                    m = LT(1);
                    match(X_NAME);

                    p      = new CalendarProperty(m.getLine(), m.getColumn());
                    p.Name = m.getText().ToUpper();

                    break;
                }

                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                }
            }

            ISerializationProcessor <ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor <ICalendarProperty>)) as ISerializationProcessor <ICalendarProperty>;

            // Do some pre-processing on the property
            if (processor != null)
            {
                processor.PreDeserialization(p);
            }

            if (c != null)
            {
                // Add the property to the container, as the parent object(s)
                // may be needed during deserialization.
                c.Properties.Add(p);
            }

            // Push the property onto the serialization context stack
            ctx.Push(p);
            IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == SEMICOLON))
                    {
                        match(SEMICOLON);
                        parameter(ctx, p);
                    }
                    else
                    {
                        goto _loop24_breakloop;
                    }
                }
                _loop24_breakloop :;
            }        // ( ... )*
            match(COLON);
            v = value();

            // Deserialize the value of the property
            // into a concrete iCalendar data type,
            // or string value.
            p.Value = dataMapSerializer.Deserialize(new StringReader(v));

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == CRLF))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        goto _loop26_breakloop;
                    }
                }
                _loop26_breakloop :;
            }        // ( ... )*

            // Do some final processing on the property:
            if (processor != null)
            {
                processor.PostDeserialization(p);
            }

            // Notify that the property has been loaded
            p.OnLoaded();

            // Pop the property off the serialization context stack
            ctx.Pop();

            return(p);
        }