Exemplo n.º 1
0
		public void SetOptionalProperty(OptionalProperty pr)
		{
			_proplist.Add(pr);
		}
Exemplo n.º 2
0
        public override void ParseFromStream(StreamReader sr)
        {
            String tkn = "";

            while (true)
            {
                tkn = Parser.GetToken(sr);
                if (tkn == "END")
                {
                    tkn = Parser.GetToken(sr);
                    if (tkn != ":")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    tkn = Parser.GetToken(sr);
                    if (tkn != "VCALENDAR")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    return;
                }

                vObjectProperty pr = null;
                switch (tkn)
                {
                case "BEGIN":
                {
                    tkn = Parser.GetToken(sr);
                    if (tkn != ":")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    tkn = Parser.GetToken(sr);
                    vObject ent = null;
                    if (tkn == "VEVENT")
                    {
                        ent = new vEvent();
                    }
                    if (tkn == "VTODO")
                    {
                        ent = new vTodo();
                    }
                    if ((tkn != "VEVENT") && (tkn != "VTODO"))
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    ent.ParseFromStream(sr);
                    AddEntity(ent);
                    break;
                }

                case "GEO":
                    pr = new GeographicPosition(this);
                    break;

                case "PRODID":
                    pr = new ProductID(this);
                    break;

                case "TZ":
                    pr = new TZone(this);
                    break;

                case "VERSION":
                    pr = new SpecificationVersion(this);
                    break;

                default:
                    if (tkn.Substring(0, 2) == "X-")                          // Extention property
                    {
                        pr = new ExtensionProperty(tkn, this);
                    }
                    else                              // Comment this if optional properties support is not required
                    {
                        pr = new OptionalProperty(tkn, this);
                    }
                    break;
                }
                if (pr != null)
                {
                    pr.ParseFromStream(sr);
                    SetProperty(pr);
                }
            }
        }
Exemplo n.º 3
0
        public override void ParseFromStream(StreamReader sr)
        {
            String tkn = "";

            while (true)
            {
                tkn = Parser.GetToken(sr);
                if (tkn == "END")
                {
                    tkn = Parser.GetToken(sr);
                    if (tkn != ":")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    tkn = Parser.GetToken(sr);
                    if (tkn != "VTODO")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    return;
                }

                vObjectProperty pr = null;
                switch (tkn)
                {
                case "BEGIN":
                    throw new InvalidDocumentStructureExeption();
                    break;

                case "DCREATED":
                    pr = new DateTimeCreated(this);
                    break;

                case "COMPLETED":
                    pr = new DateTimeCompleted(this);
                    break;

                case "DESCRIPTION":
                    pr = new Description(this);
                    break;

                case "LAST-MODIFIED":
                    pr = new LastModified(this);
                    break;

                case "CATEGORIES":
                    pr = new Categories(this);
                    break;

                case "DUE":
                    pr = new DueDateTime(this);
                    break;

                case "DTEND":
                    pr = new EndDateTime(this);
                    break;

                case "PRIORITY":
                    pr = new Priority(this);
                    break;

                case "DTSTART":
                    pr = new StartDateTime(this);
                    break;

                case "SUMMARY":
                    pr = new Summary(this);
                    break;

                case "STATUS":
                    pr = new Status(this);
                    break;

                default:
                    if (tkn.Substring(0, 2) == "X-")                          // Extention property
                    {
                        pr = new ExtensionProperty(tkn, this);
                    }
                    else                              // Comment this if optional properties support is not required
                    {
                        pr = new OptionalProperty(tkn, this);
                    }
                    break;
                }
                if (pr != null)
                {
                    pr.ParseFromStream(sr);
                    SetProperty(pr);
                }
            }
        }
Exemplo n.º 4
0
        public override void ParseFromStream(StreamReader sr)
        {
            String tkn = "";

            while (true)
            {
                tkn = Parser.GetTokenPnt(sr);
                if (tkn == "END")
                {
                    tkn = Parser.GetToken(sr);
                    if (tkn != ":")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    tkn = Parser.GetToken(sr);
                    if (tkn != "VCARD")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    return;
                }

                vObjectProperty pr = null;
                switch (tkn)
                {
                case "BEGIN":
                {
                    tkn = Parser.GetToken(sr);
                    if (tkn != ":")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    tkn = Parser.GetToken(sr);
                    vCard ent = null;
                    if (tkn == "VCARD")
                    {
                        ent = new vCard();
                    }
                    if (tkn != "VCARD")
                    {
                        throw new InvalidDocumentStructureExeption();
                    }
                    ent.ParseFromStream(sr);
                    AddNested(ent);
                    break;
                }

                case "N":
                    pr = new NameProperty(this);
                    break;

                case "GEO":
                    pr = new GeographicPosition(this);
                    break;

                case "TZ":
                    pr = new TZone(this);
                    break;

                case "VERSION":
                    pr = new SpecificationVersion(this);
                    break;

                default:
                    if (tkn[tkn.Length - 1] == '.')
                    {
                        String cn = tkn.Substring(0, tkn.Length - 1);
                        tkn = Parser.GetToken(sr);
                        pr  = new OptionalProperty(tkn, this);
                        pr.ParseFromStream(sr);
                        SetPrToComposite(cn, pr);
                        pr = null;
                        break;
                    }
                    if (tkn.Substring(0, 2) == "X-")                          // Extention property
                    {
                        pr = new ExtensionProperty(tkn, this);
                    }
                    else                              // Comment this if optional properties support is not required
                    {
                        pr = new OptionalProperty(tkn, this);
                    }
                    break;
                }
                if (pr != null)
                {
                    pr.ParseFromStream(sr);
                    SetProperty(pr);
                }
            }
        }
Exemplo n.º 5
0
		public override void ParseFromStream(StreamReader sr)
		{
			String tkn="";
			while(true)
			{
				tkn=Parser.GetTokenPnt(sr);
				if(tkn=="END")
				{
					tkn=Parser.GetToken(sr);
					if(tkn!=":")throw new InvalidDocumentStructureExeption();
					tkn=Parser.GetToken(sr);
					if(tkn!="VCARD")throw new InvalidDocumentStructureExeption();
					return ;
				}

				vObjectProperty pr=null;
				switch(tkn)
				{
					case "BEGIN":
					{
						tkn=Parser.GetToken(sr);
						if(tkn!=":")throw new InvalidDocumentStructureExeption();
						tkn=Parser.GetToken(sr);
						vCard ent=null;
						if(tkn=="VCARD")
							ent=new vCard();
						if(tkn!="VCARD")throw new InvalidDocumentStructureExeption();
						ent.ParseFromStream(sr);
						AddNested(ent);
						break;
					}
					case "N":
						pr=new NameProperty(this);
						break;
					case "GEO":
						pr=new GeographicPosition(this);
						break;
					case "TZ":
						pr=new TZone(this);
						break;
					case "VERSION":
						pr=new SpecificationVersion(this);
						break;
					default:
						if(tkn[tkn.Length-1]=='.')
						{ 
							String cn=tkn.Substring(0,tkn.Length-1);
							tkn=Parser.GetToken(sr);
							pr=new OptionalProperty(tkn,this);
							pr.ParseFromStream(sr);
							SetPrToComposite(cn,pr);
							pr=null;
							break;
						}
						if(tkn.Substring(0,2)=="X-")  // Extention property
						{
							pr=new ExtensionProperty(tkn,this);
						}
						else  // Comment this if optional properties support is not required
						{
							pr=new OptionalProperty(tkn,this);
						}
						break;
				}
				if(pr!=null)
				{
					pr.ParseFromStream(sr);
					SetProperty(pr);
				}
			}
		}
Exemplo n.º 6
0
		public override void ParseFromStream(StreamReader sr)
		{
			String tkn="";
			while(true)
			{
				tkn=Parser.GetToken(sr);
				if(tkn=="END")
				{
					tkn=Parser.GetToken(sr);
					if(tkn!=":")throw new InvalidDocumentStructureExeption();
					tkn=Parser.GetToken(sr);
					if(tkn!="VTODO")throw new InvalidDocumentStructureExeption();
					return ;
				}

				vObjectProperty pr=null;
				switch(tkn)
				{
					case "BEGIN":
						throw new InvalidDocumentStructureExeption();
						break;
					case "DCREATED":
						pr=new DateTimeCreated(this);
						break;
					case "COMPLETED":
						pr=new DateTimeCompleted(this);
						break;
					case "DESCRIPTION":
						pr=new Description(this);
						break;
					case "LAST-MODIFIED":
						pr=new LastModified(this);
						break;
					case "CATEGORIES":
						pr=new Categories(this);
						break;
					case "DUE":
						pr=new DueDateTime(this);
						break;
					case "DTEND":
						pr=new EndDateTime(this);
						break;
					case "PRIORITY":
						pr=new Priority(this);
						break;
					case "DTSTART":
						pr=new StartDateTime(this);
						break;
					case "SUMMARY":
						pr=new Summary(this);
						break;
					case "STATUS":
						pr=new Status(this);
						break;
					default:
						if(tkn.Substring(0,2)=="X-")  // Extention property
						{
							pr=new ExtensionProperty(tkn,this);
						}
						else  // Comment this if optional properties support is not required
						{
							pr=new OptionalProperty(tkn,this);
						}
						break;
				}
				if(pr!=null)
				{
					pr.ParseFromStream(sr);
					SetProperty(pr);
				}
			}
		}
Exemplo n.º 7
0
		public override void ParseFromStream(StreamReader sr)
		{
			String tkn="";
			while(true)
			{
				tkn=Parser.GetToken(sr);
				if(tkn=="END")
				{
					tkn=Parser.GetToken(sr);
					if(tkn!=":")throw new InvalidDocumentStructureExeption();
					tkn=Parser.GetToken(sr);
					if(tkn!="VCALENDAR")throw new InvalidDocumentStructureExeption();
					return ;
				}

				vObjectProperty pr=null;
				switch(tkn)
				{
					case "BEGIN":
					{
						tkn=Parser.GetToken(sr);
						if(tkn!=":")throw new InvalidDocumentStructureExeption();
						tkn=Parser.GetToken(sr);
						vObject ent=null;
						if(tkn=="VEVENT")
							ent=new vEvent();
						if(tkn=="VTODO")
							ent=new vTodo();
						if((tkn!="VEVENT")&&(tkn!="VTODO"))throw new InvalidDocumentStructureExeption();
						ent.ParseFromStream(sr);
						AddEntity(ent);
						break;
					}
					case "GEO":
						pr=new GeographicPosition(this);
						break;
					case "PRODID":
						pr=new ProductID(this);
						break;
					case "TZ":
						pr=new TZone(this);
						break;
					case "VERSION":
						pr=new SpecificationVersion(this);
						break;
					default:
						if(tkn.Substring(0,2)=="X-")  // Extention property
						{
							pr=new ExtensionProperty(tkn,this);
						}
						else  // Comment this if optional properties support is not required
						{
							pr=new OptionalProperty(tkn,this);
						}
						break;
				}
				if(pr!=null)
				{
					pr.ParseFromStream(sr);
					SetProperty(pr);
				}
			}
		}
Exemplo n.º 8
0
 public void SetOptionalProperty(OptionalProperty pr)
 {
     _proplist.Add(pr);
 }