예제 #1
0
        private void InitLongText()
        {
            AssembledStyles styles = new AssembledStyles();
            RootBox         root   = new RootBox(styles);
            var             owner  = new ParagraphOwnerDemo();
            var             words  =
                "This is a bit of text from which we can extract substrings of increasing length to populate various paragraphs in different ways".Split(' ');
            var sb = new StringBuilder();

            for (int i = 0; i < 20; i++)
            {
                var para = new ParagraphDemo();
                if (i < words.Length)
                {
                    sb.Append(words[i]);
                }
                para.Contents = sb.ToString();
                if (i < words.Length)
                {
                    sb.Append(" ");
                }
                owner.InsertParagraph(0, para);
            }
            int ws = 1;             // arbitrary with default renderer factory.

            root.Builder.Show(Display.Of(() => owner.Paragraphs).Using(
                                  (builder, para) => builder.AddString(() => para.Contents, ws))
                              .EditParagraphsUsing(new ParagraphOpsDemo(owner)));
            theSharpView.Root = root;
            root.SelectAtEnd().Install();
            theSharpView.Focus();
        }
예제 #2
0
        private void InitTextWithPrompts()
        {
            var     styles = new AssembledStyles();
            RootBox root   = new RootBoxFdo(styles);

            root.RendererFactory = theSharpView.RendererFactory;
            var obj0 = new ParagraphDemo {
                Contents = "one"
            };
            var obj1 = new ParagraphDemo {
                Contents = ""
            };
            var obj2 = new ParagraphDemo {
                Contents = "three"
            };
            int ws = 1;             // arbitrary with default renderer factory.

            root.Builder.Show(
                Paragraph.Containing(
                    Display.Of(() => obj0.Contents, ws).WhenEmpty("prompt", ws),
                    Display.Of(" "),
                    Display.Of(() => obj1.Contents, ws).WhenEmpty("prompt", ws),
                    Display.Of(" "),
                    Display.Of(() => obj2.Contents, ws).WhenEmpty("prompt", ws)
                    )
                );
            theSharpView.Root = root;
            root.SelectAtStart().Install();
            theSharpView.Focus();
        }
예제 #3
0
        void StartupMultiLingualStrings()
        {
            var     stylesheet = SetupStyles();
            var     styles     = new AssembledStyles(stylesheet);
            RootBox root       = new RootBoxFdo(styles);
            var     owner      = new ParagraphOwnerDemo();
            var     paraDemo   = new ParagraphDemo {
                ParaStyle = "Left"
            };

            paraDemo.MlsContents = m_mlsOwner.MyMultiString;
            owner.InsertParagraph(0, paraDemo);
            root.Builder.Show(Display.Of(() => owner.Paragraphs).Using(
                                  (builder, para) =>
                                  builder.Show(Paragraph.Containing(Display.Of(() => para.MlsContents, Ws2)).Style(para.ParaStyle))),
                              Display.Of(() => owner.Paragraphs).Using(
                                  (builder, para) =>
                                  builder.Show(Paragraph.Containing(Display.Of(() => para.MlsContents, Ws1)).Style(para.ParaStyle))))
            .EditParagraphsUsing(new ParagraphOpsDemo(owner));
            wsSelector1.SelectedItem = wsSelector1.Items[Ws1 - 1];
            wsSelector2.SelectedItem = wsSelector2.Items[Ws2 - 1];
            theSharpView.Root        = root;
            root.SelectAtStart().Install();
            theSharpView.Focus();
        }
예제 #4
0
        private void InitStyledText()
        {
            AssembledStyles styles = new AssembledStyles();
            RootBox         root   = new RootBox(styles);

            root.RendererFactory = theSharpView.RendererFactory;
            var obj0 = new ParagraphDemo()
            {
                Contents = "plain "
            };
            var obj1 = new ParagraphDemo()
            {
                Contents = "bold "
            };
            var obj2 = new ParagraphDemo()
            {
                Contents = "italic "
            };
            var obj3 = new ParagraphDemo()
            {
                Contents = "bold italic "
            };
            var obj4 = new ParagraphDemo()
            {
                Contents = "red on yellow"
            };
            int ws = 1;             // arbitrary with default renderer factory.

            root.Builder.Show(
                Paragraph.Containing(
                    Display.Of(() => obj0.Contents, ws).FaceName("Times New Roman"),
                    Display.Of(() => obj1.Contents, ws).FaceName("Times New Roman").Bold,
                    Display.Of(() => obj2.Contents, ws).FaceName("Times New Roman").Italic,
                    Display.Of(() => obj3.Contents, ws).FaceName("Times New Roman").Bold.Italic,
                    Display.Of(() => obj4.Contents, ws).ForeColor(Color.Red).BackColor(Color.Yellow)
                    ).Border(1.Points(), Color.Red).Pads(2.Points(), 3.Points(), 2.Points(), 3.Points())
                );
            root.Builder.Show(
                Paragraph.Containing(
                    Display.Of("plain"),
                    Display.Of("underOnYellow").Underline(FwUnderlineType.kuntSingle).BackColor(Color.Yellow).FaceName("Times New Roman")
                    ).Margins(3.Points(), 2.Points(), 5.Points(), 2.Points())
                .Borders(1.Points(), 2.Points(), 3.Points(), 4.Points(), Color.Green)
                .BackColor(Color.Pink).Pads(2.Points(), 2.Points(), 2.Points(), 2.Points()),
                Paragraph.Containing(
                    Display.Of("doubleRedOnPink").Underline(FwUnderlineType.kuntDouble, Color.Red).BackColor(Color.Pink),
                    Display.Of("dotted").Underline(FwUnderlineType.kuntDotted),
                    Display.Of("dottedOnYellow").Underline(FwUnderlineType.kuntDotted).BackColor(Color.Yellow)
                    ),
                Paragraph.Containing(
                    Display.Of("dashed").Underline(FwUnderlineType.kuntDashed),
                    Display.Of("dashedRed").Underline(FwUnderlineType.kuntDashed).ForeColor(Color.Red),
                    Display.Of("squiggle").Underline(FwUnderlineType.kuntSquiggle, Color.Red)
                    )
                );
            theSharpView.Root = root;
            root.SelectAtEnd().Install();
            theSharpView.Focus();
        }
예제 #5
0
        private static ParagraphDemo ApplyTsStringStyle(string contents, string style, int ws)
        {
            var tsString = TsStrFactoryClass.Create().MakeString(contents, ws);
            var bldr     = tsString.GetBldr();

            bldr.SetStrPropValue(0, tsString.Text.Length, (int)FwTextPropType.ktptNamedStyle, style);
            var para = new ParagraphDemo {
                TsContents = bldr.GetString(), ParaStyle = "Left"
            };

            return(para);
        }
예제 #6
0
		public void InsertParagraph(int index, ParagraphDemo item)
		{
			m_paragraphs.Insert(index, item);
		}
예제 #7
0
 public void InsertParagraph(int index, ParagraphDemo item)
 {
     m_paragraphs.Insert(index, item);
 }
예제 #8
0
		public void InsertParagraph(int index, ParagraphDemo item)
		{
			m_paragraphs.Insert(index, item);
			RaiseParagraphsChanged();
		}
예제 #9
0
파일: Form1.cs 프로젝트: bbriggs/FieldWorks
		private void InitStyledText()
		{
			var styles = new AssembledStyles();
			RootBox root = new RootBoxFdo(styles);
			root.RendererFactory = theSharpView.RendererFactory;
			var obj0 = new ParagraphDemo { Contents = "plain " };
			var obj1 = new ParagraphDemo { Contents = "bold " };
			var obj2 = new ParagraphDemo { Contents = "italic " };
			var obj3 = new ParagraphDemo { Contents = "bold italic " };
			var obj4 = new ParagraphDemo { Contents = "red on yellow" };
			int ws = 1; // arbitrary with default renderer factory.
			root.Builder.Show(
				Paragraph.Containing(
					Display.Of(() => obj0.Contents, ws).FaceName("Times New Roman"),
					Display.Of(() => obj1.Contents, ws).FaceName("Times New Roman").Bold,
					Display.Of(() => obj2.Contents, ws).FaceName("Times New Roman").Italic,
					Display.Of(() => obj3.Contents, ws).FaceName("Times New Roman").Bold.Italic,
					Display.Of(() => obj4.Contents, ws).ForeColor(Color.Red).BackColor(Color.Yellow)
					).Border(1.Points(), Color.Red).Pads(2.Points(), 3.Points(), 2.Points(), 3.Points())
				);
			root.Builder.Show(
				Paragraph.Containing(
					Display.Of("plain"),
					Display.Of("underOnYellow").Underline(FwUnderlineType.kuntSingle).BackColor(Color.Yellow).FaceName("Times New Roman")
					).Margins(3.Points(), 2.Points(), 5.Points(), 2.Points())
					.Borders(1.Points(), 2.Points(), 3.Points(), 4.Points(), Color.Green)
					.BackColor(Color.Pink).Pads(2.Points(), 2.Points(), 2.Points(), 2.Points()),
				Paragraph.Containing(
					Display.Of("doubleRedOnPink").Underline(FwUnderlineType.kuntDouble, Color.Red).BackColor(Color.Pink),
					Display.Of("dotted").Underline(FwUnderlineType.kuntDotted),
					Display.Of("dottedOnYellow").Underline(FwUnderlineType.kuntDotted).BackColor(Color.Yellow)
					),
				Paragraph.Containing(
					Display.Of("dashed").Underline(FwUnderlineType.kuntDashed),
					Display.Of("dashedRed").Underline(FwUnderlineType.kuntDashed).ForeColor(Color.Red),
					Display.Of("squiggle").Underline(FwUnderlineType.kuntSquiggle, Color.Red)
					)
				);
			theSharpView.Root = root;
			root.SelectAtStart().Install();
			theSharpView.Focus();
		}
예제 #10
0
파일: Form1.cs 프로젝트: bbriggs/FieldWorks
		private static ParagraphDemo ApplyTsStringStyle(string contents, string style, int ws)
		{
			var tsString = TsStrFactoryClass.Create().MakeString(contents, ws);
			var bldr = tsString.GetBldr();
			bldr.SetStrPropValue(0, tsString.Text.Length, (int)FwTextPropType.ktptNamedStyle, style);
			var para = new ParagraphDemo {TsContents = bldr.GetString(), ParaStyle = "Left"};
			return para;
		}
예제 #11
0
파일: Form1.cs 프로젝트: bbriggs/FieldWorks
		private void InitTextWithPrompts()
		{
			var styles = new AssembledStyles();
			RootBox root = new RootBoxFdo(styles);
			root.RendererFactory = theSharpView.RendererFactory;
			var obj0 = new ParagraphDemo { Contents = "one" };
			var obj1 = new ParagraphDemo { Contents = "" };
			var obj2 = new ParagraphDemo { Contents = "three" };
			int ws = 1; // arbitrary with default renderer factory.
			root.Builder.Show(
				Paragraph.Containing(
					Display.Of(() => obj0.Contents, ws).WhenEmpty("prompt", ws),
					Display.Of(" "),
					Display.Of(() => obj1.Contents, ws).WhenEmpty("prompt", ws),
					Display.Of(" "),
					Display.Of(() => obj2.Contents, ws).WhenEmpty("prompt", ws)
					)
				);
			theSharpView.Root = root;
			root.SelectAtStart().Install();
			theSharpView.Focus();
		}
예제 #12
0
파일: Form1.cs 프로젝트: bbriggs/FieldWorks
		void StartupMultiLingualStrings()
		{
			var stylesheet = SetupStyles();
			var styles = new AssembledStyles(stylesheet);
			RootBox root = new RootBoxFdo(styles);
			var owner = new ParagraphOwnerDemo();
			var paraDemo = new ParagraphDemo {ParaStyle = "Left"};
			paraDemo.MlsContents = m_mlsOwner.MyMultiString;
			owner.InsertParagraph(0, paraDemo);
			root.Builder.Show(Display.Of(() => owner.Paragraphs).Using(
				(builder, para) =>
				builder.Show(Paragraph.Containing(Display.Of(() => para.MlsContents, Ws2)).Style(para.ParaStyle))),
							  Display.Of(() => owner.Paragraphs).Using(
								(builder, para) =>
								builder.Show(Paragraph.Containing(Display.Of(() => para.MlsContents, Ws1)).Style(para.ParaStyle))))
				.EditParagraphsUsing(new ParagraphOpsDemo(owner));
			wsSelector1.SelectedItem = wsSelector1.Items[Ws1 - 1];
			wsSelector2.SelectedItem = wsSelector2.Items[Ws2 - 1];
			theSharpView.Root = root;
			root.SelectAtStart().Install();
			theSharpView.Focus();
		}
예제 #13
0
파일: Form1.cs 프로젝트: bbriggs/FieldWorks
		private void InitLongText()
		{
			AssembledStyles styles = new AssembledStyles();
			RootBox root = new RootBox(styles);
			var owner = new ParagraphOwnerDemo();
			var words =
				"This is a bit of text from which we can extract substrings of increasing length to populate various paragraphs in different ways".Split(' ');
			var sb = new StringBuilder();
			for (int i = 0; i < 20; i++)
			{
				var para = new ParagraphDemo();
				if (i < words.Length)
					sb.Append(words[i]);
				para.Contents = sb.ToString();
				if (i < words.Length)
					sb.Append(" ");
				owner.InsertParagraph(0, para);
			}
			int ws = 1; // arbitrary with default renderer factory.
			root.Builder.Show(Display.Of(() => owner.Paragraphs).Using(
				(builder, para) => builder.AddString(() => para.Contents, ws))
				.EditParagraphsUsing(new ParagraphOpsDemo(owner)));
			theSharpView.Root = root;
			root.SelectAtEnd().Install();
			theSharpView.Focus();

		}
예제 #14
0
 public void InsertParagraph(int index, ParagraphDemo item)
 {
     m_paragraphs.Insert(index, item);
     RaiseParagraphsChanged();
 }