Пример #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
        // We override the default insert function because we need to call a method that
        // raises the event as well as inserting the item.
        public override ParagraphDemo MakeListItem(int index)
        {
            var paragraphDemo = new ParagraphDemo();

            m_owner.InsertParagraph(index, paragraphDemo);
            return(paragraphDemo);
        }
Пример #3
0
        private void InitLongText()
        {
            var     stylesheet = SetupStyles();
            var     styles     = new AssembledStyles(stylesheet);
            RootBox root       = new RootBoxFdo(styles.WithLineHeight(12500));
            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(' ');
            string sb = "";
            int    ws = 1;          // arbitrary with default renderer factory.

            for (int i = 0; i < 20; i++)
            {
                if (i < words.Length)
                {
                    sb += (words[i]);
                }
                if (i < words.Length)
                {
                    sb += (" ");
                }
                var para = ApplyTsStringStyle(sb, "Normal", ws);
                owner.InsertParagraph(0, para);
            }

            root.Builder.Show(Div.Containing(Div.Containing(Display.Of(() => owner.Paragraphs).Using(
                                                                (builder, para) => builder.Show(Paragraph.Containing(Display.Of(() => para.TsContents)).Style(para.ParaStyle)))
                                                            .EditParagraphsUsing(new ParagraphOpsDemo(owner))).Border(1500).Pads(3000, 3000, 3000, 3000)).Border(2500).Pads(1000, 1000, 1000, 1000));

            styleChooser.Visible = true;
            theSharpView.Root    = root;
            root.SelectAtStart().Install();
            theSharpView.Focus();
        }
Пример #4
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();
        }
Пример #5
0
        // We override the default insert function because we need to call a method that
        // raises the event as well as inserting the item.
        public override ParagraphDemo MakeListItem(int index, bool ipAtStartOfPara)
        {
            var paragraphDemo = new ParagraphDemo();

            paragraphDemo.ParaStyle = ipAtStartOfPara
                                                                                ? m_owner.Paragraphs[index].ParaStyle
                                                                                : paragraphDemo.ParaStyle = m_owner.Paragraphs[index - 1].ParaStyle;
            m_owner.InsertParagraph(index, paragraphDemo);
            return(paragraphDemo);
        }
Пример #6
0
        private void InitMultiPara()
        {
            AssembledStyles styles = new AssembledStyles();
            RootBox         root   = new RootBox(styles);
            var             owner  = new ParagraphOwnerDemo();

            owner.InsertParagraph(0, new ParagraphDemo());
            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();
        }
Пример #7
0
		private void InitLongText()
		{
			var stylesheet = SetupStyles();
			var styles = new AssembledStyles(stylesheet);
			RootBox root = new RootBoxFdo(styles.WithLineHeight(12500));
			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(' ');
			string sb = "";
			int ws = 1; // arbitrary with default renderer factory.
			for (int i = 0; i < 20; i++)
			{
				if (i < words.Length)
					sb += (words[i]);
				if (i < words.Length)
					sb += (" ");
				var para = ApplyTsStringStyle(sb, "Normal", ws);
				owner.InsertParagraph(0, para);
			}

			root.Builder.Show(Div.Containing(Div.Containing(Display.Of(() => owner.Paragraphs).Using(
				(builder, para) => builder.Show(Paragraph.Containing(Display.Of(() => para.TsContents)).Style(para.ParaStyle)))
								.EditParagraphsUsing(new ParagraphOpsDemo(owner))).Border(1500).Pads(3000, 3000, 3000, 3000)).Border(2500).Pads(1000, 1000, 1000, 1000));

			styleChooser.Visible = true;
			theSharpView.Root = root;
			root.SelectAtStart().Install();
			theSharpView.Focus();
		}
Пример #8
0
		private void InitMultiPara()
		{
			var styles = new AssembledStyles();
			RootBox root = new RootBoxFdo(styles);
			var owner = new ParagraphOwnerDemo();
			owner.InsertParagraph(0, new ParagraphDemo());
			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.SelectAtStart().Install();
			theSharpView.Focus();
		}
Пример #9
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();
		}
Пример #10
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();

		}