public void ResetAllTextures() { if (!this.Visible) { return; } int num; if (this.Editable) { for (num = 0; num < this.tabList.gameObjectList.Count; num++) { if ((bool)StaticMethods.GetPropertyValue(this.tabList.gameObjectList[num], this.Name)) { this.ColumnTextList[num].TextTexture = this.tabList.MultiSelecting ? this.tabList.checkboxSelectedTexture : this.tabList.roundcheckboxSelectedTexture; } else { this.ColumnTextList[num].TextTexture = this.tabList.MultiSelecting ? this.tabList.checkboxTexture : this.tabList.roundcheckboxTexture; } } this.ColumnTextList.ResetAllAlignedPositions(); } else { for (num = 0; num < this.tabList.gameObjectList.Count; num++) { string s = this.GetDataString(num); this.ColumnTextList[num].Text = s; } this.ColumnTextList.ResetAllTextTextures(); this.ColumnTextList.ResetAllAlignedPositions(); } }
internal Column(TabListInFrame tabList) { this.tabList = tabList; this.Text = new FreeText(tabList.ColumnTextBuilder); this.Text.TextColor = tabList.ColumnTextColor; this.Text.Align = tabList.ColumnTextAlign; this.Text.Position = new Rectangle(0, 0, 0, tabList.columnheaderHeight); }
internal Tab(TabListInFrame tabList, ListKind listKind) { this.Text = new FreeText(tabList.TabTextBuilder); this.Text.TextColor = tabList.TabTextColor; this.Text.Align = tabList.TabTextAlign; this.tabList = tabList; this.listKind = listKind; this.Columns = new List <Column>(); }
public void Initialize(MainGameScreen screen) { //this.Conment = new FreeText(screen.GraphicsDevice, new System.Drawing.Font("宋体", 10f), Color.White); this.Conment = new FreeText(new Font("宋体", 10f, ""), Color.White); this.Conment.Align = TextAlign.Middle; this.currentPositionTexture = screen.Textures.TileFrameTextures[0]; this.EffectingAreaTexture = screen.Textures.TileFrameTextures[4]; }
public ActionResult FreetextsCrud(DelivarablefreeTextVM model) { if (model.oper == "add") { if (ModelState.IsValid) { FreeText FreetextToAdd = new FreeText { FreeTexts = model.Freetext }; var existingFreetext = db.FreeText.Where(cvt => cvt.FreeTexts.SafeEqualsLower(FreetextToAdd.FreeTexts)); if (existingFreetext == null) { db.Entry(FreetextToAdd).State = EntityState.Added; db.SaveChanges(); return(Content("Created")); } else { return(Content("CVT already exist")); } } } if (model.oper == "edit") { if (ModelState.IsValid) { string id = HttpContext.Request.Params.Get("id"); if (id != null) { FreeText cvtToEdit = db.FreeText.Find(Convert.ToInt32(id)); cvtToEdit.FreeTexts = model.Freetext; db.Entry(cvtToEdit).State = EntityState.Modified; db.SaveChanges(); return(Content("Updated")); } } } if (model.oper == "del") { string id = HttpContext.Request.Params.Get("id"); if (id != null) { FreeText FreetextToEdit = db.FreeText.Find(Convert.ToInt32(id)); db.FreeText.Remove(FreetextToEdit); db.SaveChanges(); return(Content("Deleted")); } } return(Content("Invalid request")); }
public SearchIndicators(DIConnection dbConnection, DIQueries dbQueries) { this._GIdColumnName = Indicator.IndicatorNId; this._NameColumnName = Indicator.IndicatorName; this._GlobalValueColumnName = Indicator.IndicatorGlobal; this._NameColumnHeader = DILanguage.GetLanguageString("INDICATOR"); this.DBConnection = dbConnection; this.DBQueries = dbQueries; FreeTextObj = new FreeText(dbConnection, dbQueries); }
/// <summary> /// Compares two opening times for equality. /// </summary> /// <param name="OpeningTimes">An opening time to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(OpeningTimes OpeningTimes) { if ((Object)OpeningTimes == null) { return(false); } if (IsOpen24Hours && OpeningTimes.IsOpen24Hours) { return(true); } return(FreeText.Equals(OpeningTimes.FreeText)); }
/// <summary> /// Override av ToString(). Returnerar strängrepresentationen av produkten. /// </summary> /// <returns>Strängrepresentationen av produkten</returns> public override string ToString() { //ProductCode;Title;ProductType;Price;Quantity;ReleaseYear;Creator;Publisher;FreeText;Status string productAsString; productAsString = ProductCode.ToString(CultureInfo.CurrentCulture) + ';'; productAsString += Title + ';'; productAsString += Type.ToString() + ';'; productAsString += Price.ToString("0.00", CultureInfo.CurrentCulture) + ';'; productAsString += Quantity.ToString(CultureInfo.CurrentCulture) + ';'; productAsString += ReleaseYear.ToString(CultureInfo.CurrentCulture) + ';'; productAsString += Creator.ToString(CultureInfo.CurrentCulture) + ';'; productAsString += Publisher.ToString(CultureInfo.CurrentCulture) + ';'; productAsString += FreeText.ToString(CultureInfo.CurrentCulture) + ';'; productAsString += Status.ToString(); return(productAsString); }
internal void SetStyle(string style) { OptionStyle style2 = null; this.Styles.TryGetValue(style, out style2); if (style2 != null) { this.TitleTexture = style2.TitleTexture; this.TitleWidth = style2.TitleWidth; this.TitleHeight = style2.TitleHeight; this.TitleMargin = style2.TitleMargin; this.TitleText = style2.TitleText; this.OptionTextList = style2.OptionTextList; this.ItemHeight = style2.ItemHeight; this.Margin = style2.Margin; this.OptionTexture = style2.OptionTexture; this.OptionSelectedTexture = style2.OptionSelectedTexture; } }
private void chushihuajianzhubiaotiheqizi() { System.Drawing.Font fontjianzhu = new System.Drawing.Font("华文中宋", 16f); Microsoft.Xna.Framework.Graphics.Color colorjianzhu = new Color(); colorjianzhu.PackedValue = uint.Parse("4278255615"); //System.Drawing.Font font1 = new System.Drawing.Font("方正北魏楷书繁体", 30f); //方正北魏楷书繁体 //Microsoft.Xna.Framework.Graphics.Color color1 = new Color(1f, 1f, 1f); qizidezi = new FreeText(base.spriteBatch.GraphicsDevice, new System.Drawing.Font("方正北魏楷书繁体", 30f), new Color(1f, 1f, 1f)); foreach (Architecture jianzhu in base.Scenario.Architectures) { //jianzhu.jianzhubiaoti = new FreeText(spriteBatch.GraphicsDevice, fontjianzhu, colorjianzhu); ///////jianzhu.jianzhubiaoti.DisplayOffset = new Point(0, -mainMapLayer.TileWidth / 2); //jianzhu.jianzhubiaoti.Text = jianzhu.Name; //jianzhu.jianzhubiaoti.Align = TextAlign.Left; jianzhu.jianzhuqizi = new qizi(); //jianzhu.jianzhuqizi.qizidezi = new FreeText(spriteBatch.GraphicsDevice, font1, color1); try { jianzhu.CaptionTexture = Texture2D.FromFile(base.spriteBatch.GraphicsDevice, "Resources/Architecture/Caption/" + jianzhu.CaptionID + ".png"); } catch { jianzhu.CaptionTexture = Texture2D.FromFile(base.spriteBatch.GraphicsDevice, "Resources/Architecture/Caption/None.png"); } /* * if (jianzhu.BelongedFaction != null) * { * jianzhu.jianzhuqizi.qizidezi.Text = jianzhu.BelongedFaction.ToString().Substring(0, 1); * }*/ this.qizidezi.Align = TextAlign.Middle; jianzhu.jianzhuqizi.qizipoint = new Point(jianzhu.dingdian.X, jianzhu.dingdian.Y - 1); } }
public void LoadDataFromXMLDocument(string filename) { Font font; Microsoft.Xna.Framework.Graphics.Color color; XmlDocument document = new XmlDocument(); document.Load(filename); XmlNode nextSibling = document.FirstChild.NextSibling; XmlNode node = nextSibling.ChildNodes.Item(0); this.routewayEditor.BackgroundTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.BackgroundSize = new Microsoft.Xna.Framework.Point(int.Parse(node.Attributes.GetNamedItem("Width").Value), int.Parse(node.Attributes.GetNamedItem("Height").Value)); node = nextSibling.ChildNodes.Item(1); this.routewayEditor.CommentBackgroundTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.CommentClientWidth = int.Parse(node.Attributes.GetNamedItem("Width").Value); node = nextSibling.ChildNodes.Item(2); this.routewayEditor.Comment.ClientWidth = this.routewayEditor.CommentClientWidth; this.routewayEditor.Comment.RowMargin = int.Parse(node.Attributes.GetNamedItem("RowMargin").Value); StaticMethods.LoadFontAndColorFromXMLNode(node, out font, out color); this.routewayEditor.Comment.Builder.SetFreeTextBuilder(this.graphicsDevice, font); this.routewayEditor.Comment.DefaultColor = color; node = nextSibling.ChildNodes.Item(3); StaticMethods.LoadFontAndColorFromXMLNode(node, out font, out color); this.routewayEditor.TitleText = new FreeText(this.graphicsDevice, font, color); this.routewayEditor.TitleText.Position = StaticMethods.LoadRectangleFromXMLNode(node); this.routewayEditor.TitleText.Align = (TextAlign)Enum.Parse(typeof(TextAlign), node.Attributes.GetNamedItem("Align").Value); this.routewayEditor.TitleText.Text = node.Attributes["Text"].Value; node = nextSibling.ChildNodes.Item(4); this.routewayEditor.ExtendButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node); this.routewayEditor.ExtendButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.ExtendButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value); this.routewayEditor.ExtendButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value); this.routewayEditor.ExtendButtonDisabledTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value); node = nextSibling.ChildNodes.Item(5); this.routewayEditor.CutButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node); this.routewayEditor.CutButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.CutButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value); this.routewayEditor.CutButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value); this.routewayEditor.CutButtonDisabledTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value); node = nextSibling.ChildNodes.Item(6); this.routewayEditor.DirectionSwitchPosition = StaticMethods.LoadRectangleFromXMLNode(node); this.routewayEditor.DirectionSwitchTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.DirectionSwitchSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value); this.routewayEditor.DirectionSwitchDisabledTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value); node = nextSibling.ChildNodes.Item(7); this.routewayEditor.BuildButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node); this.routewayEditor.BuildButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.BuildButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value); this.routewayEditor.BuildButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value); node = nextSibling.ChildNodes.Item(8); this.routewayEditor.EndButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node); this.routewayEditor.EndButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.EndButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value); this.routewayEditor.EndButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value); node = nextSibling.ChildNodes.Item(9); this.routewayEditor.ExtendMouseArrowSize = new Microsoft.Xna.Framework.Point(int.Parse(node.Attributes.GetNamedItem("Width").Value), int.Parse(node.Attributes.GetNamedItem("Height").Value)); this.routewayEditor.ExtendMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.ExtendDisabledMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value); node = nextSibling.ChildNodes.Item(10); this.routewayEditor.CutMouseArrowSize = new Microsoft.Xna.Framework.Point(int.Parse(node.Attributes.GetNamedItem("Width").Value), int.Parse(node.Attributes.GetNamedItem("Height").Value)); this.routewayEditor.CutMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.CutDisabledMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value); node = nextSibling.ChildNodes.Item(11); this.routewayEditor.ExtendPointTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value); this.routewayEditor.ExtendPointEndTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("End").Value); StaticMethods.LoadFontAndColorFromXMLNode(node, out font, out color); TextAlign align = (TextAlign)Enum.Parse(typeof(TextAlign), node.Attributes.GetNamedItem("Align").Value); for (int i = 0; i < 4; i++) { FreeText item = new FreeText(this.graphicsDevice, font, color) { Align = align }; this.routewayEditor.ExtendPointTexts.Add(item); } }
public ViewResult Edit(FreeText freeText) { return(View(freeText)); }
public RedirectToRouteResult Edit_POST(FreeText freeText) { _contentItemAdminService.Update(freeText); return(RedirectToAction("Edit", "Newsletter", new { id = freeText.Newsletter.Id })); }
private static void CreateTestAnnots(PDFDoc doc) { ElementWriter ew = new ElementWriter(); ElementBuilder eb = new ElementBuilder(); Element element; Page first_page = doc.PageCreate(new Rect(0, 0, 600, 600)); doc.PagePushBack(first_page); ew.Begin(first_page, ElementWriter.WriteMode.e_overlay, false); // begin writing to this page ew.End(); // save changes to the current page // // Test of a free text annotation. // { FreeText txtannot = FreeText.Create(doc, new Rect(10, 400, 160, 570)); txtannot.SetContents("\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." + "\n\nAha!\n\nAnd there was much rejoicing!"); txtannot.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_solid, 1, 10, 20)); txtannot.SetQuaddingFormat(0); first_page.AnnotPushBack(txtannot); txtannot.RefreshAppearance(); } { FreeText txtannot = FreeText.Create(doc, new Rect(100, 100, 350, 500)); txtannot.SetContentRect(new Rect(200, 200, 350, 500)); txtannot.SetContents("\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." + "\n\nAha!\n\nAnd there was much rejoicing!"); txtannot.SetCalloutLinePoints(new Point(200, 300), new Point(150, 290), new Point(110, 110)); txtannot.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_solid, 1, 10, 20)); txtannot.SetEndingStyle(Line.EndingStyle.e_ClosedArrow); txtannot.SetColor(new ColorPt(0, 1, 0)); txtannot.SetQuaddingFormat(1); first_page.AnnotPushBack(txtannot); txtannot.RefreshAppearance(); } { FreeText txtannot = FreeText.Create(doc, new Rect(400, 10, 550, 400)); txtannot.SetContents("\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." + "\n\nAha!\n\nAnd there was much rejoicing!"); txtannot.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_solid, 1, 10, 20)); txtannot.SetColor(new ColorPt(0, 0, 1)); txtannot.SetOpacity(0.2); txtannot.SetQuaddingFormat(2); first_page.AnnotPushBack(txtannot); txtannot.RefreshAppearance(); } Page page = doc.PageCreate(new Rect(0, 0, 600, 600)); doc.PagePushBack(page); ew.Begin(page, ElementWriter.WriteMode.e_overlay, false); // begin writing to this page eb.Reset(); // Reset the GState to default ew.End(); // save changes to the current page { //Create a Line annotation... Line line = Line.Create(doc, new Rect(250, 250, 400, 400)); line.SetStartPoint(new Point(350, 270)); line.SetEndPoint(new Point(260, 370)); line.SetStartStyle(Line.EndingStyle.e_Square); line.SetEndStyle(Line.EndingStyle.e_Circle); line.SetColor(new ColorPt(.3, .5, 0), 3); line.SetContents("Dashed Captioned"); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); double[] dash = new double[2]; dash[0] = 2; dash[1] = 2.0; line.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_dashed, 2, 0, 0, dash)); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(347, 377, 600, 600)); line.SetStartPoint(new Point(385, 410)); line.SetEndPoint(new Point(540, 555)); line.SetStartStyle(Line.EndingStyle.e_Circle); line.SetEndStyle(Line.EndingStyle.e_OpenArrow); line.SetColor(new ColorPt(1, 0, 0), 3); line.SetInteriorColor(new ColorPt(0, 1, 0), 3); line.SetContents("Inline Caption"); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Inline); line.SetLeaderLineExtensionLength(-4); line.SetLeaderLineLength(-12); line.SetLeaderLineOffset(2); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(10, 400, 200, 600)); line.SetStartPoint(new Point(25, 426)); line.SetEndPoint(new Point(180, 555)); line.SetStartStyle(Line.EndingStyle.e_Circle); line.SetEndStyle(Line.EndingStyle.e_Square); line.SetColor(new ColorPt(0, 0, 1), 3); line.SetInteriorColor(new ColorPt(1, 0, 0), 3); line.SetContents("Offset Caption"); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); line.SetTextHOffset(-60); line.SetTextVOffset(10); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(200, 10, 400, 70)); line.SetStartPoint(new Point(220, 25)); line.SetEndPoint(new Point(370, 60)); line.SetStartStyle(Line.EndingStyle.e_Butt); line.SetEndStyle(Line.EndingStyle.e_OpenArrow); line.SetColor(new ColorPt(0, 0, 1), 3); line.SetContents("Regular Caption"); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(200, 70, 400, 130)); line.SetStartPoint(new Point(220, 111)); line.SetEndPoint(new Point(370, 78)); line.SetStartStyle(Line.EndingStyle.e_Circle); line.SetEndStyle(Line.EndingStyle.e_Diamond); line.SetContents("Circle to Diamond"); line.SetColor(new ColorPt(0, 0, 1), 3); line.SetInteriorColor(new ColorPt(0, 1, 0), 3); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(10, 100, 160, 200)); line.SetStartPoint(new Point(15, 110)); line.SetEndPoint(new Point(150, 190)); line.SetStartStyle(Line.EndingStyle.e_Slash); line.SetEndStyle(Line.EndingStyle.e_ClosedArrow); line.SetContents("Slash to CArrow"); line.SetColor(new ColorPt(1, 0, 0), 3); line.SetInteriorColor(new ColorPt(0, 1, 1), 3); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(270, 270, 570, 433)); line.SetStartPoint(new Point(300, 400)); line.SetEndPoint(new Point(550, 300)); line.SetStartStyle(Line.EndingStyle.e_RClosedArrow); line.SetEndStyle(Line.EndingStyle.e_ROpenArrow); line.SetContents("ROpen & RClosed arrows"); line.SetColor(new ColorPt(0, 0, 1), 3); line.SetInteriorColor(new ColorPt(0, 1, 0), 3); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(195, 395, 205, 505)); line.SetStartPoint(new Point(200, 400)); line.SetEndPoint(new Point(200, 500)); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(55, 299, 150, 301)); line.SetStartPoint(new Point(55, 300)); line.SetEndPoint(new Point(155, 300)); line.SetStartStyle(Line.EndingStyle.e_Circle); line.SetEndStyle(Line.EndingStyle.e_Circle); line.SetContents("Caption that's longer than its line."); line.SetColor(new ColorPt(1, 0, 1), 3); line.SetInteriorColor(new ColorPt(0, 1, 0), 3); line.SetShowCaption(true); line.SetCaptionPosition(Line.CapPos.e_Top); line.RefreshAppearance(); page.AnnotPushBack(line); } { Line line = Line.Create(doc, new Rect(300, 200, 390, 234)); line.SetStartPoint(new Point(310, 210)); line.SetEndPoint(new Point(380, 220)); line.SetColor(new ColorPt(0, 0, 0), 3); line.RefreshAppearance(); page.AnnotPushBack(line); } Page page3 = doc.PageCreate(new Rect(0, 0, 600, 600)); ew.Begin(page3); // begin writing to the page ew.End(); // save changes to the current page doc.PagePushBack(page3); { Circle circle = Circle.Create(doc, new Rect(300, 300, 390, 350)); circle.SetColor(new ColorPt(0, 0, 0), 3); circle.RefreshAppearance(); page3.AnnotPushBack(circle); } { Circle circle = Circle.Create(doc, new Rect(100, 100, 200, 200)); circle.SetColor(new ColorPt(0, 1, 0), 3); circle.SetInteriorColor(new ColorPt(0, 0, 1), 3); double[] dash = new double[2]; dash[0] = 2; dash[1] = 4; circle.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_dashed, 3, 0, 0, dash)); circle.SetPadding(new Rect(2, 2, 2, 2)); circle.RefreshAppearance(); page3.AnnotPushBack(circle); } { Square sq = Square.Create(doc, new Rect(10, 200, 80, 300)); sq.SetColor(new ColorPt(0, 0, 0), 3); sq.RefreshAppearance(); page3.AnnotPushBack(sq); } { Square sq = Square.Create(doc, new Rect(500, 200, 580, 300)); sq.SetColor(new ColorPt(1, 0, 0), 3); sq.SetInteriorColor(new ColorPt(0, 1, 1), 3); double[] dash = new double[2]; dash[0] = 4; dash[1] = 2; sq.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_dashed, 6, 0, 0, dash)); sq.SetPadding(new Rect(4, 4, 4, 4)); sq.RefreshAppearance(); page3.AnnotPushBack(sq); } { Polygon poly = Polygon.Create(doc, new Rect(5, 500, 125, 590)); poly.SetColor(new ColorPt(1, 0, 0), 3); poly.SetInteriorColor(new ColorPt(1, 1, 0), 3); poly.SetVertex(0, new Point(12, 510)); poly.SetVertex(1, new Point(100, 510)); poly.SetVertex(2, new Point(100, 555)); poly.SetVertex(3, new Point(35, 544)); poly.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_solid, 4, 0, 0)); poly.SetPadding(new Rect(4, 4, 4, 4)); poly.RefreshAppearance(); page3.AnnotPushBack(poly); } { PolyLine poly = PolyLine.Create(doc, new Rect(400, 10, 500, 90)); poly.SetColor(new ColorPt(1, 0, 0), 3); poly.SetInteriorColor(new ColorPt(0, 1, 0), 3); poly.SetVertex(0, new Point(405, 20)); poly.SetVertex(1, new Point(440, 40)); poly.SetVertex(2, new Point(410, 60)); poly.SetVertex(3, new Point(470, 80)); poly.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_solid, 2, 0, 0)); poly.SetPadding(new Rect(4, 4, 4, 4)); poly.SetStartStyle(Line.EndingStyle.e_RClosedArrow); poly.SetEndStyle(Line.EndingStyle.e_ClosedArrow); poly.RefreshAppearance(); page3.AnnotPushBack(poly); } { Link lk = Link.Create(doc, new Rect(5, 5, 55, 24)); //lk.SetColor( ColorPt(0,1,0), 3 ); lk.RefreshAppearance(); page3.AnnotPushBack(lk); } Page page4 = doc.PageCreate(new Rect(0, 0, 600, 600)); ew.Begin(page4); // begin writing to the page ew.End(); // save changes to the current page doc.PagePushBack(page4); { ew.Begin(page4); Font font = Font.Create(doc, Font.StandardType1Font.e_helvetica); element = eb.CreateTextBegin(font, 16); element.SetPathFill(true); ew.WriteElement(element); element = eb.CreateTextRun("Some random text on the page", font, 16); element.SetTextMatrix(1, 0, 0, 1, 100, 500); ew.WriteElement(element); ew.WriteElement(eb.CreateTextEnd()); ew.End(); } { Highlight hl = Highlight.Create(doc, new Rect(100, 490, 150, 515)); hl.SetColor(new ColorPt(0, 1, 0), 3); hl.RefreshAppearance(); page4.AnnotPushBack(hl); } { Squiggly sq = Squiggly.Create(doc, new Rect(100, 450, 250, 600)); //sq.SetColor( ColorPt(1,0,0), 3 ); sq.SetQuadPoint(0, new QuadPoint(new Point(122, 455), new Point(240, 545), new Point(230, 595), new Point(101, 500))); sq.RefreshAppearance(); page4.AnnotPushBack(sq); } { Caret cr = Caret.Create(doc, new Rect(100, 40, 129, 69)); cr.SetColor(new ColorPt(0, 0, 1), 3); cr.SetSymbol("P"); cr.RefreshAppearance(); page4.AnnotPushBack(cr); } Page page5 = doc.PageCreate(new Rect(0, 0, 600, 600)); ew.Begin(page5); // begin writing to the page ew.End(); // save changes to the current page doc.PagePushBack(page5); Page page6 = doc.PageCreate(new Rect(0, 0, 600, 600)); ew.Begin(page6); // begin writing to the page ew.End(); // save changes to the current page doc.PagePushBack(page6); { Text txt = Text.Create(doc, new Rect(10, 20, 30, 40)); txt.SetIcon("UserIcon"); txt.SetContents("User defined icon, unrecognized by appearance generator"); txt.SetColor(new ColorPt(0, 1, 0)); txt.RefreshAppearance(); page6.AnnotPushBack(txt); } { Ink ink = Ink.Create(doc, new Rect(100, 400, 200, 550)); ink.SetColor(new ColorPt(0, 0, 1)); ink.SetPoint(1, 3, new Point(220, 505)); ink.SetPoint(1, 0, new Point(100, 490)); ink.SetPoint(0, 1, new Point(120, 410)); ink.SetPoint(0, 0, new Point(100, 400)); ink.SetPoint(1, 2, new Point(180, 490)); ink.SetPoint(1, 1, new Point(140, 440)); ink.SetBorderStyle(new Annot.BorderStyle(Annot.BorderStyle.Style.e_solid, 3, 0, 0)); ink.RefreshAppearance(); page6.AnnotPushBack(ink); } Page page7 = doc.PageCreate(new Rect(0, 0, 600, 600)); ew.Begin(page7); // begin writing to the page ew.End(); // save changes to the current page doc.PagePushBack(page7); { Sound snd = Sound.Create(doc, new Rect(100, 500, 120, 520)); snd.SetColor(new ColorPt(1, 1, 0)); snd.SetIcon(Sound.Icon.e_Speaker); snd.RefreshAppearance(); page7.AnnotPushBack(snd); } { Sound snd = Sound.Create(doc, new Rect(200, 500, 220, 520)); snd.SetColor(new ColorPt(1, 1, 0)); snd.SetIcon(Sound.Icon.e_Mic); snd.RefreshAppearance(); page7.AnnotPushBack(snd); } Page page8 = doc.PageCreate(new Rect(0, 0, 600, 600)); ew.Begin(page8); // begin writing to the page ew.End(); // save changes to the current page doc.PagePushBack(page8); for (int ipage = 0; ipage < 2; ++ipage) { double px = 5, py = 520; for (RubberStamp.Icon istamp = RubberStamp.Icon.e_Approved; istamp <= RubberStamp.Icon.e_Draft; istamp = (RubberStamp.Icon)((int)(istamp) + 1)) { RubberStamp stmp = RubberStamp.Create(doc, new Rect(1, 1, 100, 100)); stmp.SetIcon(istamp); stmp.SetContents(stmp.GetIconName()); stmp.SetRect(new Rect(px, py, px + 100, py + 25)); py -= 100; if (py < 0) { py = 520; px += 200; } if (ipage == 0) { //page7.AnnotPushBack( st ); ; } else { page8.AnnotPushBack(stmp); stmp.RefreshAppearance(); } } } RubberStamp st = RubberStamp.Create(doc, new Rect(400, 5, 550, 45)); st.SetIcon("UserStamp"); st.SetContents("User defined stamp"); page8.AnnotPushBack(st); st.RefreshAppearance(); }
public Control CreateControl(ControlType controlType) { var result = default(Control); switch (controlType) { case ControlType.FreeText: result = new FreeText { ControlType = ControlType.FreeText, Text = Resource.FreeTextDefaultText, FontSize = 12, Color = "#000000", Strong = false }; break; case ControlType.TextBox: result = new TextBox { ControlType = ControlType.TextBox, Label = Resource.TextBoxLabel, Size = 200, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { ValidationType = ValidationType.Required, IsRequired = false }, new ValidationRules.Length { ValidationType = ValidationType.Length } } }; break; case ControlType.Number: result = new Number { ControlType = ControlType.Number, Label = Resource.NumberLabel, Size = 200, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { ValidationType = ValidationType.Required, IsRequired = false }, new ValidationRules.Length { ValidationType = ValidationType.Length }, new ValidationRules.Number { ValidationType = ValidationType.Number } } }; break; case ControlType.Email: result = new Email { ControlType = ControlType.Number, Label = Resource.EmailLabel, Size = 200, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { ValidationType = ValidationType.Required, IsRequired = false }, new ValidationRules.Length { ValidationType = ValidationType.Length }, new ValidationRules.Email { ValidationType = ValidationType.Email } } }; break; case ControlType.FormattedNumber: result = new FormattedNumber { ControlType = ControlType.FormattedNumber, Label = Resource.FormattedNumberLabel, Separator = FormSettings.DEFAULT_FORMAT_SEPARATOR, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { ValidationType = ValidationType.Required, IsRequired = false }, new ValidationRules.FormattedNumber { ValidationType = ValidationType.FormattedNumber } } }; break; case ControlType.DropDown: result = new DropDown { ControlType = ControlType.DropDown, Label = Resource.DropDownLabel, Value = 0.ToString(), EmptyOption = new Option{Id = -1, Value = string.Empty}, Options = new List<Option> { new Option{Id = 1, Value = Resource.FirstOption}, new Option{Id = 2, Value = Resource.SecondOption}, new Option{Id = 3, Value = Resource.ThirdOption} }, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { IsRequired = false, ValidationType = ValidationType.Required } } }; break; case ControlType.CheckList: result = new CheckList { ControlType = ControlType.CheckList, Label = Resource.CheckListLabel, OptionLayoutType = OptionLayoutType.OneColumn, SelectedValues = new List<int>{}, Options = new List<Option> { new Option{Id = 1, Value = Resource.FirstOption}, new Option{Id = 2, Value = Resource.SecondOption}, new Option{Id = 3, Value = Resource.ThirdOption} }, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { IsRequired = false, ValidationType = ValidationType.Required } } }; break; case ControlType.OptionList: result = new OptionList { ControlType = ControlType.OptionList, Label = Resource.OptionListLabel, OptionLayoutType = OptionLayoutType.OneColumn, AllowOther = false, OtherValue = string.Empty, OtherOption = new Option { Id = -1, Value = Resource.OtherValue }, Options = new List<Option> { new Option{Id = 1, Value = Resource.FirstOption}, new Option{Id = 2, Value = Resource.SecondOption}, new Option{Id = 3, Value = Resource.ThirdOption} }, ValidationRules = new List<ValidationRule> { new ValidationRules.Required { IsRequired = false, ValidationType = ValidationType.Required } } }; break; default: throw new Exception(Resource.InvalidControlType); break; } return result; }
private void DoSaveForm(object obj) { try { string outMsg = string.Empty; if (!string.IsNullOrEmpty(FreeText.Trim()) || !string.IsNullOrEmpty(CVT)) { if (!RV.ValidateRsnFreetext(FreeText, ReactionVM, StageVM, RsnLevel, out outMsg)) { AppInfoBox.ShowInfoMessage(outMsg); return; } if (RV.ValidateRsnReactionLevel(ReactionVM, StageVM, RsnLevel, CVT, FreeText, Rsns.ToList(), out outMsg, EditingRsn)) { if (EditingRsn != null) { EditingRsn.CvtText = CVT; EditingRsn.IsIgnorableInDelivery = IsIgnorableInDelivery; EditingRsn.FreeText = FreeText.Trim().TrimEnd('.'); EditingRsn.Stage = RsnLevel == RsnLevel.STAGE ? StageVM : null; UpdateRsnLengths(); } else { var rsn = new RsnVM { }; rsn.CvtText = CVT; rsn.IsIgnorableInDelivery = IsIgnorableInDelivery; rsn.FreeText = FreeText.Trim().TrimEnd('.'); rsn.Reaction = ReactionVM; rsn.Id = Guid.NewGuid(); rsn.Stage = RsnLevel == RsnLevel.STAGE ? StageVM : null; rsn.RSNWindowVM = this; Rsns.Add(rsn); } } else { AppInfoBox.ShowInfoMessage(outMsg); return; } if (Rsns.Where(rsn => rsn.CvtText.SafeEqualsLower(S.ENZYMIC_CVT)).Count() > 0 && Rsns.Where(rsn => rsn.CvtText.SafeEqualsLower(S.BIOTRANSFORMATION_CVT)).Count() == 0) { var enzymicRSN = Rsns.Where(rsn => rsn.CvtText.SafeEqualsLower(S.ENZYMIC_CVT)).FirstOrDefault(); string freeTextToAdd = !string.IsNullOrEmpty(enzymicRSN.FreeText) ? RV.GetStageInfoWithOutFreeText(enzymicRSN.FreeText) : string.Empty; Rsns.Add(new RsnVM { CvtText = S.BIOTRANSFORMATION_CVT, FreeText = RsnLevel == RsnLevel.STAGE ? $"{S.BIOTRANSFORMATION_FREETEXT} {freeTextToAdd}" : string.Empty, IsRXN = true, Stage = enzymicRSN.Stage != null ? enzymicRSN.Stage : null, Reaction = ReactionVM, RSNWindowVM = this, Id = Guid.NewGuid() }); } ClearEditForm.Execute(this); } else { AppInfoBox.ShowInfoMessage("Either CVT or FreeText mandatory to save RSN"); } } catch (Exception ex) { Log.This(ex); AppErrorBox.ShowErrorMessage(ex.Message, ex.ToString()); } }
/// <summary> /// Get the hashcode of this object. /// </summary> public override Int32 GetHashCode() { return(FreeText.GetHashCode()); }