コード例 #1
0
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version) {
			base.LoadFieldsCore(reader, version);

			// ILabel members
			this.privateCharacterStyle = reader.ReadCharacterStyle();
			this.privateParagraphStyle = reader.ReadParagraphStyle();

			string txt = reader.ReadString();
			if (caption == null) caption = new Caption(txt);
			else caption.Text = txt;
		}
コード例 #2
0
ファイル: Caption.cs プロジェクト: nilavanrajamani/NShape
 /// <override></override>
 public virtual void HideCaptionText(int index)
 {
     if (index != 0)
     {
         throw new IndexOutOfRangeException();
     }
     if (caption == null)
     {
         caption = new Caption();
     }
     caption.IsVisible = false;
     Invalidate();
 }
コード例 #3
0
ファイル: Caption.cs プロジェクト: Jchuchla/vixen-sall-vixen
        /// <override></override>
        public override void CopyFrom(Shape source)
        {
            base.CopyFrom(source);
            if (source is ICaptionedShape)
            {
                ICaptionedShape src = (ICaptionedShape)source;
                // Copy first caption
                ICharacterStyle charStyle = src.GetCaptionCharacterStyle(0);
                privateCharacterStyle = (Template != null &&
                                         charStyle == ((ICaptionedShape)Template.Shape).GetCaptionCharacterStyle(0))
                                                                ? null
                                                                : charStyle;
                IParagraphStyle paragraphStyle = src.GetCaptionParagraphStyle(0);
                privateParagraphStyle = (Template != null &&
                                         paragraphStyle == ((ICaptionedShape)Template.Shape).GetCaptionParagraphStyle(0))
                                                                ? null
                                                                : paragraphStyle;
                string txt = src.GetCaptionText(0);
                if (!string.IsNullOrEmpty(txt))
                {
                    if (caption == null)
                    {
                        caption = new Caption(txt);
                    }
                    else
                    {
                        caption.Text = txt;
                    }
                }
                else
                {
                    caption = null;
                }

                // Copy remaining captions
                int cnt = Math.Min(CaptionCount, src.CaptionCount);
                for (int i = 1; i < cnt; ++i)
                {
                    SetCaptionCharacterStyle(i, src.GetCaptionCharacterStyle(i));
                    SetCaptionParagraphStyle(i, GetCaptionParagraphStyle(i));
                    SetCaptionText(i, GetCaptionText(i));
                }
            }
        }
コード例 #4
0
ファイル: Caption.cs プロジェクト: stewmc/vixen
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version)
		{
			base.LoadFieldsCore(reader, 1);

			// ILabel members
			this.privateCharacterStyle = reader.ReadCharacterStyle();
			this.privateParagraphStyle = reader.ReadParagraphStyle();

			string txt = reader.ReadString();
			if (caption == null) caption = new Caption(txt);
			else caption.Text = txt;
		}
コード例 #5
0
ファイル: Caption.cs プロジェクト: stewmc/vixen
		/// <override></override>
		public override void CopyFrom(Shape source)
		{
			base.CopyFrom(source);
			if (source is ICaptionedShape) {
				ICaptionedShape src = (ICaptionedShape) source;
				// Copy first caption
				ICharacterStyle charStyle = src.GetCaptionCharacterStyle(0);
				privateCharacterStyle = (Template != null &&
				                         charStyle == ((ICaptionedShape) Template.Shape).GetCaptionCharacterStyle(0))
				                        	? null
				                        	: charStyle;
				IParagraphStyle paragraphStyle = src.GetCaptionParagraphStyle(0);
				privateParagraphStyle = (Template != null &&
				                         paragraphStyle == ((ICaptionedShape) Template.Shape).GetCaptionParagraphStyle(0))
				                        	? null
				                        	: paragraphStyle;
				string txt = src.GetCaptionText(0);
				if (!string.IsNullOrEmpty(txt)) {
					if (caption == null) caption = new Caption(txt);
					else caption.Text = txt;
				}
				else caption = null;

				// Copy remaining captions
				int cnt = Math.Min(CaptionCount, src.CaptionCount);
				for (int i = 1; i < cnt; ++i) {
					SetCaptionCharacterStyle(i, src.GetCaptionCharacterStyle(i));
					SetCaptionParagraphStyle(i, GetCaptionParagraphStyle(i));
					SetCaptionText(i, GetCaptionText(i));
				}
			}
		}
コード例 #6
0
ファイル: ImageBasedShape.cs プロジェクト: stewmc/vixen
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version)
		{
			base.LoadFieldsCore(reader, version);
			fillStyle = reader.ReadFillStyle();
			charStyle = reader.ReadCharacterStyle();
			paragraphStyle = reader.ReadParagraphStyle();

			string txt = reader.ReadString();
			if (caption == null) caption = new Caption(txt);
			else caption.Text = txt;
			w = reader.ReadInt32();
			h = reader.ReadInt32();
		}