Ejemplo n.º 1
0
 virtual public void Set(string name, string[] values)
 {
     if (name != null)
     {
         name = m_CaseInsensitive ? name.ToUpper() : name;
         if (ContainsKey(name))
         {
             if (values != null)
             {
                 this[name] = new CalendarParameter(name, values);
             }
             else
             {
                 Remove(name);
             }
         }
         Add(new CalendarParameter(name, values));
     }
 }
 public void Set(string name, string[] values)
 {
     if (name != null)
     {
         if (ContainsKey(name))
         {
             if (values != null)
             {
                 this[name] = new CalendarParameter(name, values);
             }
             else
             {
                 Remove(name);
             }
         }
         else if (values != null)
         {
             Add(new CalendarParameter(name, values));
         }
     }
 }
Ejemplo n.º 3
0
        public void Add(string value)
        {
            if (IsReadOnly)
                throw new NotSupportedException();

            // Add the value to a pre-existing parameter, if possible
            foreach (ICalendarParameter p in m_ParameterList)
            {
                if (string.Equals(p.Name, m_ParameterName))
                {
                    List<string> values = new List<string>(p.Values);
                    values.Add(value);
                    p.Values = values.ToArray();
                    return;
                }
            }

            // Create a new parameter to hold our value
            ICalendarParameter parm = new CalendarParameter();
            parm.Name = m_ParameterName;
            parm.Values = new string[] { value };

            m_ParameterList.Add(parm);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds a parameter to the iCalendar object.
        /// </summary>
        virtual public void AddParameter(string name, string value)
        {
            var p = new CalendarParameter(name, value);

            Parameters.Add(p);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds a parameter to the iCalendar object.
 /// </summary>
 virtual public void AddParameter(string name, string value)
 {            
     CalendarParameter p = new CalendarParameter(name, value);
     AddParameter(p);
 }
 public void Set(string name, string[] values)
 {
     if (name != null)
     {
         if (ContainsKey(name))
         {
             if (values != null)
                 this[name] = new CalendarParameter(name, values);
             else
                 Remove(name);
         }
         else if (values != null)
         {
             Add(new CalendarParameter(name, values));
         }
     }
 }
Ejemplo n.º 7
0
        public ICalendarParameter parameter(

            ISerializationContext ctx,
            ICalendarParameterCollectionContainer container

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

            IToken n = null;
            IToken m = null;

            string        v;
            List <string> values = new List <string>();


            {
                switch (LA(1))
                {
                case IANA_TOKEN:
                {
                    n = LT(1);
                    match(IANA_TOKEN);
                    p = new CalendarParameter(n.getText());
                    break;
                }

                case X_NAME:
                {
                    m = LT(1);
                    match(X_NAME);
                    p = new CalendarParameter(m.getText());
                    break;
                }

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

            // Push the parameter onto the serialization context stack
            ctx.Push(p);

            match(EQUAL);
            v = param_value();
            values.Add(v);
            {                // ( ... )*
                for (; ;)
                {
                    if ((LA(1) == COMMA))
                    {
                        match(COMMA);
                        v = param_value();
                        values.Add(v);
                    }
                    else
                    {
                        goto _loop30_breakloop;
                    }
                }
                _loop30_breakloop :;
            }                // ( ... )*

            p.SetValue(values);

            if (container != null)
            {
                container.Parameters.Add(p);
            }

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

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

            return(p);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Adds a parameter to the iCalendar object.
        /// </summary>
        virtual public void AddParameter(string name, string value)
        {
            CalendarParameter p = new CalendarParameter(name, value);

            AddParameter(p);
        }
Ejemplo n.º 9
0
	public ICalendarParameter  parameter(
		
	ISerializationContext ctx,
	ICalendarParameterCollectionContainer container

	) //throws RecognitionException, TokenStreamException
{
		ICalendarParameter p = null;;
		
		IToken  n = null;
		IToken  m = null;
		
			string v;
			List<string> values = new List<string>();
		
		
		{
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			{
				n = LT(1);
				match(IANA_TOKEN);
				p = new CalendarParameter(n.getText());
				break;
			}
			case X_NAME:
			{
				m = LT(1);
				match(X_NAME);
				p = new CalendarParameter(m.getText());
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		
			// Push the parameter onto the serialization context stack
			ctx.Push(p);
		
		match(EQUAL);
		v=param_value();
		values.Add(v);
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==COMMA))
				{
					match(COMMA);
					v=param_value();
					values.Add(v);
				}
				else
				{
					goto _loop30_breakloop;
				}
				
			}
_loop30_breakloop:			;
		}    // ( ... )*
		
			p.SetValue(values);
			
			if (container != null)
			{
				container.Parameters.Add(p);
			}
			
			// Notify that the parameter has been loaded
			p.OnLoaded();
			
			// Pop the parameter off the serialization context stack
			ctx.Pop();
		
		return p;
	}