Esempio n. 1
0
        public void SetParam(String pn, String pv)
        {
            PropertyParameter par = new PropertyParameter(pn, this);

            par.ParameterValue = pv;
            SetPar(par);
        }
Esempio n. 2
0
// Encoding
        public void SetEncoding(Encoder en)
        {
            PropertyParameter par = GetPar("ENCODING");

            if (par == null)
            {
                SetPar(new EncodingParameter(this, en));
            }
            else
            {
                ((EncodingParameter)par).SetEncoding(en);
            }
        }
Esempio n. 3
0
// Value type
        public void SetValueType(String vt)
        {
            PropertyParameter pr = GetPar("VALUE");

            if (pr == null)
            {
                SetPar(new ValueParameter(this, vt));
            }
            else
            {
                ((ValueParameter)pr).SetValue(vt);
            }
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
 public void SetParam(String pn,String pv)
 {
     PropertyParameter par=new PropertyParameter(pn,this);
     par.ParameterValue=pv;
     SetPar(par);
 }
Esempio n. 6
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);
		}
Esempio n. 7
0
		protected void SetPar(PropertyParameter pr)
		{
			_par.Add(pr);
			pr.Apply();
		}
Esempio n. 8
0
 protected void SetPar(PropertyParameter pr)
 {
     _par.Add(pr);
     pr.Apply();
 }