Example #1
0
        public override void ParseFromStream(StreamReader sr)
        {
            String tkn = Parser.GetToken(sr);

            while (tkn == ";")                                                                          // Reading property parameters
            {
                tkn = Parser.GetToken(sr);
                PropertyParameter pp;
                switch (tkn)
                {
                case "ENCODING": pp = new EncodingParameter(this);
                    break;

                case "VALUE": pp = new ValueParameter(this);
                    break;

//					case "BASE64": pp=new parEncoding(this,new Base64Enc());
//						break;
                case "QUOTED-PRINTABLE": pp = new EncodingParameter(this, new QuotedPrintableEncoder());
                    break;

                case "7-BIT": pp = new EncodingParameter(this, new _7BitEncoder());
                    break;

                default: pp = new PropertyParameter(tkn, this);
                    break;
                }
                pp.ParseFromStream(sr);                  // We will apply parameters value when we'll read it
                SetPar(pp);
                tkn = Parser.GetToken(sr);
            }
            if (tkn != ":")
            {
                throw new InvalidDocumentStructureExeption();
            }
            _val.ParseFromStream(sr, enc);
        }
Example #2
0
		public override void ParseFromStream(StreamReader sr)
		{
			String tkn=Parser.GetToken(sr);
			while(tkn==";")									// Reading property parameters
			{
				tkn=Parser.GetToken(sr);
				PropertyParameter pp;
				switch(tkn)
				{
					case "ENCODING":pp=new EncodingParameter(this);
						break;
					case "VALUE":pp=new ValueParameter(this);
						break;
//					case "BASE64": pp=new parEncoding(this,new Base64Enc());
//						break;
					case "QUOTED-PRINTABLE": pp=new EncodingParameter(this,new QuotedPrintableEncoder());
						break;
					case "7-BIT": pp=new EncodingParameter(this,new _7BitEncoder());
						break;
					default:pp=new PropertyParameter(tkn,this);
						break;
				}
				pp.ParseFromStream(sr);  // We will apply parameters value when we'll read it
				SetPar(pp);
				tkn=Parser.GetToken(sr);
			}
			if(tkn!=":")throw new InvalidDocumentStructureExeption();
			_val.ParseFromStream(sr,enc);
		}