protected void Page_Load(object sender, EventArgs e) { ImageMap1.ImageUrl = @"~/Images/chart.png"; ImageMap1.AlternateText = "This is chart"; ImageMap1.HotSpotMode = HotSpotMode.PostBack; CircleHotSpot chs = new CircleHotSpot(); chs.X = 75; chs.Y = 75; chs.Radius = 6; chs.PostBackValue = "Circle HotSpot"; ImageMap1.HotSpots.Add(chs); RectangleHotSpot rhs = new RectangleHotSpot(); rhs.Top = 101; rhs.Bottom = 110; rhs.Left = 74; rhs.Right = 110; rhs.PostBackValue = "RectangleHotSpot"; ImageMap1.HotSpots.Add(rhs); PolygonHotSpot phs = new PolygonHotSpot(); phs.Coordinates = "76,57,82,64,81,76,76,82,71,76,70,63"; phs.PostBackValue = "PolygonHotSpot"; ImageMap1.HotSpots.Add(phs); }
public void ImageMap_AssignedValues_RenderNavigateShapes() { // Rectangle/Polygon.HotSpotMode = Navigate //----------------------------------------- PokerImageMap imageMap = new PokerImageMap(); imageMap.Enabled = true; imageMap.HotSpotMode = HotSpotMode.NotSet; RectangleHotSpot rect = new RectangleHotSpot(); rect.AccessKey = "R"; rect.AlternateText = "Rectangle"; rect.HotSpotMode = HotSpotMode.Navigate; rect.NavigateUrl = "NavigateUrlRect"; rect.TabIndex = 1; rect.Bottom = 10; rect.Top = 20; rect.Left = 30; rect.Right = 40; imageMap.HotSpots.Add(rect); imageMap.HotSpotMode = HotSpotMode.Navigate; PolygonHotSpot poly = new PolygonHotSpot(); poly.AccessKey = "P"; poly.AlternateText = "Polygon"; poly.NavigateUrl = "NavigateUrlPoly"; poly.TabIndex = 2; poly.Coordinates = "10,20,30,40,50,60,100,200"; imageMap.HotSpots.Add(poly); string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\">\r\n\t<area shape=\"rect\" coords=\"30,20,40,10\" href=\"NavigateUrlRect\" title=\"Rectangle\" alt=\"Rectangle\" accesskey=\"R\" tabindex=\"1\" /><area shape=\"poly\" coords=\"10,20,30,40,50,60,100,200\" href=\"NavigateUrlPoly\" title=\"Polygon\" alt=\"Polygon\" accesskey=\"P\" tabindex=\"2\" />\r\n</map>"; HtmlDiff.AssertAreEqual(imageMap.Render(), originalHtml, "RenderNavigateShapesTextAssigned"); }
public static void myPageLoad(Page page) { WebTest.CurrentTest.UserData = "Init"; ImageMap imgmap = new ImageMap(); imgmap.ID = "imgmap"; imgmap.HotSpotMode = HotSpotMode.NotSet; imgmap.Click += new ImageMapEventHandler(ImageMapClickHandler2); RectangleHotSpot rect = new RectangleHotSpot(); rect.HotSpotMode = HotSpotMode.PostBack; rect.PostBackValue = "Rectangle"; imgmap.HotSpots.Add(rect); PolygonHotSpot poly = new PolygonHotSpot(); poly.HotSpotMode = HotSpotMode.PostBack; poly.PostBackValue = "Polygon"; imgmap.HotSpots.Add(poly); imgmap.HotSpotMode = HotSpotMode.PostBack; CircleHotSpot circle = new CircleHotSpot(); circle.PostBackValue = "Circle"; imgmap.HotSpots.Add(circle); // Two marks for getting controls from form LiteralControl lcb = new LiteralControl(HtmlDiff.BEGIN_TAG); LiteralControl lce = new LiteralControl(HtmlDiff.END_TAG); page.Form.Controls.Add(lcb); page.Form.Controls.Add(imgmap); page.Form.Controls.Add(lce); }
protected void BindHotSpot1(ImageMap mapAreas) { DataTable dt = new DataTable(); dt = cls.ReturnDataTable("Select_HomeAddImageMap"); if (dt.Rows.Count > 0) { mapAreas.ImageUrl = dt.Rows[0]["ImageBanner"].ToString(); foreach (DataRow dr in dt.Rows) { hotSpot = new RectangleHotSpot(); hotSpot.HotSpotMode = HotSpotMode.Inactive; hotSpot.Left = Convert.ToInt32(dr["left_co"]); hotSpot.Top = Convert.ToInt32(dr["top_co"]); hotSpot.Right = Convert.ToInt32(dr["right_co"]); hotSpot.Bottom = Convert.ToInt32(dr["bottom_co"]); if (dr["ProductId"].ToString() == "0") { hotSpot.NavigateUrl = dr["Url"].ToString(); hotSpot.Target = "_blank"; } else { hotSpot.NavigateUrl = "ProductDetail.aspx?pid=" + Convert.ToInt32(dr["ProductId"]) + ""; } hotSpot.HotSpotMode = HotSpotMode.Navigate; mapAreas.HotSpots.Add(hotSpot); } } }
public void RectangleHotSpot_DefaultProperties() { RectangleHotSpot rect = new RectangleHotSpot(); Assert.AreEqual(0, rect.Bottom, "Bottom"); Assert.AreEqual(0, rect.Top, "Top"); Assert.AreEqual(0, rect.Left, "Left"); Assert.AreEqual(0, rect.Right, "Right"); }
private RectangleHotSpot GetHotSpot(string name, int left, int top, int right, int bottom) { RectangleHotSpot rhs = new RectangleHotSpot(); rhs.PostBackValue = name; rhs.Left = left; rhs.Top = top; rhs.Right = right; rhs.Bottom = bottom; return rhs; }
protected void Button5_Click(object sender, EventArgs e) { RectangleHotSpot hs = new RectangleHotSpot(); hs.Left = 0; hs.Right = 200; hs.Top = 300; hs.Bottom = 400; hs.NavigateUrl = "http://www.taobao.com"; hs.AlternateText = "进入淘宝网"; //ImageMap1.im ImageMap1.HotSpots.Add(hs); }
protected void Button1_Click(object sender, EventArgs e) { RectangleHotSpot ha = new RectangleHotSpot(); ha.Left = 0; ha.Right = 200; ha.Top = 300; ha.Bottom = 400; ha.NavigateUrl = "http://www.taobao.com"; ha.AlternateText = "淘宝"; imgMap.HotSpots.Add(ha); }
private RectangleHotSpot GetHotSpot(String name, int left, int top, int right, int bottom) { RectangleHotSpot rhs = new RectangleHotSpot(); rhs.PostBackValue = name; rhs.Left = left; rhs.Top = top; rhs.Right = right; rhs.Bottom = bottom; return(rhs); }
public void HotSpotCollection_Insert() { HotSpotCollection spots = new HotSpotCollection(); spots.Add(new CircleHotSpot()); spots.Add(new CircleHotSpot()); Assert.AreEqual(2, spots.Count, "BeforeInsert"); RectangleHotSpot rect = new RectangleHotSpot(); spots.Insert(1, rect); Assert.AreEqual(3, spots.Count, "AfterInsert"); Assert.AreEqual(rect.ToString(), spots[1].ToString(), "AfterInsert"); }
public void HotSpotCollection_Remove() { HotSpotCollection spots = new HotSpotCollection(); spots.Add(new CircleHotSpot()); RectangleHotSpot rect = new RectangleHotSpot(); spots.Add(rect); spots.Add(new CircleHotSpot()); Assert.AreEqual(3, spots.Count, "BeforeRemove"); spots.Remove(rect); Assert.AreEqual(2, spots.Count, "AfterRemove"); }
protected void btn_7_Click(object sender, EventArgs e) { RectangleHotSpot rs = new RectangleHotSpot(); rs.Left = 30; rs.Top = 60; rs.Right = 70; rs.Bottom = 100; rs.NavigateUrl = "http://www.163.com/"; rs.AlternateText = "网易"; ImageMap1.HotSpots.Add(rs); }
public static void PostBackFireEvent_Init(Page p) { ImageMap imgmap = new ImageMap(); imgmap.ID = "imgmap"; imgmap.HotSpotMode = HotSpotMode.NotSet; imgmap.Click += new ImageMapEventHandler(ImageMapClickHandler3); RectangleHotSpot rect = new RectangleHotSpot(); rect.HotSpotMode = HotSpotMode.PostBack; rect.PostBackValue = "Rectangle"; imgmap.HotSpots.Add(rect); p.Form.Controls.Add(imgmap); }
public void RectangleHotSpot_GetCoordinates() { RectangleHotSpot rect = new RectangleHotSpot(); rect.Bottom = 10; rect.Top = 20; rect.Left = 30; rect.Right = 50; Assert.AreEqual(10, rect.Bottom, "BeforeGetCoordinates-Bottom"); Assert.AreEqual(20, rect.Top, "BeforeGetCoordinates-Top"); Assert.AreEqual(30, rect.Left, "BeforeGetCoordinates-Left"); Assert.AreEqual(50, rect.Right, "BeforeGetCoordinates-Right"); Assert.AreEqual("30,20,50,10", rect.GetCoordinates(), "AfterGetCoordinates"); }
public void ImageMap_EventRectangle() { PokerImageMap imageMap = new PokerImageMap(); ResetEvents(); imageMap.HotSpotMode = HotSpotMode.PostBack; RectangleHotSpot rect = new RectangleHotSpot(); rect.PostBackValue = "myRect"; imageMap.HotSpots.Add(rect); imageMap.Click += new ImageMapEventHandler(ImageMapClickHandler); Assert.AreEqual("Init", pbValue, "BeforeClick"); imageMap.DoOnClick(new ImageMapEventArgs(rect.PostBackValue)); Assert.AreEqual("myRect", pbValue, "AfterClick"); }
protected void ArrangeMapHotSpots(ImageMap imgmap, ListItem item, int QuestionID) { RectangleHotSpot hotSpot; string[] leftright = item.Text.ToString().Split(','); hotSpot = new RectangleHotSpot(); hotSpot.HotSpotMode = HotSpotMode.Navigate; hotSpot.AlternateText = item.Value.ToString(); hotSpot.Left = Convert.ToInt32(leftright[0]); hotSpot.Right = Convert.ToInt32(leftright[2]); hotSpot.Top = Convert.ToInt32(leftright[1]); hotSpot.Bottom = Convert.ToInt32(leftright[3]); hotSpot.NavigateUrl = "javascript:setCordinator(" + QuestionID + "," + item.Value.ToString() + ");"; imgmap.HotSpots.Add(hotSpot); }
private void Refresh() { MapImage.ImageUrl = MakeURL(); MapImage.BackColor = Color.Black; int w = (int)ViewState["w"]; int h = (int)ViewState["h"]; MapImage.Width = w; MapImage.Height = h; int w1 = w / 3; int w2 = w * 2 / 3; int h1 = h / 3; int h2 = h * 2 / 3; foreach (HotSpot hotSpot in MapImage.HotSpots) { RectangleHotSpot rect = hotSpot as RectangleHotSpot; if (rect == null) { return; } switch (rect.PostBackValue) { case "0": rect.Left = 0; rect.Right = w1; rect.Top = 0; rect.Bottom = h1; break; case "1": rect.Left = w1; rect.Right = w2; rect.Top = 0; rect.Bottom = h1; break; case "2": rect.Left = w2; rect.Right = w; rect.Top = 0; rect.Bottom = h1; break; case "3": rect.Left = 0; rect.Right = w1; rect.Top = h1; rect.Bottom = h2; break; case "4": rect.Left = w1; rect.Right = w2; rect.Top = h1; rect.Bottom = h2; break; case "5": rect.Left = w2; rect.Right = w; rect.Top = h1; rect.Bottom = h2; break; case "6": rect.Left = 0; rect.Right = w1; rect.Top = h2; rect.Bottom = h; break; case "7": rect.Left = w1; rect.Right = w2; rect.Top = h2; rect.Bottom = h; break; case "8": rect.Left = w2; rect.Right = w; rect.Top = h2; rect.Bottom = h; break; } } }
public void HotSpotCollection_RemoveAt() { HotSpotCollection spots = new HotSpotCollection(); CircleHotSpot circle1 = new CircleHotSpot(); spots.Add(circle1); RectangleHotSpot rect = new RectangleHotSpot(); spots.Add(rect); CircleHotSpot circle2 = new CircleHotSpot(); spots.Add(circle2); Assert.AreEqual(3, spots.Count, "BeforeRemoveAt"); spots.RemoveAt(1); Assert.AreEqual(2, spots.Count, "AfterRemoveAt"); Assert.AreEqual(circle1.ToString(), spots[0].ToString(), "AfterRemoveAt"); Assert.AreEqual(circle2.ToString(), spots[1].ToString(), "AfterRemoveAt"); }
protected void BindHotSpot(string scid) { DataTable dt = new DataTable(); dt = cls.ReturnDataTable("Select_HomeAdvImageMap", new SqlParameter("@AdvId", scid)); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { hotSpot = new RectangleHotSpot(); hotSpot.HotSpotMode = HotSpotMode.Inactive; hotSpot.Left = Convert.ToInt32(dr["left_co"]); hotSpot.Top = Convert.ToInt32(dr["top_co"]); hotSpot.Right = Convert.ToInt32(dr["right_co"]); hotSpot.Bottom = Convert.ToInt32(dr["bottom_co"]); mapAreas.HotSpots.Add(hotSpot); } } }
protected void BindHotSpot(ImageMap mapAreas) { DataTable dt = new DataTable(); dt = cls.ReturnDataTable("Select_SubCategoryImageMap", new SqlParameter("@SubCategoryId", scid)); if (dt.Rows.Count > 0) { mapAreas.ImageUrl = dt.Rows[0]["ImageBanner"].ToString(); foreach (DataRow dr in dt.Rows) { hotSpot = new RectangleHotSpot(); hotSpot.HotSpotMode = HotSpotMode.Inactive; hotSpot.Left = Convert.ToInt32(dr["left_co"]); hotSpot.Top = Convert.ToInt32(dr["top_co"]); hotSpot.Right = Convert.ToInt32(dr["right_co"]); hotSpot.Bottom = Convert.ToInt32(dr["bottom_co"]); hotSpot.NavigateUrl = "ProductDetail.aspx?pid=" + Convert.ToInt32(dr["ProductId"]) + ""; hotSpot.HotSpotMode = HotSpotMode.Navigate; mapAreas.HotSpots.Add(hotSpot); } } }
protected void Unnamed2_Click(object sender, EventArgs e) { myImageMap.ImageUrl = "https://i.pinimg.com/originals/69/d5/fe/69d5fed4b68abeb9873bb1a45c4acbb4.jpg";; myImageMap.HotSpotMode = HotSpotMode.PostBack; myImageMap.AlternateText = "Image is not available"; RectangleHotSpot hs1 = new RectangleHotSpot(); hs1.Top = 0; hs1.Bottom = 100; hs1.Left = 0; hs1.Right = 100; hs1.PostBackValue = "up"; myImageMap.HotSpots.Add(hs1); RectangleHotSpot hs2 = new RectangleHotSpot(); hs2.Top = 101; hs2.Bottom = 200; hs2.Left = 0; hs2.Right = 100; hs2.PostBackValue = "middle"; myImageMap.HotSpots.Add(hs2); RectangleHotSpot hs3 = new RectangleHotSpot(); hs3.Top = 201; hs3.Bottom = 300; hs3.Left = 0; hs3.Right = 100; hs3.PostBackValue = "down"; myImageMap.HotSpots.Add(hs3); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } #region " AdRotator " AdRotator1.Height = 100; AdRotator1.Width = 100; AdRotator1.AdvertisementFile = "AdRotatorControlTestData.xml"; AdRotator1.BorderColor = Color.Black; AdRotator1.BorderStyle = BorderStyle.Solid; AdRotator1.BorderWidth = 2; #endregion #region " BulletedList " //todo: for BulletedList, the third part of the triplet appears to be if the item is enabled. Could improve Glimpse visualizer for this. BulletedList1.Items.Add(new ListItem("Item Zero", "A")); BulletedList1.Items.Add(new ListItem("Item One", "B")); BulletedList1.Items.Add(new ListItem("Item Two", "C")); BulletedList1.Items.Add(new ListItem("Item Three (disabled)", "D")); BulletedList1.Items[3].Enabled = false; #endregion #region " Button " Button1.Text = "I am Button1"; Button1.ToolTip = "Button1 Tooltip is here."; Button1.Width = 300; Button1.Height = 80; Button1.BackColor = Color.Red; Button1.ForeColor = Color.Blue; #endregion #region " Calendar " Calendar1.DayNameFormat = DayNameFormat.FirstTwoLetters; Calendar1.FirstDayOfWeek = FirstDayOfWeek.Monday; Calendar1.Caption = "Super calendar!"; #endregion #region " Checkbox " CheckBox1Checked.Checked = true; CheckBox1Checked.Text = "This is a checked Checkbox."; CheckBox2UnChecked.Checked = false; CheckBox2UnChecked.Text = "This is an unchecked Checkbox."; #endregion #region " CheckboxList " CheckBoxList1.Items.Add(new ListItem("Item Zero (default)", "A")); CheckBoxList1.Items.Add(new ListItem("Item One (selected)", "B")); CheckBoxList1.Items.Add(new ListItem("Item Two (not selected)", "C")); CheckBoxList1.Items.Add(new ListItem("Item Three (disabled)", "D")); CheckBoxList1.Items[1].Selected = true; CheckBoxList1.Items[2].Selected = false; CheckBoxList1.Items[3].Enabled = false; #endregion #region " DropDownList " DropDownList1.Items.Add(new ListItem("Item Zero (default)", "A")); DropDownList1.Items.Add(new ListItem("Item One (selected)", "B")); DropDownList1.Items.Add(new ListItem("Item Two (not selected)", "C")); DropDownList1.Items.Add(new ListItem("Item Three (disabled)", "D")); DropDownList1.Items[1].Selected = true; DropDownList1.Items[2].Selected = false; DropDownList1.Items[3].Enabled = false; #endregion #region " FileUpload " FileUpload1.AllowMultiple = true; FileUpload1.Height = 80; FileUpload1.Width = 300; FileUpload1.ToolTip = "this is a file uploader"; #endregion #region " HiddenField " HiddenField1.Value = "this is a hidden field."; #endregion #region " Hyperlink " HyperLink1.ForeColor = Color.Gray; HyperLink1.NavigateUrl = "https://github.com/Glimpse/Glimpse"; HyperLink1.Text = "Go to Glimpse project site!"; #endregion #region " Image " Image1.ImageUrl = "/Images/logo.jpg"; Image1.AlternateText = "This is a logo"; Image1.DescriptionUrl = "this is the description URL... whatever that is."; #endregion #region " ImageButton " ImageButton1.ImageUrl = "/Images/logo.jpg"; ImageButton1.AlternateText = "This is a logo (ImageButton)"; ImageButton1.DescriptionUrl = "this is the description URL... whatever that is. (ImageButton)"; ImageButton1.PostBackUrl = "PopulatedControls.aspx?ImageButtonPostBack=1"; #endregion #region " ImageMap " ImageMap1.ImageUrl = "/Images/logo.jpg"; ImageMap1.HotSpotMode = HotSpotMode.PostBack; RectangleHotSpot hotSpot1 = new RectangleHotSpot(); hotSpot1.PostBackValue = "hotSpot 1"; hotSpot1.Top = 0; hotSpot1.Bottom = 101; hotSpot1.Left = 0; hotSpot1.Right = 181; hotSpot1.NavigateUrl = "PopulatedControls.aspx"; ImageMap1.HotSpots.Add(hotSpot1); RectangleHotSpot hotSpot2 = new RectangleHotSpot(); hotSpot2.PostBackValue = "hotSpot 2"; hotSpot2.Top = 0; hotSpot2.Bottom = 101; hotSpot2.Left = 182; hotSpot2.Right = 362; hotSpot2.NavigateUrl = "PopulatedControls.aspx"; ImageMap1.HotSpots.Add(hotSpot2); #endregion #region " Label " Label1.Text = "This is the best label. Ever."; Label1.ForeColor = Color.Orange; Label1.Font.Name = "Comic Sans MS"; Label1.Font.Size = 24; #endregion #region " LinkButton " LinkButton1.PostBackUrl = "PopulatedControls.aspx?LinkButton1Postback=1"; LinkButton1.Text = "This is a link button"; LinkButton1.Font.Italic = true; #endregion #region " ListBox " ListBox1.Items.Add(new ListItem("Item Zero (default)", "A")); ListBox1.Items.Add(new ListItem("Item One (selected)", "B")); ListBox1.Items.Add(new ListItem("Item Two (not selected)", "C")); ListBox1.Items.Add(new ListItem("Item Three (disabled)", "D")); ListBox1.Items[1].Selected = true; ListBox1.Items[2].Selected = false; ListBox1.Items[3].Enabled = false; ListBox1.BorderColor = Color.Blue; ListBox1.BorderStyle = BorderStyle.Dashed; ListBox1.BorderWidth = 3; #endregion #region " Literal " Literal1.Text = "<b>This is some literal content</b><pre>OH YEAH!!!" + Environment.NewLine + "This is on the next line.</pre>"; #endregion #region " Localize " Localize1.Mode = LiteralMode.Encode; #endregion #region " MultiView " //todo: The MultiView and View controls don't seem to have any sort of visibility into their data. MultiView1.ActiveViewIndex = 1; #endregion #region " Panel " Panel1.Width = 400; Panel1.Height = 200; Panel1.BorderColor = Color.Green; Panel1.BorderWidth = 5; Panel1.BorderStyle = BorderStyle.Inset; var panel1TextBox1 = new TextBox(); panel1TextBox1.ID = "panel1TextBox1"; panel1TextBox1.Text = "This is the panel1TextBox1 text value."; panel1TextBox1.Width = 300; Panel1.Controls.Add(panel1TextBox1); #endregion #region " PlaceHolder " var placeHolder1TextBox1 = new TextBox(); placeHolder1TextBox1.ID = "placeHolder1TextBox1"; placeHolder1TextBox1.Text = "This is the placeHolder1TextBox1 text value."; placeHolder1TextBox1.Width = 500; PlaceHolder1.Controls.Add(placeHolder1TextBox1); #endregion #region " RadioButton " RadioButton1.Checked = true; RadioButton2.Checked = false; RadioButton1.Text = "This is RadioButton1! The initial value is checked."; RadioButton2.Text = "This is RadioButton2! The initial value is not checked."; RadioButton3.Text = "This is RadioButton3! The initial value is not specified."; #endregion #region " RadioButtonList " RadioButtonList1.Items.Add(new ListItem("Item Zero (default)", "A")); RadioButtonList1.Items.Add(new ListItem("Item One (selected)", "B")); RadioButtonList1.Items.Add(new ListItem("Item Two (not selected)", "C")); RadioButtonList1.Items.Add(new ListItem("Item Three (disabled)", "D")); RadioButtonList1.Items[1].Selected = true; RadioButtonList1.Items[2].Selected = false; RadioButtonList1.Items[3].Enabled = false; RadioButtonList1.BorderColor = Color.Gray; RadioButtonList1.BorderStyle = BorderStyle.Outset; RadioButtonList1.BorderWidth = 2; #endregion #region " Substitution " Substitution1.Visible = true; #endregion #region " Table " Table1.Rows.Add(TableHeaderRowFromStringArray(new string[] { "Column 1 Header", "Column 2 Header", "Column 3 Header" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 A", "Field2", "Field3" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 B", "Field2", "Field3" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 C", "Field2", "Field3" })); #endregion #region " Textbox " TextBox1.Text = "This is a text box control."; TextBox1.ReadOnly = true; #endregion #region " View " var View1Label = new Label(); View1Label.Text = "This is the label inside the view... I am invisible because my parent View is supposed to be in a MultiView."; View1Label.Width = 100; View1.Controls.Add(View1Label); #endregion #region " Wizard " Wizard1.BackColor = Color.Honeydew; WizardStep1.AllowReturn = true; WizardStep2.AllowReturn = true; var WizardStep1TextBox1 = new TextBox(); WizardStep1TextBox1.Text = "This is Wizard step 0 checkbox 1."; WizardStep1.Controls.Add(WizardStep1TextBox1); var WizardStep2TextBox1 = new TextBox(); WizardStep2TextBox1.Text = "This is Wizard step 1 checkbox 1."; WizardStep2.Controls.Add(WizardStep2TextBox1); Wizard1.ActiveStepIndex = 0; #endregion #region " Xml " //todo: need to create an XSLT or else this will crash BrowserLink in VS2013. #endregion #region " HtmlButton " HtmlButton1.Value = "I am Html Button1"; #endregion #region " HtmlReset " HtmlReset1.Value = "I am Html Reset1"; #endregion #region " HtmlSubmit " HtmlSubmit1.Value = "I am Html Submit1"; #endregion #region " HtmlText " HtmlText1.Value = "I am Html Text1"; HtmlText1.Size = 100; #endregion #region " Html Input File " HtmlFile1.Accept = "text/xml"; #endregion #region " HtmlPassword " HtmlPassword1.Size = 200; HtmlPassword1.Value = "MyVoiceIsMyPassportVerifyMe"; #endregion #region " Html Input Checkbox " HtmlCheckbox1.Checked = true; HtmlCheckbox1.Name = "HtmlCheckbox1Name"; #endregion #region " Html Input Radio " HtmlRadio1.Checked = true; HtmlRadio1.Name = "HtmlRadio1Name"; #endregion #region " Html Input Hidden " HtmlHidden1.Value = "This is so hidden right now..."; HtmlHidden1.Name = "HtmlHidden1Name"; #endregion #region " Html Textarea " HtmlTextArea1.Value = "This is some multiline text.\nThis is line 2."; HtmlTextArea1.Name = "HtmlTextArea1Name"; #endregion #region " Html Table " var htmlTableRow1 = new System.Web.UI.HtmlControls.HtmlTableRow(); var htmlTableRow1Cell1 = new System.Web.UI.HtmlControls.HtmlTableCell(); htmlTableRow1Cell1.InnerText = "Cell1"; htmlTableRow1Cell1.BgColor = "green"; var htmlTableRow1Cell2 = new System.Web.UI.HtmlControls.HtmlTableCell(); htmlTableRow1Cell2.InnerText = "Cell2"; htmlTableRow1Cell2.BgColor = "pink"; htmlTableRow1.Cells.Add(htmlTableRow1Cell1); htmlTableRow1.Cells.Add(htmlTableRow1Cell2); HtmlTable.Rows.Add(htmlTableRow1); HtmlTable.Border = 1; HtmlTable.BorderColor = "gray"; #endregion #region " Html Image " HtmlImage1.Src = "~/Images/orderedList0.png"; HtmlImage1.Alt = "This is a zero picture. Sweet!"; #endregion #region " Html Select " HtmlSelect1.Items.Add(new ListItem("Item Zero (default)", "A")); HtmlSelect1.Items.Add(new ListItem("Item One (selected)", "B")); HtmlSelect1.Items.Add(new ListItem("Item Two (not selected)", "C")); HtmlSelect1.Items.Add(new ListItem("Item Three (disabled)", "D")); HtmlSelect1.Items[1].Selected = true; HtmlSelect1.Items[2].Selected = false; HtmlSelect1.Items[3].Enabled = false; #endregion #region " Html Horizontal Rule " horizontalRule1.InnerText = "Server side Horizontal Rules are the wave of the future."; horizontalRule1.Style.Add(HtmlTextWriterStyle.Color, "red"); horizontalRule1.EnableViewState = true; #endregion #region " Html Div " HtmlDiv1.InnerText = "This is some text inside this server-side div."; HtmlDiv1.EnableViewState = true; #endregion #region " Chart " Chart1.Series["Series1"].Points.DataBindY(PopulatedControls.GetSmallSampleNumericData()); Chart1.BackColor = Color.BlanchedAlmond; System.Diagnostics.Debug.Print(Chart1.ViewStateMode.ToString()); #endregion }
public void RectangleHotSpot_ToString() { RectangleHotSpot rect = new RectangleHotSpot(); Assert.AreEqual("RectangleHotSpot", rect.ToString(), "After-ToString"); }
private Bitmap drawDiagram() { Bitmap b; int maxY = 0; //Get the max y coordinate for (int i = 0; i < _nodes.Count; i++) { if (i == 0) { maxY = _nodes[i].Coordinates.Y; } else { maxY = Math.Max(maxY, _nodes[i].Coordinates.Y); } } b = new Bitmap(_imageWidth, maxY + (DIAGRAM_MARGIN * 2)); using (Graphics graphics = Graphics.FromImage(b)) { //Let's make this look nice graphics.SmoothingMode = SmoothingMode.AntiAlias; graphics.TextRenderingHint = TextRenderingHint.AntiAlias; Pen blackPen = new Pen(Color.Black); SolidBrush whiteBrush = new SolidBrush(Color.White); SolidBrush blackBrush = new SolidBrush(Color.Black); Font textFont = new Font("Arial", 8, GraphicsUnit.Point); //Draw the connections for (int i = 0; i < _connections.Count; i++) { blackPen.Width = (float)_connections[i].ConnectorWidth; graphics.DrawLine(blackPen, _connections[i].FirstNode.Coordinates, _connections[i].SecondNode.Coordinates); } _hotspots = new List <HotSpot>(); //Draw the rectangles & text for (int i = 0; i < _nodes.Count; i++) { SizeF textSize; Rectangle textRect; RectangleHotSpot spot; textSize = graphics.MeasureString(_nodes[i].Text, textFont); textRect = new Rectangle(); textRect.X = (int)Math.Round(_nodes[i].Coordinates.X - (textSize.Width / 2F)) - 1; textRect.Y = (int)Math.Round(_nodes[i].Coordinates.Y - (textSize.Height / 2F)) - 1; textRect.Height = (int)Math.Round(textSize.Height + 2F); textRect.Width = (int)Math.Round(textSize.Width + 2F); spot = new RectangleHotSpot(); spot.Left = textRect.X - 1; spot.Top = textRect.Y - 1; spot.Right = textRect.X + textRect.Width + 1; spot.Bottom = textRect.Y + textRect.Height + 1; //Pass back the datasource list in the navigate URL. The caller will have to fill in the entire URL. spot.NavigateUrl = getConnectedDatasourceList(_nodes[i]); _hotspots.Add(spot); graphics.DrawRectangle(blackPen, textRect); graphics.FillRectangle(whiteBrush, textRect.X + 1, textRect.Y + 1, textRect.Width - 2, textRect.Height - 2); graphics.DrawString(_nodes[i].Text, textFont, blackBrush, textRect.X + 1, textRect.Y + 1); } } return(b); }
public void SetImageMap() { string[,] arrUser = new string[, ] { { "T", "강원구", "1990005", "62" }, { "T", "이성환", "2005004", "229" }, { "T", "최기홍", "1988004", "460" }, { "T", "김진철", "2009006", "674" }, { "M", "이지수", "2004038", "17" }, { "M", "서도원", "1994001", "50" }, { "M", "박재현", "1995006", "84" }, { "M", "박희재", "1996035", "118" }, { "M", "안병모", "1995002", "152" }, { "M", "정진욱", "1991012", "186" }, { "M", "이정한", "1995008", "218" }, { "M", "손현익", "1992032", "251" }, { "M", "김지선", "1992035", "284" }, { "M", "김상복", "1993031", "317" }, { "M", "최인환", "1990008", "350" }, { "M", "김대중", "1993020", "383" }, { "M", "이종화", "1987016", "0" }, { "M", "이시영", "1984016", "0" }, { "M", "홍순혁", "1993036", "0" }, { "M", "김판상", "1991022", "0" }, { "M", "김주경", "1988010", "0" }, { "M", "손창민", "1991018", "0" }, { "M", "한영채", "1984005", "0" }, { "M", "권세장", "1986002", "0" }, { "M", "김경중", "1990007", "0" }, { "M", "김동준", "1991009", "0" }, { "M", "고문열", "1996028", "0" }, }; ImageMap imgMap = new ImageMap(); imgMap.ImageUrl = "~/eis_kdgas/경동조직도.jpg"; RectangleHotSpot hs; int iRow = arrUser.Length / 4; int iPosLeft = 0; for (int i = 0; i < iRow; i++) { hs = new RectangleHotSpot(); hs.AlternateText = arrUser[i, 1]; hs.NavigateUrl = "SEM_Empl_R002.aspx?EMP_NO=" + arrUser[i, 2]; if (arrUser[i, 0].Equals("T")) { hs.Left = int.Parse(arrUser[i, 3]); hs.Top = iPosT_LV1; hs.Right = hs.Left + iWidth_LV1; hs.Bottom = iPosT_LV1 + iHeight_LV1; } else { iPosLeft += (iPosLeft == 0) ? iPosStart_LV2 : 33; hs.Left = iPosLeft; hs.Top = iPosT_LV2; hs.Right = hs.Left + iWidth_LV2; hs.Bottom = iPosT_LV2 + iHeight_LV2; } imgMap.HotSpots.Add(hs); } tdDigm.Controls.Add(imgMap); }
private void QueryPeptides(string ProteinID) { string PepIDURL = "<a href='PeptideInfo.aspx?QType=Peptide+ID&QValue={0}'>{1}</a>"; string strSQL = string.Format("select a.peptide_sequence, a.peptide_sequence,b.prevaa,b.nextaa,a.Molecular_weight,b.location,a.Enzyme_Specificity from peptide_tbl a, pp_relation_tbl b where a.peptide_sequence = b.peptide_sequence and b.location<> -1 and b.protein_id='{0}' order by b.location", DBInterface.SQLValidString(ProteinID)); DataSet result = DBInterface.QuerySQL2(strSQL); if (result != null) { for (int j = 0; j < result.Tables[0].Rows.Count; j++) { TableRow trCaption = new TableRow(); TableCell tcPepID = new TableCell(); string PeptideID = result.Tables[0].Rows[j].ItemArray[0].ToString(); tcPepID.Text = string.Format(PepIDURL, PeptideID, PeptideID); tcPepID.HorizontalAlign = HorizontalAlign.Left; trCaption.Cells.Add(tcPepID); TableCell tcPreAA = new TableCell(); tcPreAA.Text = result.Tables[0].Rows[j].ItemArray[2].ToString(); tcPreAA.HorizontalAlign = HorizontalAlign.Center; trCaption.Cells.Add(tcPreAA); //TableCell tcSequence = new TableCell(); //tcSequence.Text = result.Tables[0].Rows[j].ItemArray[1].ToString(); //tcSequence.HorizontalAlign = HorizontalAlign.Left; //trCaption.Cells.Add(tcSequence); TableCell tcNextAA = new TableCell(); tcNextAA.Text = result.Tables[0].Rows[j].ItemArray[3].ToString(); tcNextAA.HorizontalAlign = HorizontalAlign.Center; trCaption.Cells.Add(tcNextAA); TableCell tcMW = new TableCell(); tcMW.Text = result.Tables[0].Rows[j].ItemArray[4].ToString(); tcMW.HorizontalAlign = HorizontalAlign.Right; trCaption.Cells.Add(tcMW); TableCell tcFully = new TableCell(); tcFully.Text = result.Tables[0].Rows[j].ItemArray[5].ToString(); tcFully.HorizontalAlign = HorizontalAlign.Right; trCaption.Cells.Add(tcFully); TableCell tcEnzyme = new TableCell(); tcEnzyme.Text = result.Tables[0].Rows[j].ItemArray[6].ToString(); tcEnzyme.HorizontalAlign = HorizontalAlign.Right; trCaption.Cells.Add(tcEnzyme); tbPeptides.Rows.Add(trCaption); } lbDistinct_Peptides.Text = result.Tables[0].Rows.Count.ToString(); imgPeptides.ImageUrl = String.Format("ProSeqImage.aspx?PID={0}&L={1}&NO={2:F0}", ProteinID, lbSequence_Length.Text, result.Tables[0].Rows.Count); lbPeptideNumber.Text = string.Format("Totals: {0:F0}", result.Tables[0].Rows.Count); try { PeptidesImageInfo PIF = new PeptidesImageInfo(ProteinID, int.Parse(lbSequence_Length.Text), result.Tables[0].Rows.Count); int totalHeight = 0; ArrayList RectArray = PIF.ComputeTheValues(ref totalHeight); int j = 0; for (j = 0; j < result.Tables[0].Rows.Count; j++) { PeptidesImageInfo.PepRectInfo rect = (PeptidesImageInfo.PepRectInfo)RectArray[j]; RectangleHotSpot recthot = new RectangleHotSpot(); recthot.Left = rect.left; recthot.Right = rect.right; recthot.Top = rect.top; recthot.Bottom = rect.bottom; recthot.NavigateUrl = string.Format("PeptideInfo.aspx?QType=Peptide+ID&QValue={0}", rect.PepID); recthot.AlternateText = string.Format("{0}-{1}, {2}", rect.Location, rect.Location + rect.Length, rect.Sequence); imgPeptides.HotSpots.Add(recthot); } } catch (Exception ex) { } } }
private void InitializePageContent() { checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_5.gif"); for (int i = 0; i < checkoutheadergraphic.HotSpots.Count; i++) { RectangleHotSpot rhs = (RectangleHotSpot)checkoutheadergraphic.HotSpots[i]; if (rhs.NavigateUrl.IndexOf("shoppingcart") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.2", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("account") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.3", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("checkoutshipping") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.4", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("checkoutpayment") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.5", SkinID, ThisCustomer.LocaleSetting); } } if (!AppLogic.AppConfigBool("SkipShippingOnCheckout")) { checkoutheadergraphic.HotSpots[2].HotSpotMode = HotSpotMode.Navigate; if (AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { checkoutheadergraphic.HotSpots[2].NavigateUrl = "checkout1.aspx"; } else { checkoutheadergraphic.HotSpots[2].NavigateUrl = CommonLogic.IIF(cart.HasMultipleShippingAddresses(), "checkoutshippingmult.aspx", "checkoutshipping.aspx"); } } if (AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { checkoutheadergraphic.HotSpots[3].NavigateUrl = "checkout1.aspx"; } if (IsPayPalCheckout) { checkoutheadergraphic.HotSpots[1].HotSpotMode = HotSpotMode.Inactive; checkoutheadergraphic.HotSpots[2].NavigateUrl += string.Format("?PayPal={0}&token={1}", bool.TrueString, Request.QueryString["token"]); checkoutheadergraphic.HotSpots[3].HotSpotMode = HotSpotMode.Inactive; } string XmlPackageName = AppLogic.AppConfig("XmlPackage.CheckoutReviewPageHeader"); if (XmlPackageName.Length != 0) { XmlPackage_CheckoutReviewPageHeader.Text = "<br/>" + AppLogic.RunXmlPackage(XmlPackageName, base.GetParser, ThisCustomer, SkinID, String.Empty, null, true, true); } if (cart.HasMultipleShippingAddresses() || cart.HasRegistryItems()) { var splittedCarts = cart.SplitIntoMultipleOrdersByDifferentShipToAddresses(); foreach (var splitCart in splittedCarts) { splitCart.BuildSalesOrderDetails(litCouponEntered.Text); OrderSummary.Text += splitCart.RenderHTMLLiteral(new DefaultShoppingCartPageLiteralRenderer(RenderType.Review, litCouponEntered.Text)); //CartSummary.Text += splitCart.RenderHTMLLiteral(new CheckOutPaymentPageLiteralRenderer()); } } else { //If the shopping cart contains only Electronic Downloads or Services then pass a "false" parameter for computeFreight. if (cart.IsNoShippingRequired()) { cart.BuildSalesOrderDetails(false, true, litCouponEntered.Text); } else { cart.BuildSalesOrderDetails(litCouponEntered.Text); } string couponCode = string.Empty; if (!ThisCustomer.CouponCode.IsNullOrEmptyTrimmed()) { couponCode = ThisCustomer.CouponCode; } OrderSummary.Text = cart.RenderHTMLLiteral(new DefaultShoppingCartPageLiteralRenderer(RenderType.Review, "page.checkoutshippingordersummary.xml.config", couponCode)); } if (AppLogic.AppConfigBool("ShowEditAddressLinkOnCheckOutReview")) { pnlEditBillingAddress.Visible = true; pnlEditShippingAddress.Visible = true; imgBillingRedArrow.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/redarrow.gif"); imgShippingRedArrow.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/redarrow.gif"); } litBillingAddress.Text = ThisCustomer.PrimaryBillingAddress.DisplayString(true, true, true, "<br/>"); if (IsPayPalCheckout) { litPaymentMethod.Text = "PayPal Express Checkout"; } else { litPaymentMethod.Text = GetPaymentMethod(ThisCustomer.PrimaryBillingAddress); } if (cart.HasMultipleShippingAddresses() || (cart.HasRegistryItems() && cart.CartItems.Count > 1)) { litShippingAddress.Text = "<br/>Multiple Ship Addresses"; } else { Address shippingAddress = null; //added for PayPal ADDRESSOVERRIDE if (IsPayPalCheckout && !AppLogic.AppConfigBool("PayPalCheckout.OverrideAddress")) { if (!cart.HasShippableComponents()) { shippingAddress = ThisCustomer.PrimaryShippingAddress; } else { pp = new PayPalExpress(); var GetPayPalDetails = pp.GetExpressCheckoutDetails(Request.QueryString["token"]).GetExpressCheckoutDetailsResponseDetails; shippingAddress = new Address() { Name = GetPayPalDetails.PayerInfo.Address.Name, Address1 = GetPayPalDetails.PayerInfo.Address.Street1 + (GetPayPalDetails.PayerInfo.Address.Street2 != String.Empty ? Environment.NewLine : String.Empty) + GetPayPalDetails.PayerInfo.Address.Street2, City = GetPayPalDetails.PayerInfo.Address.CityName, State = GetPayPalDetails.PayerInfo.Address.StateOrProvince, PostalCode = GetPayPalDetails.PayerInfo.Address.PostalCode, Country = AppLogic.ResolvePayPalAddressCode(GetPayPalDetails.PayerInfo.Address.CountryName.ToString()), CountryISOCode = AppLogic.ResolvePayPalAddressCode(GetPayPalDetails.PayerInfo.Address.Country.ToString()), Phone = GetPayPalDetails.PayerInfo.ContactPhone }; } } else { if (cart.OnlyShippingAddressIsNotCustomerDefault()) { var item = cart.FirstItem(); shippingAddress = Address.Get(ThisCustomer, AddressTypes.Shipping, item.m_ShippingAddressID, item.GiftRegistryID); } else { shippingAddress = ThisCustomer.PrimaryShippingAddress; } } litShippingAddress.Text = shippingAddress.DisplayString(true, true, true, "<br/>"); } string XmlPackageName2 = AppLogic.AppConfig("XmlPackage.CheckoutReviewPageFooter"); if (XmlPackageName2.Length != 0) { XmlPackage_CheckoutReviewPageFooter.Text = "<br/>" + AppLogic.RunXmlPackage(XmlPackageName2, base.GetParser, ThisCustomer, SkinID, String.Empty, null, true, true); } AppLogic.GetButtonDisable(btnContinueCheckout1); CheckoutReviewPageHeader.SetContext = this; CheckoutReviewPageFooter.SetContext = this; }
private void InitializePageContent() { JSPopupRoutines.Text = AppLogic.GetJSPopupRoutines(); checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_5.gif"); for (int i = 0; i < checkoutheadergraphic.HotSpots.Count; i++) { RectangleHotSpot rhs = (RectangleHotSpot)checkoutheadergraphic.HotSpots[i]; if (rhs.NavigateUrl.IndexOf("shoppingcart") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.2", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("account") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.3", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("checkoutshipping") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.4", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("checkoutpayment") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.5", SkinID, ThisCustomer.LocaleSetting); } } if (!AppLogic.AppConfigBool("SkipShippingOnCheckout")) { checkoutheadergraphic.HotSpots[2].HotSpotMode = HotSpotMode.Navigate; checkoutheadergraphic.HotSpots[2].NavigateUrl = CommonLogic.IIF(cart.HasMultipleShippingAddresses(), "checkoutshippingmult.aspx", "checkoutshipping.aspx"); } String XmlPackageName = AppLogic.AppConfig("XmlPackage.CheckoutReviewPageHeader"); if (XmlPackageName.Length != 0) { XmlPackage_CheckoutReviewPageHeader.Text = "<br/>" + AppLogic.RunXmlPackage(XmlPackageName, base.GetParser, ThisCustomer, SkinID, String.Empty, String.Empty, true, true); } Address BillingAddress = new Address(); BillingAddress.LoadFromDB(ThisCustomer.PrimaryBillingAddressID); Address ShippingAddress = new Address(); ShippingAddress.LoadFromDB(ThisCustomer.PrimaryShippingAddressID); litBillingAddress.Text = BillingAddress.DisplayString(true, true, "<br/>"); litPaymentMethod.Text = GetPaymentMethod(BillingAddress); if (cart.HasMultipleShippingAddresses()) { litShippingAddress.Text = "<br/>" + AppLogic.GetString("checkoutreview.aspx.25", SkinID, ThisCustomer.LocaleSetting); } else if (cart.HasGiftRegistryComponents() && cart.HasGiftRegistryAddresses()) { litShippingAddress.Text = "<br/>" + AppLogic.GetString("checkoutreview.aspx.26", SkinID, ThisCustomer.LocaleSetting); } else if (AppLogic.AppConfigBool("SkipShippingOnCheckout") || cart.IsAllDownloadComponents() || cart.IsAllSystemComponents()) { ordercs57.Visible = false; } else { litShippingAddress.Text = ShippingAddress.DisplayString(true, true, "<br/>"); } CartSummary.Text = cart.DisplaySummary(true, true, true, true, false); String XmlPackageName2 = AppLogic.AppConfig("XmlPackage.CheckoutReviewPageFooter"); if (XmlPackageName2.Length != 0) { XmlPackage_CheckoutReviewPageFooter.Text = "<br/>" + AppLogic.RunXmlPackage(XmlPackageName2, base.GetParser, ThisCustomer, SkinID, String.Empty, String.Empty, true, true); } AppLogic.GetButtonDisable(btnContinueCheckout1); AppLogic.GetButtonDisable(btnContinueCheckout2); btnContinueCheckout1.Attributes["onclick"] = string.Format("{0}{1}", btnContinueCheckout1.Attributes["onclick"], "document.getElementById(\"" + btnContinueCheckout2.ClientID + "\").disabled = true;"); btnContinueCheckout2.Attributes["onclick"] = string.Format("{0}{1}", btnContinueCheckout2.Attributes["onclick"], "document.getElementById(\"" + btnContinueCheckout1.ClientID + "\").disabled = true;"); GatewayCheckoutByAmazon.CheckoutByAmazon checkoutByAmazon = new GatewayCheckoutByAmazon.CheckoutByAmazon(); if (checkoutByAmazon.IsEnabled && checkoutByAmazon.IsCheckingOut) { pnlAmazonAddressWidget.Visible = pnlAmazonWalletWidget.Visible = true; litBillingAddress.Visible = litShippingAddress.Visible = litPaymentMethod.Visible = checkoutreviewaspx8.Visible = checkoutreviewaspx9.Visible = ordercs57.Visible = false; } }
private void setVS(string fileName) { string xmlFile = this.Request.PhysicalApplicationPath + "Image\\" + fileName + ".xml"; if (File.Exists(xmlFile)) { XmlDocument doc = new XmlDocument(); doc.Load(xmlFile); XmlNode nRoot = doc.SelectSingleNode("FlowDetails"); if (nRoot != null) { string flowFileName = "", formName = "", flowNavMode = "", navMode = "", paramters = ""; XmlNode nFormName = nRoot.SelectSingleNode("FormName"); if (nFormName != null) formName = nFormName.InnerText; XmlNode nFlowNavMode = nRoot.SelectSingleNode("FlowNavMode"); if (nFlowNavMode != null) flowNavMode = nFlowNavMode.InnerText; XmlNode nNavMode = nRoot.SelectSingleNode("NavMode"); if (nNavMode != null) navMode = nNavMode.InnerText; XmlNode nFlowFileName = nRoot.SelectSingleNode("FlowFileName"); if (nFlowFileName != null) { flowFileName = nFlowFileName.InnerText.ToUpper(); if (!string.IsNullOrEmpty(flowFileName) && flowFileName.IndexOf(@"WORKFLOW\") != -1) { flowFileName = flowFileName.Substring(flowFileName.IndexOf(@"WORKFLOW\") + 9); } } XmlNode nParamters = nRoot.SelectSingleNode("Parameters"); if (nParamters != null) paramters = ConvertUserParameters(nParamters.InnerText); XmlNode nImageWidth = nRoot.SelectSingleNode("ImageWidth"); if (nImageWidth != null) { if (!string.IsNullOrEmpty(formName)) { RectangleHotSpot hot = new RectangleHotSpot(); hot.HotSpotMode = HotSpotMode.Navigate; hot.Top = 71; hot.Bottom = 111; hot.Left = Convert.ToInt32(nImageWidth.InnerText) / 2 - 65; hot.Right = Convert.ToInt32(nImageWidth.InnerText) / 2 + 65; formName = formName.Replace('.', '/'); hot.NavigateUrl = "~/" + formName + ".aspx?FLOWFILENAME=" + HttpUtility.UrlEncode(flowFileName) + "&NAVMODE=" + navMode + "&FLNAVMODE=" + flowNavMode + paramters; this.imageMapDesigner.HotSpots.Add(hot); } } XmlNode nFLHyperLink = nRoot.SelectSingleNode("FLHyperLink"); if (nFLHyperLink != null) { XmlNode node = nFLHyperLink.FirstChild; while (node != null) { RectangleHotSpot hot = new RectangleHotSpot(); hot.HotSpotMode = HotSpotMode.Navigate; string linkFlow = node.Attributes["LinkFlow"].Value; string linkFormName = node.Attributes["WebFormName"].Value; string linkParameters = ConvertUserParameters(node.Attributes["Parameters"].Value); if (linkFlow != null && linkFlow != "") { if (linkFlow.IndexOf('\\') != -1) linkFlow = linkFlow.Substring(linkFlow.IndexOf('\\') + 1); hot.NavigateUrl = this.Request.FilePath + "?FlowFileName=" + linkFlow; } else if (linkFormName != null && linkFormName != "") { linkFormName = linkFormName.Replace('.', '/'); hot.NavigateUrl = "~/" + linkFormName + ".aspx?FLOWFILENAME=" + HttpUtility.UrlEncode(flowFileName) + linkParameters; } hot.Top = Convert.ToInt32(node.Attributes["Top"].Value); hot.Bottom = Convert.ToInt32(node.Attributes["Bottom"].Value); hot.Left = Convert.ToInt32(node.Attributes["Left"].Value); hot.Right = Convert.ToInt32(node.Attributes["Right"].Value); this.imageMapDesigner.HotSpots.Add(hot); node = node.NextSibling; } } XmlNode nFLQuery = nRoot.SelectSingleNode("FLQuery"); if (nFLQuery != null) { XmlNode node = nFLQuery.FirstChild; while (node != null) { RectangleHotSpot hot = new RectangleHotSpot(); hot.HotSpotMode = HotSpotMode.Navigate; string queryFormName = node.Attributes["WebFormName"].Value; queryFormName = queryFormName.Replace('.', '/'); string queryParameters = ConvertUserParameters(node.Attributes["Parameters"].Value); hot.NavigateUrl = "~/" + queryFormName + ".aspx?FLOWFILENAME=" + HttpUtility.UrlEncode(flowFileName) + "&NAVMODE=3&FLNAVMODE=4" + queryParameters; hot.Top = Convert.ToInt32(node.Attributes["Top"].Value); hot.Bottom = Convert.ToInt32(node.Attributes["Bottom"].Value); hot.Left = Convert.ToInt32(node.Attributes["Left"].Value); hot.Right = Convert.ToInt32(node.Attributes["Right"].Value); this.imageMapDesigner.HotSpots.Add(hot); node = node.NextSibling; } } } } }