Beispiel #1
0
        public override void Initialize(InitializeParameters p)
        {
            base.Initialize(p);


            if (string.IsNullOrEmpty(this.FontId))
            {
                throw new InvalidOperationException("Font is not specified for text field");
            }

            this.font = this.FindGlobal(this.FontId) as XFontResource;

            if (this.font == null)
            {
                throw new InvalidOperationException("Font wasn't found: " + this.FontId);
            }

            if (this.Text != null && this.Text.StartsWith("="))
            {
                this.strValueReader = Compiler.CompileExpression <string>(this, "system.Str(" + this.Text.Substring(1) + ")");
            }

            if (this.font == null)
            {
                throw new InvalidOperationException(string.Format(
                                                        "Font was not found. Text ID:{0} FontId:{1}", this.Id, this.FontId
                                                        ));
            }
        }
Beispiel #2
0
		public override void Initialize(InitializeParameters p)
		{
			base.Initialize(p);

			
			if (string.IsNullOrEmpty(this.FontId))
				throw new InvalidOperationException("Font is not specified for text field");
			
			this.font = this.FindGlobal(this.FontId) as XFontResource;

			if (this.font == null)
				throw new InvalidOperationException("Font wasn't found: " + this.FontId);
				
            if (this.Text != null && this.Text.StartsWith("="))
            {
                this.strValueReader = Compiler.CompileExpression<string>(this, "system.Str(" + this.Text.Substring(1) + ")");
            }
			
			if (this.font == null)
				throw new InvalidOperationException(string.Format(
					"Font was not found. Text ID:{0} FontId:{1}", this.Id, this.FontId
                ));
		}