/// <summary> /// Constructor. /// </summary> /// <param name="action">The action to which this view is bound.</param> public LayoutChangerToolStripItem(LayoutChangerAction action) : base(new Panel()) { const int cellWidth = 25; int idealPickerWidth = (action.MaxColumns - 1)*cellWidth*6/5 + cellWidth; int idealPickerHeight = (action.MaxRows - 1)*cellWidth*6/5 + cellWidth; _action = action; const int borderWidth = 1; _picker = new TableDimensionsPicker(_action.MaxRows, _action.MaxColumns); _picker.Dock = DockStyle.Left; _picker.BackColor = Color.Transparent; _picker.CellSpacing = new TableDimensionsCellSpacing(cellWidth/5, cellWidth/5); _picker.CellStyle = new TableDimensionsCellStyle(Color.FromArgb(0, 71, 98), borderWidth); _picker.HotCellStyle = new TableDimensionsCellStyle(CLEARCANVAS_BLUE, CLEARCANVAS_BLUE, borderWidth); _picker.SelectedCellStyle = new TableDimensionsCellStyle(); _picker.Size = new Size(idealPickerWidth, idealPickerHeight); _picker.DimensionsSelected += OnDimensionsSelected; _picker.HotDimensionsChanged += OnHotTrackingDimensionsChanged; _label = new CustomLabel(); _label.AutoSize = false; _label.BackColor = Color.Transparent; _label.Click += OnCancel; _label.Dock = DockStyle.Top; _label.Size = new Size(idealPickerWidth, 21); _label.Text = _action.Label; _spacerL = new Panel(); _spacerL.BackColor = Color.Transparent; _spacerL.Dock = DockStyle.Left; _spacerL.Size = new Size(0, idealPickerHeight); _spacerR = new Panel(); _spacerR.BackColor = Color.Transparent; _spacerR.Dock = DockStyle.Fill; _spacerR.Size = new Size(0, idealPickerHeight); _panel = (Panel) base.Control; _panel.Size = _defaultSize = new Size(Math.Max(base.Width, idealPickerWidth), idealPickerHeight + _label.Height); _panel.Controls.Add(_spacerR); _panel.Controls.Add(_picker); _panel.Controls.Add(_spacerL); _panel.Controls.Add(_label); _panel.Resize += OnContentPanelResize; base.AutoSize = false; base.BackColor = Color.Transparent; base.ControlAlign = ContentAlignment.TopCenter; this.MyOwner = base.Owner; base.Size = _defaultSize = new Size(Math.Max(base.Width, idealPickerWidth), idealPickerHeight + _label.Height); }
public IEnumerable<EditorDataItem> GetEditorDataItems([FromUri] int currentId, [FromUri] int parentId, [FromUri] string propertyAlias, [FromBody] dynamic data) { int contextId = currentId; var relationService = this.ApplicationContext.Services.RelationService; IEnumerable<EditorDataItem> editorDataItems = relationService.GetEntitiesFromRelations( relationService.GetByRelationTypeAlias((string)data.config.dataSource.relationType) .Where(r => r.ParentId == contextId)) .Select(x => new EditorDataItem() { Key = x.Item2.Id.ToString(), Label = x.Item2.Name.ToString() }) .ToList(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); return customLabel.ProcessEditorDataItems(editorDataItems); }
/// <summary> /// Adds plan strips to the chart /// </summary> /// <param name="planCollection"></param> /// <param name="chart"></param> /// <param name="graphStartDate"></param> protected void SetPlanStrips(List <PlanPcd> planCollection, Chart chart, DateTime graphStartDate) { var backGroundColor = 1; foreach (var plan in planCollection) { var stripline = new StripLine(); //Creates alternating backcolor to distinguish the plans if (backGroundColor % 2 == 0) { stripline.BackColor = Color.FromArgb(120, Color.LightGray); } else { stripline.BackColor = Color.FromArgb(120, Color.LightBlue); } //Set the stripline properties stripline.IntervalOffset = (plan.StartTime - graphStartDate).TotalHours; stripline.IntervalOffsetType = DateTimeIntervalType.Hours; stripline.Interval = 1; stripline.IntervalType = DateTimeIntervalType.Days; stripline.StripWidth = (plan.EndTime - plan.StartTime).TotalHours; stripline.StripWidthType = DateTimeIntervalType.Hours; chart.ChartAreas["ChartArea1"].AxisX.StripLines.Add(stripline); //Add a corrisponding custom label for each strip var Plannumberlabel = new CustomLabel(); Plannumberlabel.FromPosition = plan.StartTime.ToOADate(); Plannumberlabel.ToPosition = plan.EndTime.ToOADate(); switch (plan.PlanNumber) { case 254: Plannumberlabel.Text = "Free"; break; case 255: Plannumberlabel.Text = "Flash"; break; case 0: Plannumberlabel.Text = "Unknown"; break; default: Plannumberlabel.Text = "Plan " + plan.PlanNumber; break; } Plannumberlabel.ForeColor = Color.Black; Plannumberlabel.RowIndex = 3; chart.ChartAreas["ChartArea1"].AxisX2.CustomLabels.Add(Plannumberlabel); var aogLabel = new CustomLabel(); aogLabel.FromPosition = plan.StartTime.ToOADate(); aogLabel.ToPosition = plan.EndTime.ToOADate(); aogLabel.Text = plan.PercentArrivalOnGreen + "% AoG\n" + plan.PercentGreenTime + "% GT"; aogLabel.LabelMark = LabelMarkStyle.LineSideMark; aogLabel.ForeColor = Color.Blue; aogLabel.RowIndex = 2; chart.ChartAreas["ChartArea1"].AxisX2.CustomLabels.Add(aogLabel); var statisticlabel = new CustomLabel(); statisticlabel.FromPosition = plan.StartTime.ToOADate(); statisticlabel.ToPosition = plan.EndTime.ToOADate(); statisticlabel.Text = plan.PlatoonRatio + " PR"; statisticlabel.ForeColor = Color.Maroon; statisticlabel.RowIndex = 1; chart.ChartAreas["ChartArea1"].AxisX2.CustomLabels.Add(statisticlabel); //CustomLabel PlatoonRatiolabel = new CustomLabel(); //PercentGreenlabel.FromPosition = plan.StartTime.ToOADate(); //PercentGreenlabel.ToPosition = plan.EndTime.ToOADate(); //PercentGreenlabel.Text = plan.PlatoonRatio.ToString() + " PR"; //PercentGreenlabel.ForeColor = Color.Black; //PercentGreenlabel.RowIndex = 1; //chart.ChartAreas["ChartArea1"].AxisX2.CustomLabels.Add(PercentGreenlabel); //Change the background color counter for alternating color backGroundColor++; } }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.opcjeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.backgroundWorker = new System.ComponentModel.BackgroundWorker(); this.arrowIcon1 = new TV_Calendar.ArrowIcon(); this.dayLabel = new TV_Calendar.CustomLabel(); this.thLabel = new TV_Calendar.CustomLabel(); this.numberLabel = new TV_Calendar.CustomLabel(); this.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // // contextMenuStrip1 // this.contextMenuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(44)))), ((int)(((byte)(44))))); this.contextMenuStrip1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.opcjeToolStripMenuItem, this.exitToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.ShowImageMargin = false; this.contextMenuStrip1.ShowItemToolTips = false; this.contextMenuStrip1.Size = new System.Drawing.Size(93, 48); // // opcjeToolStripMenuItem // this.opcjeToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.opcjeToolStripMenuItem.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.opcjeToolStripMenuItem.ForeColor = System.Drawing.Color.White; this.opcjeToolStripMenuItem.Name = "opcjeToolStripMenuItem"; this.opcjeToolStripMenuItem.Size = new System.Drawing.Size(92, 22); this.opcjeToolStripMenuItem.Text = "Opcje"; this.opcjeToolStripMenuItem.Click += new System.EventHandler(this.optionsMenuItem); this.opcjeToolStripMenuItem.MouseEnter += new System.EventHandler(this.menuItemEnter); this.opcjeToolStripMenuItem.MouseLeave += new System.EventHandler(this.menuItemLeave); // // exitToolStripMenuItem // this.exitToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.exitToolStripMenuItem.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.exitToolStripMenuItem.ForeColor = System.Drawing.Color.White; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitMenuItem); this.exitToolStripMenuItem.MouseEnter += new System.EventHandler(this.menuItemEnter); this.exitToolStripMenuItem.MouseLeave += new System.EventHandler(this.menuItemLeave); // // backgroundWorker // this.backgroundWorker.WorkerReportsProgress = true; this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.BackgroundWorker_DoWork); this.backgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.BackgroundWorker_Progress); this.backgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.BackgroundWorker_Completed); // // arrowIcon1 // this.arrowIcon1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.arrowIcon1.Font = new System.Drawing.Font("Arial", 39.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.arrowIcon1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(74)))), ((int)(((byte)(74))))); this.arrowIcon1.Location = new System.Drawing.Point(218, 0); this.arrowIcon1.Name = "arrowIcon1"; this.arrowIcon1.Size = new System.Drawing.Size(39, 38); this.arrowIcon1.TabIndex = 4; this.arrowIcon1.Text = this.arrowIcon1.RightArrow; this.arrowIcon1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.arrowIcon1.Click += new System.EventHandler(this.arrowClick); this.arrowIcon1.MouseEnter += new System.EventHandler(this.arrowEnter); this.arrowIcon1.MouseLeave += new System.EventHandler(this.arrowLeave); // // dayLabel // this.dayLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.dayLabel.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dayLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(170)))), ((int)(((byte)(170))))); this.dayLabel.Location = new System.Drawing.Point(45, 19); this.dayLabel.Margin = new System.Windows.Forms.Padding(0); this.dayLabel.Name = "dayLabel"; this.dayLabel.Size = new System.Drawing.Size(163, 19); this.dayLabel.TabIndex = 3; this.dayLabel.Text = "th"; this.dayLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // thLabel // this.thLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.thLabel.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.thLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(170)))), ((int)(((byte)(170))))); this.thLabel.Location = new System.Drawing.Point(42, 0); this.thLabel.Margin = new System.Windows.Forms.Padding(0); this.thLabel.Name = "thLabel"; this.thLabel.Size = new System.Drawing.Size(166, 19); this.thLabel.TabIndex = 2; this.thLabel.Text = "th"; this.thLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // numberLabel // this.numberLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.numberLabel.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.numberLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(170)))), ((int)(((byte)(170))))); this.numberLabel.Location = new System.Drawing.Point(0, 0); this.numberLabel.Margin = new System.Windows.Forms.Padding(0); this.numberLabel.Name = "numberLabel"; this.numberLabel.Size = new System.Drawing.Size(53, 38); this.numberLabel.TabIndex = 0; this.numberLabel.Text = "30"; this.numberLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // MainForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.ClientSize = new System.Drawing.Size(265, 38); this.ContextMenuStrip = this.contextMenuStrip1; this.Controls.Add(this.arrowIcon1); this.Controls.Add(this.dayLabel); this.Controls.Add(this.thLabel); this.Controls.Add(this.numberLabel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "MainForm"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "TV Calendar"; this.TopMost = true; this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.MainForm_MouseWheel); this.contextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); }
public void OnGUI() { label = GetComponent <CustomLabel>(); label.Draw(); }
private void alBtn_Click(object sender, EventArgs e) { if (initialization) { if (tbMemSize.Text.Length <= 0) { MessageBox.Show("You haven't set the maximum memory size!", "Parameter unset!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); tbMemSize.Select(); return; } if (holeList.Items.Count <= 0) { MessageBox.Show("You must add holes or the whole memory will be initially allocated to one segment!", "Parameter unset!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (string.IsNullOrEmpty(tbMemSize.Text) || string.IsNullOrEmpty(tbMemSize.Text)) { return; } try { Exception ex = new Exception(); if (double.Parse(tbMemSize.Text) <= 0 || double.Parse(tbMemSize.Text) <= 0) { throw ex; } } catch { MessageBox.Show("Invalid Max memory parameter!", "Invalid input!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } memSize = double.Parse(tbMemSize.Text); mem.ChartAreas[0].AxisX.Maximum = 1.01; mem.ChartAreas[0].AxisY.Maximum = memSize + 0.0001; mem.ChartAreas[0].AxisY.Interval = memSize; CustomLabel zero_label = new CustomLabel(); CustomLabel max_label = new CustomLabel(); zero_label.ToPosition = 0.1; zero_label.Text = "0"; max_label.ToPosition = 2 * memSize; max_label.Text = memSize.ToString(); mem.ChartAreas[0].AxisY.CustomLabels.Add(zero_label); mem.ChartAreas[0].AxisY.CustomLabels.Add(max_label); if ((int)memSize > 5) { mem.ChartAreas[0].AxisY.LabelAutoFitMinFontSize = (int)memSize; } List <double> holeStartsList = new List <double>(); List <double> holeSizesList = new List <double>(); for (int i = 0; i < holeList.Items.Count; i++) { holeStartsList.Add(double.Parse(holeList.Items[i].SubItems[0].Text)); holeSizesList.Add(double.Parse(holeList.Items[i].SubItems[1].Text)); } double total = 0; for (int i = 0; i < holeSizesList.Count; i++) { total += holeSizesList[i]; holeList.Items.Clear(); tbHoleSize.Clear(); tbHoleStart.Clear(); } if (total > memSize) { MessageBox.Show("Invalid holes input!, Out of memory! ", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { initialization = false; switch_reset(); add_holes(holeStartsList, holeSizesList); fix_holes(); startingSegments(memSize, h_list); for (int i = 0; i < temp_seg_list.Count; i++) { List <segment> temp = new List <segment>(); temp.Add(temp_seg_list[i]); List <string> segmentation_names = new List <string>(); List <double> start_intervals = new List <double>(); List <double> sizes = new List <double>(); for (int j = 0; j < temp.Count; j++) { segmentation_names.Add(temp[j].name); start_intervals.Add(temp[j].start); sizes.Add(temp[j].size); } TreeNode treeNode = new TreeNode("Initially allocated " + (i + 1).ToString()); treeNode.Name = "Initially allocated " + (i + 1).ToString(); cbPList.Items.Add("Initially allocated " + (i + 1).ToString()); table.Nodes.Add(treeNode); table.Nodes["Initially allocated " + (i + 1).ToString()].Nodes.Add("Limit = " + sizes[0]); table.Nodes["Initially allocated " + (i + 1).ToString()].Nodes.Add("Base = " + start_intervals[0]); table.Nodes["Initially allocated " + (i + 1).ToString()].Nodes[0].NodeFont = Font; table.Nodes["Initially allocated " + (i + 1).ToString()].Nodes[1].NodeFont = Font; table.ExpandAll(); table.EndUpdate(); Add_Proccess("Initially allocated " + (i + 1).ToString(), temp, Color.DarkGray); temp.Clear(); } temp_seg_list.Clear(); } //NOW YOU HAVE THE SIX INPUTS FROM THE GUI AS VARIABLES //process_name //memSize //segNamesList //segSizesList //holeStartsList //holeSizesList //method //TODO: //ON FIRST ALLOCATE ONLY: INSERT HOLE LISTS TO BACKEND AND CALL Add_Initial_Allocation() WITH THE INVERSE HOLE FUNCTION FROM THE BACKEND } else { if (segList.Items.Count == 0) { return; } tbNewProcess.Enabled = true; beginSeg.Enabled = true; RmvSeg.Enabled = false; AddSeg.Enabled = false; tbSegName.Enabled = false; tbSegSize.Enabled = false; List <string> segNamesList = new List <string>(); List <double> segSizesList = new List <double>(); for (int i = 0; i < segList.Items.Count; i++) { segNamesList.Add(segList.Items[i].SubItems[0].Text); segSizesList.Add(double.Parse(segList.Items[i].SubItems[1].Text)); } isBest = rbBest.Checked; if (isBest) { add_segments(segSizesList, segNamesList); best_fit(process_name); if (warning) { p_name_label.Text = " "; segList.Items.Clear(); tbNewProcess.Clear(); return; } else { cbPList.Items.Add(process_name); table.BeginUpdate(); TreeNode treeNode = new TreeNode(process_name); treeNode.Name = process_name; table.Nodes.Add(treeNode); for (int i = 0; i < segSizesList.Count; ++i) { TreeNode treeNode2 = new TreeNode(segNamesList[i]); treeNode2.Name = segNamesList[i]; //table.Nodes.Add(treeNode2); table.Nodes[process_name].Nodes.Add(treeNode2); table.Nodes[process_name].Nodes[segNamesList[i]].Nodes.Add("Limit = " + temp_seg_list[i].size); table.Nodes[process_name].Nodes[segNamesList[i]].Nodes.Add("Base = " + temp_seg_list[i].start); table.Nodes[process_name].Nodes[segNamesList[i]].Nodes[0].NodeFont = Font; table.Nodes[process_name].Nodes[segNamesList[i]].Nodes[1].NodeFont = Font; } table.ExpandAll(); table.EndUpdate(); Add_Proccess(process_name, temp_seg_list); switch_seg_table(true); temp_seg_list.Clear(); } } else if (!isBest) { add_segments(segSizesList, segNamesList); first_fit(process_name); if (warning) { p_name_label.Text = " "; segList.Items.Clear(); tbNewProcess.Clear(); return; } else { cbPList.Items.Add(process_name); table.BeginUpdate(); TreeNode treeNode = new TreeNode(process_name); treeNode.Name = process_name; table.Nodes.Add(treeNode); for (int i = 0; i < segSizesList.Count; ++i) { TreeNode treeNode2 = new TreeNode(segNamesList[i]); treeNode2.Name = segNamesList[i]; table.Nodes[process_name].Nodes.Add(treeNode2); table.Nodes[process_name].Nodes[segNamesList[i]].Nodes.Add("Limit = " + temp_seg_list[i].size); table.Nodes[process_name].Nodes[segNamesList[i]].Nodes.Add("Base = " + temp_seg_list[i].start); table.Nodes[process_name].Nodes[segNamesList[i]].Nodes[0].NodeFont = Font; table.Nodes[process_name].Nodes[segNamesList[i]].Nodes[1].NodeFont = Font; } table.ExpandAll(); table.EndUpdate(); Add_Proccess(process_name, temp_seg_list); switch_seg_table(true); temp_seg_list.Clear(); } } //NOW YOU HAVE THE SIX INPUTS FROM THE GUI AS VARIABLES //process_name //memSize //segNamesList //segSizesList //holeStartsList //holeSizesList //method //TODO: //INSERT SEG LISTS TO BACKEND AND CALL Add_Process() HERE WITH THE BACKEND OUTPUT segList.Items.Clear(); tbNewProcess.Text = ""; p_name_label.Text = ""; process_name = ""; } }
private void PlotMatches() { if (backgroundWorkerReadMatches.IsBusy) { return; } if (Matches.Count == 0 || MatchReaders.Count == 0) { return; } Plotting = true; xLabelOffset = 0; Util.ClearPointsQuick(chart.Series[0]); Util.ClearPointsQuick(chart.Series[1]); chart.ChartAreas[0].AxisX.CustomLabels.Clear(); chart.Annotations.Clear(); chart.Titles.Clear(); for (int i = 0; i < Matches.Count; i++) { var reader = MatchReaders[i]; if (reader == null) { continue; } var match = Matches[i]; if (reader.Entries.Where(en => en.RobotAuto || en.RobotTele || en.Brownout).Count() < 10) { continue; } int oldOffset = xLabelOffset - 1; if (CurrentMode == GraphMode.Both) { PlotMatch(reader.Entries.Where(en => en.RobotAuto || en.RobotTele || en.Brownout || en.DSTele || en.DSAuto)); } else if (CurrentMode == GraphMode.Tele) { PlotMatch(reader.Entries.Where(en => en.RobotTele || en.DSTele || (en.Brownout && en.DSTele))); } else if (CurrentMode == GraphMode.Auto) { PlotMatch(reader.Entries.Where(en => en.RobotAuto || en.DSAuto || (en.Brownout && en.DSAuto))); } var custom = new CustomLabel(oldOffset, xLabelOffset, $"{match.MatchType} {match.FMSMatchNum}", 0, LabelMarkStyle.None); custom.ForeColor = match.GetMatchTypeColor(); chart.ChartAreas[0].AxisX.CustomLabels.Add(custom); if (i != Matches.Count - 1) { LineAnnotation annotation = new LineAnnotation(); annotation.IsSizeAlwaysRelative = false; annotation.AxisX = chart.ChartAreas[0].AxisX; annotation.AxisY = chart.ChartAreas[0].AxisY2; annotation.AnchorX = xLabelOffset; annotation.AnchorY = 0; annotation.Height = 113; annotation.Width = 0; annotation.LineWidth = 1; annotation.StartCap = LineAnchorCapStyle.None; annotation.EndCap = LineAnchorCapStyle.None; annotation.LineColor = Color.White; chart.Annotations.Add(annotation); } xLabelOffset += 1; } List <string> title = new List <string>(); foreach (string node in EnabledSeries.Keys) { title.Add(EnabledSeries[node].Item1); } chart.Titles.Add(new Title(string.Join(", ", title), Docking.Top, new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold), Color.White)); SetYLabels(); Plotting = false; }
// 상품권 목록 private void Showimge() { CategoryGrid.Children.Clear(); CategoryGrid.RowDefinitions.Clear(); List <G_CategoryInfo> categories = new List <G_CategoryInfo>(); #region 네트워크 상태 확인 var current_network = Connectivity.NetworkAccess; // 현재 네트워크 상태 if (current_network == NetworkAccess.Internet) // 네트워크 연결 가능 { categories = giftDBFunc.SelectAllCategory(); // 상품권 목록 가져오기 } else { categories = null; } #endregion #region 네트워크 연결 불가 if (categories == null) // 네트워크 연결 불가 { CustomLabel label = new CustomLabel { Text = "네트워크에 연결할 수 없습니다. 다시 시도해 주세요.", Size = 18, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; CategoryGrid.Children.Add(label, 0, 0); //실시간거래 그리드에 라벨추가 return; } #endregion #region 상품권 목록 검색 불가 if (categories.Count == 0) { if (categories[0].Error == null || categories[0].Error == "") { CustomLabel label = new CustomLabel { Text = "상품권 목록을 불러 올 수 없습니다!", Size = 10, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; CategoryGrid.Children.Add(label, 0, 0); //실시간거래 그리드에 라벨추가 return; } } #endregion #region 상품권 목록 가져오기 int columnindex = 2; int rowindex = 0; Grid ColumnGrid = new Grid(); for (int i = 0; i < categories.Count;) { if (columnindex > 1) // 열 그리드 { columnindex = 0; CategoryGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); ColumnGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } }, RowSpacing = 0, Margin = new Thickness(10, 0, 10, 0), }; CategoryGrid.Children.Add(ColumnGrid, 0, rowindex); rowindex += 1; } BoxView borderLine = new BoxView { BackgroundColor = Color.FromHex("#ebecf9"), }; // 내부 그리드 Grid inGrid = new Grid { RowDefinitions = { new RowDefinition { Height = 60 }, new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, }, BindingContext = i + 1, BackgroundColor = Color.White, Margin = 1, }; ColumnGrid.Children.Add(borderLine, columnindex, 0); ColumnGrid.Children.Add(inGrid, columnindex, 0); CachedImage image = new CachedImage { LoadingPlaceholder = Global.LoadingImagePath, ErrorPlaceholder = Global.NotFoundImagePath, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, Aspect = Aspect.AspectFill, Margin = new Thickness(15, 0, 0, 0), Source = ImageSource.FromUri(new Uri(Global.server_ipadress + categories[i].Image)), //Source = "test_icon.png", }; inGrid.Children.Add(image, 0, 0); CustomLabel nameLabel = new CustomLabel { Text = categories[i].Name, Size = 14, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, FontAttributes = FontAttributes.Bold, Margin = new Thickness(15, 0, 0, 0), }; inGrid.Children.Add(nameLabel, 0, 1); CustomLabel detailLabel = new CustomLabel { Size = 14, TextColor = Color.Gray, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, FontAttributes = FontAttributes.Bold, Margin = new Thickness(15, 0, 0, 5), }; // 상품권 하위 카테고리 초기화 List <DetailCategory> giftNameList = new List <DetailCategory>(); #region 네트워크 상태 확인 if (current_network == NetworkAccess.Internet) // 네트워크 연결 가능 { giftNameList = giftDBFunc.PostSelectDetailCategoryToIndex(categories[i].CategoryNum); } else { giftNameList = null; } #endregion if (giftNameList != null) { string named = ""; for (int k = 0; k < giftNameList.Count; k++) { named += giftNameList[k].PRODUCTTYPE; if (k != giftNameList.Count - 1) // 마지막일 경우 쉼표를 붙히지 않음. { named += ", "; } } detailLabel.Text = named; } inGrid.Children.Add(detailLabel, 0, 2); inGrid.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(() => { Global.deal_select_category_value = "구매"; // 상품권 탭 클릭시 디폴트 상태는 구매. mainPage.ShowDealDetailAsync(inGrid.BindingContext.ToString()); }) }); i++; columnindex++; } #endregion }
private void Init() { #region 네트워크 연결 불가 if (salelist == null) // 네트워크 연결 불가 { MainGrid.Children.Clear(); MainGrid.RowDefinitions.Clear(); CustomLabel label = new CustomLabel { Text = "네트워크에 연결할 수 없습니다. 다시 시도해 주세요.", Size = 18, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; MainGrid.Children.Add(label, 0, 0); return; } #endregion Grid coverGrid = new Grid { RowSpacing = 0 }; MainGrid.Children.Add(coverGrid, 0, 0); // 메인 그리드 추가 #region 주문번호 CustomLabel order_numLabel = new CustomLabel { Text = "주문 번호 : " + slnum, Size = 18, TextColor = Color.Black, Margin = new Thickness(15, 0, 0, 0), VerticalOptions = LayoutOptions.CenterAndExpand, }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 40 }); coverGrid.Children.Add(order_numLabel, 0, 0); #endregion BoxView borderLine1 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine1, 0, 1); #region 상품 이름 Grid nameGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView nameLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout nameCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel nameLabel = new CustomLabel { Text = "상품 이름", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_nameLabel = new CustomLabel { Text = salelist[0].PRODUCTTYPE + " " + salelist[0].PRODUCTVALUE, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; nameGrid.Children.Add(nameLine, 0, 0); nameGrid.Children.Add(nameCover, 0, 0); nameCover.Children.Add(nameLabel); nameGrid.Children.Add(input_nameLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(nameGrid, 0, 2); BoxView borderLine2 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine2, 0, 3); #endregion #region 결제금액 Grid pay_priceGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_priceLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_priceCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_priceLabel = new CustomLabel { Text = "결제금액", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_pay_priceLabel = new CustomLabel { Text = int.Parse(salelist[0].SL_TOTAL_PRICE).ToString("N0"), Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; pay_priceGrid.Children.Add(pay_priceLine, 0, 0); pay_priceGrid.Children.Add(pay_priceCover, 0, 0); pay_priceCover.Children.Add(pay_priceLabel); pay_priceGrid.Children.Add(input_pay_priceLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_priceGrid, 0, 4); BoxView borderLine5 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine5, 0, 5); #endregion #region 은행명 Grid bankname_grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView bankname_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout bankname_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel bankname_Label = new CustomLabel { Text = "은행", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_bankname_Label = new CustomLabel { Text = salelist[0].SL_BANK_NAME, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; bankname_grid.Children.Add(bankname_Line, 0, 0); bankname_grid.Children.Add(bankname_Cover, 0, 0); bankname_Cover.Children.Add(bankname_Label); bankname_grid.Children.Add(input_bankname_Label, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(bankname_grid, 0, 6); BoxView borderLine7 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine7, 0, 7); #endregion #region 예금자명 Grid accname_grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView accname_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout accname_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel accname_Label = new CustomLabel { Text = "예금자명", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_accname_Label = new CustomLabel { Text = salelist[0].SL_ACC_NAME, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; accname_grid.Children.Add(accname_Line, 0, 0); accname_grid.Children.Add(accname_Cover, 0, 0); accname_Cover.Children.Add(accname_Label); accname_grid.Children.Add(input_accname_Label, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(accname_grid, 0, 8); BoxView borderLine9 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine9, 0, 9); #endregion #region 계좌번호 Grid accnum_grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView accnum_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout accnum_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel accnum_Label = new CustomLabel { Text = "계좌번호", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_accnum_Label = new CustomLabel { Text = salelist[0].SL_ACC_NUM, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; accnum_grid.Children.Add(accnum_Line, 0, 0); accnum_grid.Children.Add(accnum_Cover, 0, 0); accnum_Cover.Children.Add(accnum_Label); accnum_grid.Children.Add(input_accnum_Label, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(accnum_grid, 0, 10); BoxView borderLine11 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine11, 0, 11); #endregion #region 전달사항 Grid sendstring_grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView sendstring_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout sendstring_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel sendstring_Label = new CustomLabel { Text = "전달사항", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_sendstring_Label = new CustomLabel { Text = salelist[0].SL_SENDSTRING, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; sendstring_grid.Children.Add(sendstring_Line, 0, 0); sendstring_grid.Children.Add(sendstring_Cover, 0, 0); sendstring_Cover.Children.Add(sendstring_Label); sendstring_grid.Children.Add(input_sendstring_Label, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(sendstring_grid, 0, 12); BoxView borderLine13 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine13, 0, 13); #endregion #region 판매상태 Grid pay_stateGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_stateLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_stateCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_stateLabel = new CustomLabel { Text = "결제상태", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_pay_stateLabel = new CustomLabel { Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; input_pay_stateLabel.Text = Global.StateToString(salelist[0].SL_ISSUCCES); pay_stateGrid.Children.Add(pay_stateLine, 0, 0); pay_stateGrid.Children.Add(pay_stateCover, 0, 0); pay_stateCover.Children.Add(pay_stateLabel); pay_stateGrid.Children.Add(input_pay_stateLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_stateGrid, 0, 14); BoxView borderLine15 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine15, 0, 15); #endregion #region 실패사유 Grid failstring_Grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView failstring_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout failstring_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel failstring_Label = new CustomLabel { Text = "상세내용", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_failstring_Label = new CustomLabel { Text = salelist[0].SL_FAILSTRING, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; failstring_Grid.Children.Add(failstring_Line, 0, 0); failstring_Grid.Children.Add(failstring_Cover, 0, 0); failstring_Cover.Children.Add(failstring_Label); failstring_Grid.Children.Add(input_failstring_Label, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(failstring_Grid, 0, 16); BoxView borderLine17 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine17, 0, 17); #endregion }
public void Init() { EmailCell = new ExtendedTextCell { Text = AppResources.EmailUs, ShowDisclousure = true }; var emailTable = new CustomTableView(this) { Root = new TableRoot { new TableSection(Helpers.GetEmptyTableSectionTitle()) { EmailCell } } }; EmailLabel = new CustomLabel(this) { Text = AppResources.EmailUsDescription }; WebsiteCell = new ExtendedTextCell { Text = AppResources.VisitOurWebsite, ShowDisclousure = true }; var websiteTable = new CustomTableView(this) { NoHeader = true, Root = new TableRoot { new TableSection(Helpers.GetEmptyTableSectionTitle()) { WebsiteCell } } }; WebsiteLabel = new CustomLabel(this) { Text = AppResources.VisitOurWebsiteDescription }; BugCell = new ExtendedTextCell { Text = AppResources.FileBugReport, ShowDisclousure = true }; var bugTable = new CustomTableView(this) { NoHeader = true, Root = new TableRoot { new TableSection(Helpers.GetEmptyTableSectionTitle()) { BugCell } } }; BugLabel = new CustomLabel(this) { Text = AppResources.FileBugReportDescription }; StackLayout = new RedrawableStackLayout { Children = { emailTable, EmailLabel, websiteTable, WebsiteLabel, bugTable, BugLabel }, Spacing = 0 }; if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.UWP) { ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close)); } Title = AppResources.HelpAndFeedback; Content = new ScrollView { Content = StackLayout }; }
private void SetSplitMonitorStatistics(List <PlanSplitMonitor> plans, AnalysisPhase phase, Chart chart) { //find the phase Cycles that occure during the plan. foreach (var plan in plans) { var Cycles = from cycle in phase.Cycles.Items where cycle.StartTime > plan.StartTime && cycle.EndTime < plan.EndTime orderby cycle.Duration select cycle; // find % Skips if (ShowPercentSkip) { if (plan.CycleCount > 0) { double CycleCount = plan.CycleCount; double SkippedPhases = plan.CycleCount - Cycles.Count(); double SkipPercent = 0; if (CycleCount > 0) { SkipPercent = SkippedPhases / CycleCount; } var skipLabel = new CustomLabel(); skipLabel.FromPosition = plan.StartTime.ToOADate(); skipLabel.ToPosition = plan.EndTime.ToOADate(); skipLabel.Text = string.Format("{0:0.0%} Skips", SkipPercent); skipLabel.LabelMark = LabelMarkStyle.LineSideMark; skipLabel.ForeColor = Color.Black; skipLabel.RowIndex = 1; chart.ChartAreas[0].AxisX2.CustomLabels.Add(skipLabel); } } // find % GapOuts if (ShowPercentGapOuts) { var GapOuts = from cycle in Cycles where cycle.TerminationEvent == 4 select cycle; double CycleCount = plan.CycleCount; double gapouts = GapOuts.Count(); double GapPercent = 0; if (CycleCount > 0) { GapPercent = gapouts / CycleCount; } var gapLabel = new CustomLabel(); gapLabel.FromPosition = plan.StartTime.ToOADate(); gapLabel.ToPosition = plan.EndTime.ToOADate(); gapLabel.Text = string.Format("{0:0.0%} GapOuts", GapPercent); gapLabel.LabelMark = LabelMarkStyle.LineSideMark; gapLabel.ForeColor = Color.OliveDrab; gapLabel.RowIndex = 2; chart.ChartAreas[0].AxisX2.CustomLabels.Add(gapLabel); } //Set Max Out if (ShowPercentMaxOutForceOff && plan.PlanNumber == 254) { var MaxOuts = from cycle in Cycles where cycle.TerminationEvent == 5 select cycle; double CycleCount = plan.CycleCount; double maxouts = MaxOuts.Count(); double MaxPercent = 0; if (CycleCount > 0) { MaxPercent = maxouts / CycleCount; } var maxLabel = new CustomLabel(); maxLabel.FromPosition = plan.StartTime.ToOADate(); maxLabel.ToPosition = plan.EndTime.ToOADate(); maxLabel.Text = string.Format("{0:0.0%} MaxOuts", MaxPercent); maxLabel.LabelMark = LabelMarkStyle.LineSideMark; maxLabel.ForeColor = Color.Red; maxLabel.RowIndex = 3; chart.ChartAreas[0].AxisX2.CustomLabels.Add(maxLabel); } // Set Force Off if (ShowPercentMaxOutForceOff && plan.PlanNumber != 254 ) { var ForceOffs = from cycle in Cycles where cycle.TerminationEvent == 6 select cycle; double CycleCount = plan.CycleCount; double forceoffs = ForceOffs.Count(); double ForcePercent = 0; if (CycleCount > 0) { ForcePercent = forceoffs / CycleCount; } var forceLabel = new CustomLabel(); forceLabel.FromPosition = plan.StartTime.ToOADate(); forceLabel.ToPosition = plan.EndTime.ToOADate(); forceLabel.Text = string.Format("{0:0.0%} ForceOffs", ForcePercent); forceLabel.LabelMark = LabelMarkStyle.LineSideMark; forceLabel.ForeColor = Color.MediumBlue; forceLabel.RowIndex = 3; chart.ChartAreas[0].AxisX2.CustomLabels.Add(forceLabel); } //Average Split if (ShowAverageSplit) { double runningTotal = 0; double averageSplits = 0; foreach (var Cycle in Cycles) { runningTotal = runningTotal + Cycle.Duration.TotalSeconds; } if (Cycles.Count() > 0) { averageSplits = runningTotal / Cycles.Count(); } var avgLabel = new CustomLabel(); avgLabel.FromPosition = plan.StartTime.ToOADate(); avgLabel.ToPosition = plan.EndTime.ToOADate(); avgLabel.Text = string.Format("{0: 0.0} Avg. Split", averageSplits); avgLabel.LabelMark = LabelMarkStyle.LineSideMark; avgLabel.ForeColor = Color.Black; avgLabel.RowIndex = 4; chart.ChartAreas[0].AxisX2.CustomLabels.Add(avgLabel); //Percentile Split if (SelectedPercentileSplit != null && Cycles.Count() > 2) { double percentileResult = 0; var Percentile = Convert.ToDouble(SelectedPercentileSplit) / 100; var setCount = Cycles.Count(); var PercentilIndex = Percentile * setCount; if (PercentilIndex % 1 == 0) { percentileResult = Cycles.ElementAt(Convert.ToInt16(PercentilIndex) - 1).Duration .TotalSeconds; } else { var indexMod = PercentilIndex % 1; //subtracting .5 leaves just the integer after the convert. //There was probably another way to do that, but this is easy. int indexInt = Convert.ToInt16(PercentilIndex - .5); var step1 = Cycles.ElementAt(Convert.ToInt16(indexInt) - 1).Duration.TotalSeconds; var step2 = Cycles.ElementAt(Convert.ToInt16(indexInt)).Duration.TotalSeconds; var stepDiff = step2 - step1; var step3 = stepDiff * indexMod; percentileResult = step1 + step3; } var percentileLabel = new CustomLabel(); percentileLabel.FromPosition = plan.StartTime.ToOADate(); percentileLabel.ToPosition = plan.EndTime.ToOADate(); percentileLabel.Text = string.Format("{0: 0.0} - {1} Percentile Split", percentileResult, Convert.ToDouble(SelectedPercentileSplit)); percentileLabel.LabelMark = LabelMarkStyle.LineSideMark; percentileLabel.ForeColor = Color.Purple; percentileLabel.RowIndex = 5; chart.ChartAreas[0].AxisX2.CustomLabels.Add(percentileLabel); } } } }
private void ReadSkillDB() { string sPath = oParentWindow.sLoadSkillFile; string sCSVPath = oParentWindow.sLoadFile; if (this.IsDisposed) { return; } Graphics G = CreateGraphics(); int nSkills = 0; if (File.Exists(sPath)) { string[] sLines; string[] sCSVLines; try { sLines = WriteSafeReadAllLines(sPath); sCSVLines = WriteSafeReadAllLines(sCSVPath); } catch { return; } this.SuspendLayout(); Font oFont = new Font("MS UI Gothic", 11f, FontStyle.Bold); Font oMonoFont = new Font("Consolas", 10f, FontStyle.Bold); if (nCurrentInstanceID == 0) { nCurrentInstanceID = oParentWindow.nInstanceID; } if (nCurrentInstanceID != oParentWindow.nInstanceID) { ColorRemember.Clear(); nCurrentInstanceID = oParentWindow.nInstanceID; } // Read InstanceData.csv to gather data of this player ID int nLine = 0; string sTopHeader = ""; foreach (string line in sCSVLines) { nLine++; if (nLine < 3) { continue; } string[] tmp = line.Split(','); uint uID = 0; try { uID = Convert.ToUInt32(tmp[0]); } catch (Exception e) { uID = 0; LogError(e, "SkillDB Error! Can't convert uID while parsing InstanceData.csv - " + line); } if (uID == uPlayerID) { sTopHeader = "Class: " + tmp[3] + " ・ " + tmp[5]; break; } } if (sTopHeader != "") { SizeF oStringSize = G.MeasureString(sTopHeader, oFont); oStringSize.Width += 4; oStringSize.Height += 4; Image oLabelImage = new Bitmap((int)oStringSize.Width, (int)oStringSize.Height); using (Graphics oG = Graphics.FromImage(oLabelImage)) { oG.Clear(Color.Transparent); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 0, 0); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 1, 0); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 2, 0); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 3, 0); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 4, 0); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 0, 1); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 1, 1); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 2, 1); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 3, 1); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 4, 1); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 0, 3); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 1, 3); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 2, 3); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 3, 3); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 4, 3); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 0, 4); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 1, 4); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 2, 4); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 3, 4); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 4, 4); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 0, 2); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 1, 2); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 3, 2); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.White), 4, 2); oG.DrawString(sTopHeader, oFont, new SolidBrush(Color.Black), 2, 2); TopHeader.Image = oLabelImage; TopHeader.ImageAlign = ContentAlignment.MiddleLeft; } } if (this.InvokeRequired) { BeginInvoke((Action)(() => { if (!this.Visible) { this.Show(); } })); } else { if (!this.Visible) { this.Show(); } } Chart oEncounterGraph = SGraph; if (SGraph.InvokeRequired) { BeginInvoke((Action)(() => { SGraph.Series.Clear(); SGraph.ChartAreas.Clear(); oEncounterGraph.Palette = ChartColorPalette.SemiTransparent; oEncounterGraph.BackColor = Color.FromArgb(222, 222, 222); })); } else { SGraph.Series.Clear(); SGraph.ChartAreas.Clear(); oEncounterGraph.Palette = ChartColorPalette.SemiTransparent; oEncounterGraph.BackColor = Color.FromArgb(222, 222, 222); } ChartArea chA = new ChartArea(); chA.BackColor = Color.FromArgb(180, 180, 180); chA.Name = "EncounterGraph"; chA.AxisX.MaximumAutoSize = 100; chA.AxisX.IsMarginVisible = false; chA.AxisX.LabelStyle.Enabled = true; chA.AxisX.MajorTickMark.Enabled = false; chA.AxisX.MajorGrid.Enabled = true; chA.AxisY.MajorTickMark.Enabled = false; chA.AxisY.MajorGrid.Enabled = false; chA.AxisY.MajorGrid.LineColor = Color.LightGray; chA.AxisY.LabelStyle.Enabled = false; chA.AxisX2.Enabled = AxisEnabled.True; chA.AxisX2.IsMarginVisible = false; chA.AxisX2.LabelStyle.Enabled = false; chA.AxisX2.MajorTickMark.Enabled = false; chA.AxisX2.MajorGrid.Enabled = false; chA.Position.X = 0; chA.Position.Y = 0; chA.Position.Width = 100; chA.Position.Height = 100; chA.BorderWidth = 0; chA.BorderColor = Color.Transparent; chA.AxisX.LabelStyle.Font = new System.Drawing.Font("MS UI Gothic", 11f, FontStyle.Bold); if (oEncounterGraph.InvokeRequired) { BeginInvoke((Action)(() => { oEncounterGraph.ChartAreas.Add(chA); })); } else { oEncounterGraph.ChartAreas.Add(chA); } Series oBottom = new Series("Bottom") { ChartType = SeriesChartType.StackedBar }; oBottom.SmartLabelStyle.AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.No; Series oSeries = new Series("Players") { ChartType = SeriesChartType.StackedBar, BorderColor = Color.Black, BorderWidth = 1 }; oSeries["PointWidth"] = "1"; oSeries.SmartLabelStyle.Enabled = false; int nPos = 0; long lYMax = 0; for (int n = 0; n < oParentWindow.nColorOffset; n++) { if (oColorList.Count > 0) { oColorList.RemoveAt(0); } else { break; } } foreach (string sLine in sLines) { if (sLine == "PID,AID,Damage,Min,Max,JA,Crit") { continue; } string[] tmp = sLine.Split(','); uint uPID = 0; string sName = ""; long lDamage = 0; long lMinDamage = 0; long lMaxDamage = 0; int nJA = 0; int nCrit = 0; try { uPID = Convert.ToUInt32(tmp[0]); } catch (Exception e) { uPID = 0; LogError(e, "Error parsing skilldb line - " + sLine); } sName = oParentWindow.ShortenSkillName(tmp[1]); try { lDamage = Convert.ToInt64(tmp[2]); } catch (Exception e) { lDamage = 0; LogError(e, "Error parsing skilldb line - " + sLine); } try { lMinDamage = Convert.ToInt64(tmp[3]); } catch (Exception e) { lMinDamage = 0; LogError(e, "Error parsing skilldb line - " + sLine); } try { lMaxDamage = Convert.ToInt64(tmp[4]); } catch (Exception e) { lMaxDamage = 0; LogError(e, "Error parsing skilldb line - " + sLine); } try { nJA = Convert.ToInt32(tmp[5]); } catch (Exception e) { nJA = 0; LogError(e, "Error parsing skilldb line - " + sLine); } try { nCrit = Convert.ToInt32(tmp[6]); } catch (Exception e) { nCrit = 0; LogError(e, "Error parsing skilldb line - " + sLine); } if (uPID == uPlayerID) { if (lDamage > lYMax) { lYMax = lDamage; } SizeF oStringSize; Image oLabelImage = null; NamedImage oImageAdd = null; DataPoint oPoint = new DataPoint(nPos, lDamage); DataPoint oPBottom = new DataPoint(nPos, 0); CustomLabel cl1 = new CustomLabel { FromPosition = nPos - 0.5, ToPosition = nPos + 0.5 }; Color oPointColor = new Color(); oPoint.IsValueShownAsLabel = false; if (oColorList.Count == 0) { oColorList = Extensions.Colors.ChartColorPallets.Pastel; } oPointColor = oColorList.First(); oColorList.RemoveAt(0); if (ColorRemember.ContainsKey(uPID.ToString() + "_" + sName)) { oPoint.Color = ColorRemember[uPID.ToString() + "_" + sName]; } else { ColorRemember.Add(uPID.ToString() + "_" + sName, oPointColor); oPoint.Color = oPointColor; } oStringSize = G.MeasureString(sName, oFont); oStringSize.Width += 4; oStringSize.Height += 4; oLabelImage = new Bitmap((int)oStringSize.Width, (int)oStringSize.Height); using (Graphics oG = Graphics.FromImage(oLabelImage)) { oG.Clear(Color.Transparent); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 0, 0); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 1, 0); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 2, 0); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 3, 0); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 4, 0); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 0, 1); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 1, 1); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 2, 1); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 3, 1); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 4, 1); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 0, 3); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 1, 3); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 2, 3); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 3, 3); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 4, 3); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 0, 4); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 1, 4); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 2, 4); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 3, 4); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 4, 4); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 0, 2); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 1, 2); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 3, 2); oG.DrawString(sName, oFont, new SolidBrush(Color.White), 4, 2); oG.DrawString(sName, oFont, new SolidBrush(Color.Black), 2, 2); oImageAdd = new NamedImage("SkillName" + nPos.ToString(), oLabelImage); bool bImageFound = false; foreach (NamedImage oCheck in SGraph.Images) { if (oCheck.Name == "SkillName" + nPos.ToString()) { bImageFound = true; oCheck.Image = oLabelImage; break; } } if (!bImageFound) { SGraph.Images.Add(oImageAdd); } cl1.Image = "SkillName" + nPos.ToString(); } // Setting DPS Text string sLabel = ""; string sDamage = lDamage.ToString("N0"); if (lDamage > 1000) { sDamage = (lDamage / 1000.0).ToString("N1") + "K"; } if (lDamage > 1000000) { sDamage = (lDamage / 1000000.0).ToString("N2") + "M"; } string sMinDamage = lMinDamage.ToString("N0"); if (lMinDamage > 1000) { sMinDamage = (lMinDamage / 1000.0).ToString("N1") + "K"; } if (lMinDamage > 1000000) { sMinDamage = (lMinDamage / 1000000.0).ToString("N2") + "M"; } string sMaxDamage = lMaxDamage.ToString("N0"); if (lMaxDamage > 1000) { sMaxDamage = (lMaxDamage / 1000.0).ToString("N1") + "K"; } if (lMaxDamage > 1000000) { sMaxDamage = (lMaxDamage / 1000000.0).ToString("N2") + "M"; } sLabel = $"Damage: {sDamage.PadLeft(7)} ・ Min: {sMinDamage.PadLeft(7)} ・ Max: {sMaxDamage.PadLeft(7)} ・ JA: {nJA.ToString("N0").PadLeft(3)}% ・ Crit: {nCrit.ToString("N0").PadLeft(3)}%"; oPBottom.Label = sLabel; if (SGraph.InvokeRequired) { BeginInvoke((Action)(() => { SGraph.ChartAreas[0].AxisX.CustomLabels.Add(cl1); })); } else { SGraph.ChartAreas[0].AxisX.CustomLabels.Add(cl1); } oBottom.Points.Add(oPBottom); oSeries.Points.Add(oPoint); nSkills++; nPos++; } } if (SGraph.InvokeRequired) { BeginInvoke((Action)(() => { SGraph.ChartAreas[0].AxisX.Minimum = -0.5; SGraph.ChartAreas[0].AxisX.Maximum = Convert.ToDouble(nPos - 0.5); SGraph.ChartAreas[0].AxisX2.Minimum = -0.5; SGraph.ChartAreas[0].AxisX2.Maximum = Convert.ToDouble(nPos - 0.5); SGraph.ChartAreas[0].AxisY.Maximum = lYMax; if (nSkills > 10) { SGraph.ChartAreas[0].AxisX.ScaleView.Zoomable = true; SGraph.ChartAreas[0].AxisX.ScrollBar.Enabled = true; SGraph.ChartAreas[0].AxisX.ScaleView.Size = 10; SGraph.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll; SGraph.ChartAreas[0].AxisX.ScaleView.Scroll(ScrollType.Last); SGraph.ChartAreas[0].AxisX.ScaleView.Scroll(ScrollType.First); SGraph.ChartAreas[0].AxisX.ScaleView.Scroll(ScrollType.Last); } SGraph.Series.Add(oBottom); SGraph.Series.Add(oSeries); })); } else { SGraph.ChartAreas[0].AxisX.Minimum = -0.5; SGraph.ChartAreas[0].AxisX.Maximum = Convert.ToDouble(nPos - 0.5); SGraph.ChartAreas[0].AxisX2.Minimum = -0.5; SGraph.ChartAreas[0].AxisX2.Maximum = Convert.ToDouble(nPos - 0.5); SGraph.ChartAreas[0].AxisY.Maximum = lYMax; if (nSkills > 10) { SGraph.ChartAreas[0].AxisX.ScaleView.Zoomable = true; SGraph.ChartAreas[0].AxisX.ScrollBar.Enabled = true; SGraph.ChartAreas[0].AxisX.ScaleView.Size = 10; SGraph.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll; SGraph.ChartAreas[0].AxisX.ScrollBar.ButtonColor = Color.LightGray; SGraph.ChartAreas[0].AxisX.ScrollBar.BackColor = Color.Gray; SGraph.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false; SGraph.ChartAreas[0].AxisX.ScaleView.Scroll(ScrollType.Last); SGraph.ChartAreas[0].AxisX.ScaleView.Scroll(ScrollType.First); SGraph.ChartAreas[0].AxisX.ScaleView.Scroll(ScrollType.Last); } SGraph.Series.Add(oBottom); SGraph.Series.Add(oSeries); } } this.ResumeLayout(); int nNewHeight = 0; if (this.FormBorderStyle == FormBorderStyle.SizableToolWindow) { nNewHeight = 83; } else { nNewHeight = 58; } if (nSkills < 11) { nNewHeight += (28 * (nSkills)); } else { nNewHeight += (28 * 10); } if (this.InvokeRequired) { BeginInvoke((Action)(() => { this.Size = new System.Drawing.Size(this.Width, nNewHeight); })); } else { this.Size = new System.Drawing.Size(this.Width, nNewHeight); } }
private void SetCustomAxisLabels(Axis axis, int dimension) { if (Content == null) { return; } if (!Content.Any()) { return; } axis.CustomLabels.Clear(); if (categoricalMapping.ContainsKey(dimension)) { int position = 1; foreach (var pair in categoricalMapping[dimension].Where(x => seriesCache.ContainsKey(x.Value))) { string labelText = pair.Key.ToString(); CustomLabel label = new CustomLabel(); label.ToolTip = labelText; if (labelText.Length > 25) { labelText = labelText.Substring(0, 25) + " ... "; } label.Text = labelText; label.GridTicks = GridTickTypes.TickMark; label.FromPosition = position - 0.5; label.ToPosition = position + 0.5; axis.CustomLabels.Add(label); position++; } } else if (dimension > 0 && Content.GetValue(0, dimension) is TimeSpanValue) { this.chart.ChartAreas[0].RecalculateAxesScale(); Axis correspondingAxis = this.chart.ChartAreas[0].Axes.Where(x => x.Name == axis.Name).SingleOrDefault(); if (correspondingAxis == null) { correspondingAxis = axis; } for (double i = correspondingAxis.Minimum; i <= correspondingAxis.Maximum; i += correspondingAxis.LabelStyle.Interval) { TimeSpan time = TimeSpan.FromSeconds(i); string x = string.Format("{0:00}:{1:00}:{2:00}", (int)time.Hours, time.Minutes, time.Seconds); axis.CustomLabels.Add(i - correspondingAxis.LabelStyle.Interval / 2, i + correspondingAxis.LabelStyle.Interval / 2, x); } } else if (chart.ChartAreas[BoxPlotChartAreaName].AxisX == axis) { double position = 1.0; foreach (Series series in chart.Series) { if (series.Name != BoxPlotSeriesName) { string labelText = series.Points[0].XValue.ToString(); CustomLabel label = new CustomLabel(); label.FromPosition = position - 0.5; label.ToPosition = position + 0.5; label.GridTicks = GridTickTypes.TickMark; label.Text = labelText; axis.CustomLabels.Add(label); position++; } } } }
public void CreateView() { var gridLayout = new Grid { RowSpacing = 10, Padding = new Thickness(0, 10, 0, 10), Margin = 10 }; gridLayout.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(2, GridUnitType.Star) }); gridLayout.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(2, GridUnitType.Star) }); gridLayout.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) }); gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); var outerlayout = new StackLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start }; StackLayout innerlayout = null; int count = list.Count; var amp = list; int colmCounter = 0; KeyToValueConverter keyToValue = new KeyToValueConverter(); var product = amp[0]; for (int i = 0; i < product.Count; i++) { if (i % 2 == 0) { innerlayout = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand }; outerlayout.Children.Add(innerlayout); colmCounter = 0; } object jj = null; if (product[i].ContainsValue("Label")) { var x = product[i]; foreach (var item in x) { if (!item.Value.Equals("Label")) { jj = item.Value; } } var label = new CustomLabel { Text = "dummy" + i.ToString(), FontSize = 15, VerticalOptions = LayoutOptions.FillAndExpand, Index = i.ToString(), BindingKey = (string)jj, WidthRequest = 100, Margin = new Thickness(10, 0, 0, 0) }; if (colmCounter % 2 == 0) { label.HorizontalOptions = LayoutOptions.Start; } else { label.HorizontalOptions = LayoutOptions.CenterAndExpand; // label.Margin = new Thickness(10, 0, 0, 0); } //var test = label.BindingKey; //object t1 = new object(); //t1 = test; // var test = x; object t1 = new object(); t1 = i; // t1 = test; label.SetBinding(CustomLabel.BindingKeyProperty, new Binding(".", BindingMode.TwoWay, new KeyToValueConverter(), t1, null, this.BindingContext)); // label.SetBinding(Label.TextProperty, ".",BindingMode.Default,null); gridLayout.Children.Add(label, colmCounter, 1); innerlayout.Children.Add(label); Grid.SetColumnSpan(outerlayout, 2); colmCounter++; } } gridLayout.Children.Add(outerlayout); View = new CustomFrame { Content = gridLayout, CornerRadius = 10, HasShadow = true, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.Fill, Margin = new Thickness(10, 5, 10, 5), Padding = 0, BorderColor = Color.Gray, }; // View.HeightRequest = 150; this.View.Margin = 5; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { kit_kat.AdobeColors.HSB hsb1 = new kit_kat.AdobeColors.HSB(); kit_kat.AdobeColors.HSB hsb2 = new kit_kat.AdobeColors.HSB(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ColorPicker)); this.m_txt_Hex = new System.Windows.Forms.TextBox(); this.m_lbl_HexPound = new System.Windows.Forms.Label(); this.m_lbl_Primary_Color = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.controlBox1 = new kit_kat.ControlBox(); this.AppTitle = new kit_kat.CustomLabel(); this.m_ctrl_BigBox = new kit_kat.ctrl2DColorBox(); this.m_ctrl_ThinBox = new kit_kat.ctrlVerticalColorSlider(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // m_txt_Hex // this.m_txt_Hex.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.m_txt_Hex.Location = new System.Drawing.Point(307, 40); this.m_txt_Hex.Name = "m_txt_Hex"; this.m_txt_Hex.Size = new System.Drawing.Size(55, 20); this.m_txt_Hex.TabIndex = 19; this.m_txt_Hex.Leave += new System.EventHandler(this.m_txt_Hex_Leave); // // m_lbl_HexPound // this.m_lbl_HexPound.Location = new System.Drawing.Point(290, 42); this.m_lbl_HexPound.Name = "m_lbl_HexPound"; this.m_lbl_HexPound.Size = new System.Drawing.Size(19, 15); this.m_lbl_HexPound.TabIndex = 27; this.m_lbl_HexPound.Text = "#"; // // m_lbl_Primary_Color // this.m_lbl_Primary_Color.BackColor = System.Drawing.Color.White; this.m_lbl_Primary_Color.Location = new System.Drawing.Point(288, 5); this.m_lbl_Primary_Color.Name = "m_lbl_Primary_Color"; this.m_lbl_Primary_Color.Size = new System.Drawing.Size(74, 29); this.m_lbl_Primary_Color.TabIndex = 36; // // panel1 // this.panel1.Controls.Add(this.m_ctrl_BigBox); this.panel1.Controls.Add(this.m_lbl_Primary_Color); this.panel1.Controls.Add(this.m_ctrl_ThinBox); this.panel1.Controls.Add(this.m_txt_Hex); this.panel1.Controls.Add(this.m_lbl_HexPound); this.panel1.Location = new System.Drawing.Point(0, 29); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(367, 254); this.panel1.TabIndex = 40; // // controlBox1 // this.controlBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.controlBox1.Font = new System.Drawing.Font("Verdana", 8F); this.controlBox1.Location = new System.Drawing.Point(299, 0); this.controlBox1.Name = "controlBox1"; this.controlBox1.Size = new System.Drawing.Size(68, 29); this.controlBox1.TabIndex = 41; this.controlBox1.Text = "controlBox1"; // // AppTitle // this.AppTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.AppTitle.ForeColor = System.Drawing.Color.White; this.AppTitle.Location = new System.Drawing.Point(0, 0); this.AppTitle.Name = "AppTitle"; this.AppTitle.Size = new System.Drawing.Size(144, 29); this.AppTitle.TabIndex = 42; this.AppTitle.Tag = "Overide"; this.AppTitle.Text = "kit-kat - Color Picker"; this.AppTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // m_ctrl_BigBox // this.m_ctrl_BigBox.BaseColorComponent = kit_kat.ColorComponent.Hue; hsb1.B = 1D; hsb1.H = 0D; hsb1.S = 1D; this.m_ctrl_BigBox.HSB = hsb1; this.m_ctrl_BigBox.Location = new System.Drawing.Point(-2, -2); this.m_ctrl_BigBox.Name = "m_ctrl_BigBox"; this.m_ctrl_BigBox.RGB = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.m_ctrl_BigBox.Size = new System.Drawing.Size(256, 256); this.m_ctrl_BigBox.TabIndex = 39; this.m_ctrl_BigBox.WebSafeColorsOnly = false; this.m_ctrl_BigBox.SelectionChanged += new System.EventHandler(this.m_ctrl_BigBox_SelectionChanged); // // m_ctrl_ThinBox // this.m_ctrl_ThinBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(108)))), ((int)(((byte)(128))))); this.m_ctrl_ThinBox.BaseColorComponent = kit_kat.ColorComponent.Hue; hsb2.B = 1D; hsb2.H = 0D; hsb2.S = 1D; this.m_ctrl_ThinBox.HSB = hsb2; this.m_ctrl_ThinBox.Location = new System.Drawing.Point(244, -4); this.m_ctrl_ThinBox.Name = "m_ctrl_ThinBox"; this.m_ctrl_ThinBox.RGB = System.Drawing.Color.Red; this.m_ctrl_ThinBox.Size = new System.Drawing.Size(39, 262); this.m_ctrl_ThinBox.TabIndex = 38; this.m_ctrl_ThinBox.WebSafeColorsOnly = false; this.m_ctrl_ThinBox.SelectionChanged += new System.EventHandler(this.m_ctrl_ThinBox_SelectionChanged); // // ColorPicker // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(118)))), ((int)(((byte)(138))))); this.ClientSize = new System.Drawing.Size(367, 283); this.Controls.Add(this.controlBox1); this.Controls.Add(this.AppTitle); this.Controls.Add(this.panel1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "ColorPicker"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "kit-kat - Color Picker"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ColorPicker_FormClosed); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FormDrag); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); }
private void InitializeComponent() { this.lblTitle = new Narivia.CustomLabel(); this.pbIcon = new System.Windows.Forms.PictureBox(); this.pbAttack = new System.Windows.Forms.PictureBox(); this.pbHealth = new System.Windows.Forms.PictureBox(); this.lblAttack = new Narivia.CustomLabel(); this.lblHealth = new Narivia.CustomLabel(); ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbAttack)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbHealth)).BeginInit(); this.SuspendLayout(); // // lblTitle // this.lblTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblTitle.BackColor = System.Drawing.Color.Transparent; this.lblTitle.Font = new System.Drawing.Font("Palatino Linotype", 14.25F, System.Drawing.FontStyle.Bold); this.lblTitle.ForeColor = System.Drawing.Color.Gold; this.lblTitle.Location = new System.Drawing.Point(0, 0); this.lblTitle.Name = "lblTitle"; this.lblTitle.ShadowColor = System.Drawing.Color.Black; this.lblTitle.Size = new System.Drawing.Size(256, 24); this.lblTitle.TabIndex = 0; this.lblTitle.Text = "Unit (Nr)"; this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // pbIcon // this.pbIcon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.pbIcon.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.pbIcon.Location = new System.Drawing.Point(180, 29); this.pbIcon.Name = "pbIcon"; this.pbIcon.Size = new System.Drawing.Size(64, 64); this.pbIcon.TabIndex = 0; this.pbIcon.TabStop = false; this.pbIcon.SizeMode = PictureBoxSizeMode.StretchImage; // // pbAttack // this.pbAttack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.pbAttack.Location = new System.Drawing.Point(12, 31); this.pbAttack.Name = "pbAttack"; this.pbAttack.Size = new System.Drawing.Size(16, 16); this.pbAttack.TabIndex = 0; this.pbAttack.TabStop = false; // // pbHealth // this.pbHealth.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.pbHealth.Location = new System.Drawing.Point(12, 53); this.pbHealth.Name = "pbHealth"; this.pbHealth.Size = new System.Drawing.Size(16, 16); this.pbHealth.TabIndex = 0; this.pbHealth.TabStop = false; // // lblAttack // this.lblAttack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lblAttack.AutoSize = true; this.lblAttack.BackColor = System.Drawing.Color.Transparent; this.lblAttack.Font = new System.Drawing.Font("Palatino Linotype", 9.75F, System.Drawing.FontStyle.Bold); this.lblAttack.ForeColor = System.Drawing.Color.Gold; this.lblAttack.Location = new System.Drawing.Point(34, 30); this.lblAttack.Name = "lblAttack"; this.lblAttack.ShadowColor = System.Drawing.Color.Black; this.lblAttack.Size = new System.Drawing.Size(15, 18); this.lblAttack.TabIndex = 0; this.lblAttack.Text = "0"; // // lblHealth // this.lblHealth.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lblHealth.AutoSize = true; this.lblHealth.BackColor = System.Drawing.Color.Transparent; this.lblHealth.Font = new System.Drawing.Font("Palatino Linotype", 9.75F, System.Drawing.FontStyle.Bold); this.lblHealth.ForeColor = System.Drawing.Color.Gold; this.lblHealth.Location = new System.Drawing.Point(34, 52); this.lblHealth.Name = "lblHealth"; this.lblHealth.ShadowColor = System.Drawing.Color.Black; this.lblHealth.Size = new System.Drawing.Size(15, 18); this.lblHealth.TabIndex = 0; this.lblHealth.Text = "0"; // // UnitCard // this.BackColor = System.Drawing.Color.DarkRed; this.Controls.Add(this.lblTitle); this.Controls.Add(this.pbIcon); this.Controls.Add(this.pbAttack); this.Controls.Add(this.pbHealth); this.Controls.Add(this.lblAttack); this.Controls.Add(this.lblHealth); this.Size = new System.Drawing.Size(256, 105); ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbAttack)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbHealth)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
// 실시간 거래 private void Showdeal() { RealTimeGrid.Children.Clear(); RealTimeGrid.RowDefinitions.Clear(); #region 네트워크 상태 확인 var current_network = Connectivity.NetworkAccess; // 현재 네트워크 상태 if (current_network == NetworkAccess.Internet) // 네트워크 연결 가능 { g_DealInfolist = giftDBFunc.SelectDealList(); // 실시간 거래 리스트 검색 } else { g_DealInfolist = null; } #endregion #region 네트워크 연결 불가 if (g_DealInfolist == null) // 네트워크 연결 불가 { RealTimeGrid.RowDefinitions.Add(new RowDefinition { Height = 30 }); CustomLabel label = new CustomLabel { //Text = "네트워크에 연결할 수 없습니다. 다시 시도해 주세요.", // 위치가 좀 달라서 굳이 띄우진 않겠음 Size = 14, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; RealTimeGrid.Children.Add(label, 0, 0); //실시간거래 그리드에 라벨추가 return; } #endregion #region 실시간 거래 내역 검색 불가 if (g_DealInfolist == null) { RealTimeGrid.RowDefinitions.Add(new RowDefinition { Height = 30 }); CustomLabel label = new CustomLabel { Text = "조회실패", Size = 14, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; RealTimeGrid.Children.Add(label, 0, 0); //실시간거래 그리드에 라벨추가 return; } if (g_DealInfolist.Count == 0) { RealTimeGrid.RowDefinitions.Add(new RowDefinition { Height = 30 }); CustomLabel label = new CustomLabel { //Text = "거래내역이 없습니다", Size = 14, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; RealTimeGrid.Children.Add(label, 0, 0); //실시간거래 그리드에 라벨추가 return; } #endregion #region 실시간 거래 내역 가져오기 for (int i = 0; i < g_DealInfolist.Count; i++) { RealTimeGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(3, GridUnitType.Auto) }); Grid inGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(2, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(8, GridUnitType.Star) }, }, }; BoxView statusLine = new BoxView { BackgroundColor = Color.CornflowerBlue, Margin = 2, }; // 결제 상태 레이블 CustomLabel statusLabel = new CustomLabel { TextColor = Color.White, Size = 14, Text = "거래완료", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, }; inGrid.Children.Add(statusLine, 0, 0); inGrid.Children.Add(statusLabel, 0, 0); string name = ""; string title = g_DealInfolist[i].TITLE; if (g_DealInfolist[i].NAME != null && g_DealInfolist[i].NAME != "") { if (g_DealInfolist[i].NAME.Length == 2) { name = g_DealInfolist[i].NAME.Remove(1) + "*"; } else if (g_DealInfolist[i].NAME.Length == 3) { name = g_DealInfolist[i].NAME.Remove(1) + "*" + g_DealInfolist[i].NAME.Remove(0, 2); } else if (g_DealInfolist[i].NAME.Length == 4) { name = g_DealInfolist[i].NAME.Remove(1) + "**" + g_DealInfolist[i].NAME.Remove(0, 3); } else { name = "비회원"; } } if (g_DealInfolist[i].ISCHECK.Equals("1")) { title += " 구매"; } else { title += " 판매"; } DateTime date = DateTime.ParseExact(g_DealInfolist[i].TOTALDATE, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); string time = date.TimeOfDay.ToString(); string s4 = date.Day.ToString(); string hour = date.Hour.ToString(); string minute = date.Minute.ToString(); CustomLabel dateLabel = new CustomLabel { Text = name + " " + title + "[" + hour + ":" + minute + "]", Size = 14, TextColor = Color.Black, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start }; inGrid.Children.Add(dateLabel, 1, 0); RealTimeGrid.Children.Add(inGrid, 0, i); //실시간거래 그리드에 행 추가 } #endregion }
public MainPage() { var viemodel = new MainPageViewModel(); SetBinding(_myProperty, new Binding("IsVisible")); AbsoluteLayout layout = new AbsoluteLayout(); ListView listView = new ListView { HasUnevenRows = true, ItemsSource = viemodel.Articles, ItemTemplate = new DataTemplate(() => { Label titleLabel; if ((int)Android.OS.Build.VERSION.SdkInt >= 21) { titleLabel = new CustomLabel(); } else { titleLabel = new Label(); } titleLabel.SetBinding(Label.TextProperty, "Title"); Image image = new Image { Aspect = Aspect.AspectFill }; image.SetBinding(Image.SourceProperty, "UrlToImage"); Label desc = new Label(); desc.SetBinding(Label.TextProperty, "DescriptionFormatted"); return(new ViewCell { View = new StackLayout { Padding = new Thickness(16, 16, 16, 0), Orientation = StackOrientation.Vertical, Children = { titleLabel, image, desc } } }); }) }; listView.ItemSelected += OnSelected; AbsoluteLayout.SetLayoutBounds(listView, new Rectangle(1, 1, 1, 1)); AbsoluteLayout.SetLayoutFlags(listView, AbsoluteLayoutFlags.All); ActivityIndicator indicator = new ActivityIndicator { Color = Color.Azure, IsRunning = false, IsVisible = false }; AbsoluteLayout.SetLayoutBounds(indicator, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); AbsoluteLayout.SetLayoutFlags(indicator, AbsoluteLayoutFlags.PositionProportional); layout.Children.Add(listView); layout.Children.Add(indicator); this.Content = layout; BindingContext = viemodel; }
private void btnRun_Click(object sender, EventArgs e) { try { if (cboFieldName.Text == "") { MessageBox.Show("Please select target field"); return; } frmProgress pfrmProgress = new frmProgress(); pfrmProgress.lblStatus.Text = "Processing:"; pfrmProgress.pgbProgress.Style = ProgressBarStyle.Marquee; pfrmProgress.Show(); //Close Results form, if it is opend. CloseOpendResultForm(m_pHandle); IGraphicsContainer pGraphicContainer = m_pActiveView.GraphicsContainer; pGraphicContainer.DeleteAllElements(); // Creates the input and output matrices from the shapefile// string strLayerName = cboTargetLayer.Text; int intLIndex = m_pSnippet.GetIndexNumberFromLayerName(m_pActiveView, strLayerName); ILayer pLayer = m_pForm.axMapControl1.get_Layer(intLIndex); IFeatureLayer pFLayer = pLayer as IFeatureLayer; //IFeatureClass pFClass = pFLayer.FeatureClass; m_intNFeature = m_pFClass.FeatureCount(null); IFeatureCursor pFCursor = m_pFClass.Search(null, true); IFeature pFeature = pFCursor.NextFeature(); //Get index for independent and dependent variables //Get variable index string strVarNM = (string)cboFieldName.SelectedItem; int intVarIdx = m_pFClass.FindField(strVarNM); //Store Variable at Array double[] arrVar = new double[m_intNFeature]; m_arrXYCoord = new double[m_intNFeature, 2]; int i = 0; IArea pArea; IPoint pPoint; while (pFeature != null) { if (m_pFClass.ShapeType == esriGeometryType.esriGeometryPolygon) { pArea = (IArea)pFeature.Shape; m_arrXYCoord[i, 0] = pArea.Centroid.X; m_arrXYCoord[i, 1] = pArea.Centroid.Y; } else if (m_pFClass.ShapeType == esriGeometryType.esriGeometryPoint) { pPoint = (IPoint)pFeature.Shape; m_arrXYCoord[i, 0] = pPoint.X; m_arrXYCoord[i, 1] = pPoint.Y; } arrVar[i] = Convert.ToDouble(pFeature.get_Value(intVarIdx)); i++; pFeature = pFCursor.NextFeature(); } if (!m_blnCreateSWM) { //Get the file path and name to create spatial weight matrix string strNameR = m_pSnippet.FilePathinRfromLayer(pFLayer); if (strNameR == null) { return; } //Create spatial weight matrix in R if (m_pFClass.ShapeType == esriGeometryType.esriGeometryPolygon) { m_pEngine.Evaluate("sample.shp <- readShapePoly('" + strNameR + "')"); } else if (m_pFClass.ShapeType == esriGeometryType.esriGeometryPoint) { m_pEngine.Evaluate("sample.shp <- readShapePoints('" + strNameR + "')"); } else { MessageBox.Show("This geometry type is not supported"); pfrmProgress.Close(); this.Close(); } int intSuccess = m_pSnippet.CreateSpatialWeightMatrix(m_pEngine, m_pFClass, txtSWM.Text, pfrmProgress); if (intSuccess == 0) { return; } } ////Get the file path and name to create spatial weight matrix //string strNameR = m_pSnippet.FilePathinRfromLayer(pFLayer); //if (strNameR == null) // return; //int intSuccess = 0; ////Create spatial weight matrix in R //if (m_pFClass.ShapeType == esriGeometryType.esriGeometryPolygon) //{ // m_pEngine.Evaluate("sample.shp <- readShapePoly('" + strNameR + "')"); // intSuccess = m_pSnippet.CreateSpatialWeightMatrix1(m_pEngine, m_pFClass, txtSWM.Text, pfrmProgress, Convert.ToDouble(nudAdvanced.Value), chkCumulate.Checked); //} //else if (m_pFClass.ShapeType == esriGeometryType.esriGeometryPoint) //{ // m_pEngine.Evaluate("sample.shp <- readShapePoints('" + strNameR + "')"); // //intSuccess = m_pSnippet.ExploreSpatialWeightMatrix1(m_pEngine, m_pFClass, txtSWM.Text, pfrmProgress, Convert.ToDouble(nudAdvanced.Value), chkCumulate.Checked); // intSuccess = m_pSnippet.CreateSpatialWeightMatrixPts(m_pEngine, m_pFClass, txtSWM.Text, pfrmProgress, Convert.ToDouble(nudAdvanced.Value), chkCumulate.Checked, m_pClippedPolygon); // //chkCumulate.Visible = false; //} //else //{ // MessageBox.Show("This geometry type is not supported"); // pfrmProgress.Close(); // this.Close(); //} //if (intSuccess == 0) // return; //Creat Higher spatial lag int intMaxLag = Convert.ToInt32(nudLagOrder.Value); try { m_pEngine.Evaluate("sample.nblags <- nblag(sample.nb, maxlag = " + intMaxLag.ToString() + ")"); } catch { MessageBox.Show("Please reduce the maximum lag order"); } m_arrResults = new double[intMaxLag][]; m_arrMaxToLinks = new double[intMaxLag][]; m_arrMaxFromLinks = new double[intMaxLag]; pChart.Series.Clear(); //Plot command for R StringBuilder plotCommmand = new StringBuilder(); NumericVector vecVar = m_pEngine.CreateNumericVector(arrVar); m_pEngine.SetSymbol(strVarNM, vecVar); bool blnZeroPolicy = false; //Store Information of spatial lag for (int j = 0; j < intMaxLag; j++) { m_arrResults[j] = new double[5]; m_pEngine.Evaluate("card.sample <- card(sample.nblags[[" + (j + 1).ToString() + "]])"); m_arrResults[j][0] = m_pEngine.Evaluate("sum(card.sample)").AsNumeric().First(); //If ther is no link, return if (m_arrResults[j][0] == 0) { MessageBox.Show("There is no link at " + (j + 1).ToString() + " order."); return; } //Functions below are used for brushing on map control, they are under reviewing 080316 HK //m_arrMaxFromLinks[j] = m_pEngine.Evaluate("which.max(card.sample)").AsNumeric().First(); //m_arrMaxToLinks[j] = m_pEngine.Evaluate("sample.nblags[[" + (j + 1).ToString() + "]][[which.max(card.sample)]]").AsNumeric().ToArray(); //Select method if (cboSAM.Text == "Moran Coefficient") { try { m_pEngine.Evaluate("sample.listw <- nb2listw(sample.nblags[[" + (j + 1).ToString() + "]], style='W')"); } catch { DialogResult dialogResult = new DialogResult(); if (blnZeroPolicy == false) { dialogResult = MessageBox.Show("Empty neighbor sets are founded. Do you want to continue?", "Empty neighbor", MessageBoxButtons.YesNo); } if (dialogResult == DialogResult.Yes || blnZeroPolicy == true) { m_pEngine.Evaluate("sample.listw <- nb2listw(sample.nblags[[" + (j + 1).ToString() + "]], style='W', zero.policy=TRUE)"); blnZeroPolicy = true; } else if (dialogResult == DialogResult.No) { pfrmProgress.Close(); return; } } plotCommmand.Append("sam.result <- moran.test(" + strVarNM + ", sample.listw, "); //select assumption if (cboAssumption.Text == "Normality") { plotCommmand.Append("randomisation=FALSE, alternative ='two.sided', zero.policy=TRUE)"); } else if (cboAssumption.Text == "Randomization") { plotCommmand.Append("randomisation=TRUE, alternative ='two.sided', zero.policy=TRUE)"); } } else if (cboSAM.Text == "Geary Ratio") { try { m_pEngine.Evaluate("sample.listw <- nb2listw(sample.nblags[[" + (j + 1).ToString() + "]], style='W')"); } catch { DialogResult dialogResult = new DialogResult(); if (blnZeroPolicy == false) { dialogResult = MessageBox.Show("Empty neighbor sets are founded. Do you want to continue?", "Empty neighbor", MessageBoxButtons.YesNo); } if (dialogResult == DialogResult.Yes || blnZeroPolicy == true) { m_pEngine.Evaluate("sample.listw <- nb2listw(sample.nblags[[" + (j + 1).ToString() + "]], style='W', zero.policy=TRUE)"); blnZeroPolicy = true; } else if (dialogResult == DialogResult.No) { pfrmProgress.Close(); return; } } plotCommmand.Append("sam.result <- geary.test(" + strVarNM + ", sample.listw, "); //select assumption if (cboAssumption.Text == "Normality") { plotCommmand.Append("randomisation=FALSE, alternative ='two.sided', zero.policy=TRUE)"); } else if (cboAssumption.Text == "Randomization") { plotCommmand.Append("randomisation=TRUE, alternative ='two.sided', zero.policy=TRUE)"); } } else if (cboSAM.Text == "Global G Statistic") { try { m_pEngine.Evaluate("sample.listw <- nb2listw(sample.nblags[[" + (j + 1).ToString() + "]], style='W')"); } catch { DialogResult dialogResult = new DialogResult(); if (blnZeroPolicy == false) { dialogResult = MessageBox.Show("Empty neighbor sets are founded. Do you want to continue?", "Empty neighbor", MessageBoxButtons.YesNo); } if (dialogResult == DialogResult.Yes || blnZeroPolicy == true) { m_pEngine.Evaluate("sample.listw <- nb2listw(sample.nblags[[" + (j + 1).ToString() + "]], style='B', zero.policy=TRUE)"); blnZeroPolicy = true; } else if (dialogResult == DialogResult.No) { pfrmProgress.Close(); return; } } plotCommmand.Append("sam.result <- globalG.test(" + strVarNM + ", sample.listw, alternative ='two.sided', zero.policy=TRUE)"); } m_pEngine.Evaluate(plotCommmand.ToString()); plotCommmand.Clear(); NumericVector vecResults = m_pEngine.Evaluate("sam.result$estimate").AsNumeric(); m_arrResults[j][1] = vecResults[0]; m_arrResults[j][2] = vecResults[1]; m_arrResults[j][3] = vecResults[2]; m_arrResults[j][4] = m_pEngine.Evaluate("sam.result$p.value").AsNumeric().First(); double dblXmin = (j + 1) - 0.2; double dblXmax = (j + 1) + 0.2; double dblYmax = vecResults[0] + (Math.Sqrt(vecResults[2]) * 1.96); double dblYmin = vecResults[0] - (Math.Sqrt(vecResults[2]) * 1.96); AddLineSeries(pChart, "min_" + j.ToString(), Color.Black, 1, ChartDashStyle.Solid, dblXmin, dblXmax, dblYmin, dblYmin); AddLineSeries(pChart, "max_" + j.ToString(), Color.Black, 1, ChartDashStyle.Solid, dblXmin, dblXmax, dblYmax, dblYmax); AddLineSeries(pChart, "rg_" + j.ToString(), Color.Black, 1, ChartDashStyle.Solid, (j + 1), (j + 1), dblYmin, dblYmax); } //pEngine.Evaluate("sample.nb <- poly2nb(sample.shp);sample.listw <- nb2listw(sample.nb, style='W')"); double dblExp = m_arrResults[0][2]; AddLineSeries(pChart, "ex", Color.Red, 1, ChartDashStyle.Dash, 0.5, intMaxLag + 0.5, dblExp, dblExp); var pSeries = new System.Windows.Forms.DataVisualization.Charting.Series { Name = "Point", Color = Color.Black, IsXValueIndexed = false, ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point, MarkerStyle = MarkerStyle.Circle, }; pChart.Series.Add(pSeries); for (int j = 0; j < intMaxLag; j++) { pSeries.Points.AddXY((j + 1), m_arrResults[j][1]); } m_intTotalNSeries = pChart.Series.Count; //Chart Design pChart.ChartAreas[0].AxisX.Title = "Spatial Lag"; pChart.ChartAreas[0].AxisY.Title = cboSAM.Text; pChart.ChartAreas[0].AxisY.IsStartedFromZero = false; pChart.ChartAreas[0].AxisX.Maximum = intMaxLag + 0.5; pChart.ChartAreas[0].AxisX.Minimum = 0.5; pChart.ChartAreas[0].AxisX.MajorTickMark.Enabled = false; //need to be updated 042816 HK pChart.ChartAreas[0].AxisX.IsLabelAutoFit = false; for (int j = 0; j < intMaxLag; j++) { int intXvalue = j + 1; double dblXmin = Convert.ToDouble(intXvalue) - 0.5; double dblXmax = Convert.ToDouble(intXvalue) + 0.5; CustomLabel pcutsomLabel = new CustomLabel(); pcutsomLabel.FromPosition = dblXmin; pcutsomLabel.ToPosition = dblXmax; pcutsomLabel.Text = intXvalue.ToString(); pChart.ChartAreas[0].AxisX.CustomLabels.Add(pcutsomLabel); } pfrmProgress.Close(); } catch (Exception ex) { frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog(); return; } }
public IPersistable CreateRIFObject(ObjectType objectType, ref IntermediateFormatReader context) { IPersistable persistable = null; if (objectType == ObjectType.Null) { return(null); } IDOwner parentIDOwner = m_parentIDOwner; ReportItem parentReportItem = m_parentReportItem; switch (objectType) { case ObjectType.PageSection: persistable = new PageSection(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Line: persistable = new Line(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Rectangle: persistable = new Rectangle(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Image: persistable = new Image(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.TextBox: persistable = new TextBox(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.SubReport: persistable = new SubReport(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Grouping: persistable = new Grouping(ConstructionPhase.Deserializing); break; case ObjectType.Sorting: persistable = new Sorting(ConstructionPhase.Deserializing); break; case ObjectType.ReportItemCollection: persistable = new ReportItemCollection(); break; case ObjectType.ReportItemIndexer: persistable = default(ReportItemIndexer); break; case ObjectType.Style: persistable = new Style(ConstructionPhase.Deserializing); break; case ObjectType.AttributeInfo: persistable = new AttributeInfo(); break; case ObjectType.Visibility: persistable = new Visibility(); break; case ObjectType.ExpressionInfo: persistable = new ExpressionInfo(); break; case ObjectType.ExpressionInfoTypeValuePair: persistable = new ExpressionInfoTypeValuePair(); break; case ObjectType.DataAggregateInfo: persistable = new DataAggregateInfo(); break; case ObjectType.RunningValueInfo: persistable = new RunningValueInfo(); break; case ObjectType.Filter: persistable = new Filter(); break; case ObjectType.DataSource: persistable = new DataSource(); break; case ObjectType.DataSet: persistable = new DataSet(); break; case ObjectType.ReportQuery: persistable = new ReportQuery(); break; case ObjectType.Field: persistable = new Field(); break; case ObjectType.ParameterValue: persistable = new ParameterValue(); break; case ObjectType.ReportSnapshot: persistable = new ReportSnapshot(); break; case ObjectType.DocumentMapNode: persistable = new DocumentMapNode(); break; case ObjectType.DocumentMapBeginContainer: persistable = DocumentMapBeginContainer.Instance; break; case ObjectType.DocumentMapEndContainer: persistable = DocumentMapEndContainer.Instance; break; case ObjectType.ReportInstance: persistable = new ReportInstance(); break; case ObjectType.ParameterInfo: persistable = new ParameterInfo(); break; case ObjectType.ValidValue: persistable = new ValidValue(); break; case ObjectType.ParameterDataSource: persistable = new ParameterDataSource(); break; case ObjectType.ParameterDef: persistable = new ParameterDef(); break; case ObjectType.ProcessingMessage: persistable = new ProcessingMessage(); break; case ObjectType.CodeClass: persistable = default(CodeClass); break; case ObjectType.Action: persistable = new Action(); break; case ObjectType.RenderingPagesRanges: persistable = default(RenderingPagesRanges); break; case ObjectType.IntermediateFormatVersion: persistable = new IntermediateFormatVersion(); break; case ObjectType.ImageInfo: persistable = new ImageInfo(); break; case ObjectType.ActionItem: persistable = new ActionItem(); break; case ObjectType.DataValue: persistable = new DataValue(); break; case ObjectType.CustomReportItem: persistable = new CustomReportItem(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.SortFilterEventInfoMap: persistable = new SortFilterEventInfoMap(); break; case ObjectType.SortFilterEventInfo: persistable = new SortFilterEventInfo(); break; case ObjectType.EndUserSort: persistable = new EndUserSort(); break; case ObjectType.ScopeLookupTable: persistable = new ScopeLookupTable(); break; case ObjectType.Tablix: persistable = new Tablix(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.TablixHeader: persistable = new TablixHeader(); break; case ObjectType.TablixMember: persistable = new TablixMember(); break; case ObjectType.TablixColumn: persistable = new TablixColumn(); break; case ObjectType.TablixRow: persistable = new TablixRow(); break; case ObjectType.TablixCornerCell: persistable = new TablixCornerCell(); break; case ObjectType.TablixCell: persistable = new TablixCell(); break; case ObjectType.Chart: persistable = new Chart(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.ChartMember: persistable = new ChartMember(); break; case ObjectType.ChartSeries: persistable = new ChartSeries(); break; case ObjectType.ChartDataPoint: persistable = new ChartDataPoint(); break; case ObjectType.ChartDataPointValues: persistable = new ChartDataPointValues(); break; case ObjectType.ChartArea: persistable = new ChartArea(); break; case ObjectType.ChartLegend: persistable = new ChartLegend(); break; case ObjectType.ChartLegendTitle: persistable = new ChartLegendTitle(); break; case ObjectType.ChartAxis: persistable = new ChartAxis(); break; case ObjectType.ThreeDProperties: persistable = new ChartThreeDProperties(); break; case ObjectType.ChartDataLabel: persistable = new ChartDataLabel(); break; case ObjectType.ChartMarker: persistable = new ChartMarker(); break; case ObjectType.ChartTitle: persistable = new ChartTitle(); break; case ObjectType.ChartAxisScaleBreak: persistable = new ChartAxisScaleBreak(); break; case ObjectType.ChartDerivedSeries: persistable = new ChartDerivedSeries(); break; case ObjectType.ChartBorderSkin: persistable = new ChartBorderSkin(); break; case ObjectType.ChartNoDataMessage: persistable = new ChartNoDataMessage(); break; case ObjectType.ChartItemInLegend: persistable = new ChartItemInLegend(); break; case ObjectType.ChartEmptyPoints: persistable = new ChartEmptyPoints(); break; case ObjectType.ChartNoMoveDirections: persistable = new ChartNoMoveDirections(); break; case ObjectType.ChartFormulaParameter: persistable = new ChartFormulaParameter(); break; case ObjectType.ChartLegendColumn: persistable = new ChartLegendColumn(); break; case ObjectType.ChartLegendColumnHeader: persistable = new ChartLegendColumnHeader(); break; case ObjectType.ChartLegendCustomItem: persistable = new ChartLegendCustomItem(); break; case ObjectType.ChartLegendCustomItemCell: persistable = new ChartLegendCustomItemCell(); break; case ObjectType.ChartAlignType: persistable = new ChartAlignType(); break; case ObjectType.ChartElementPosition: persistable = new ChartElementPosition(); break; case ObjectType.ChartSmartLabel: persistable = new ChartSmartLabel(); break; case ObjectType.ChartStripLine: persistable = new ChartStripLine(); break; case ObjectType.ChartAxisTitle: persistable = new ChartAxisTitle(); break; case ObjectType.ChartCustomPaletteColor: persistable = new ChartCustomPaletteColor(); break; case ObjectType.GridLines: persistable = new ChartGridLines(); break; case ObjectType.ChartTickMarks: persistable = new ChartTickMarks(); break; case ObjectType.DataMember: persistable = new DataMember(); break; case ObjectType.CustomDataRow: persistable = new CustomDataRow(); break; case ObjectType.DataCell: persistable = new DataCell(); break; case ObjectType.Variable: persistable = new Variable(); break; case ObjectType.Page: persistable = new Page(); break; case ObjectType.Paragraph: persistable = new Paragraph(); break; case ObjectType.TextRun: persistable = new TextRun(); break; case ObjectType.Report: persistable = new Report(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.GaugePanel: persistable = new GaugePanel(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.GaugeMember: persistable = new GaugeMember(); break; case ObjectType.GaugeRow: persistable = new GaugeRow(); break; case ObjectType.GaugeCell: persistable = new GaugeCell(); break; case ObjectType.BackFrame: persistable = new BackFrame(); break; case ObjectType.CapImage: persistable = new CapImage(); break; case ObjectType.FrameBackground: persistable = new FrameBackground(); break; case ObjectType.FrameImage: persistable = new FrameImage(); break; case ObjectType.CustomLabel: persistable = new CustomLabel(); break; case ObjectType.GaugeImage: persistable = new GaugeImage(); break; case ObjectType.GaugeInputValue: persistable = new GaugeInputValue(); break; case ObjectType.GaugeLabel: persistable = new GaugeLabel(); break; case ObjectType.GaugePanelItem: persistable = new GaugePanelItem(); break; case ObjectType.GaugeTickMarks: persistable = new GaugeTickMarks(); break; case ObjectType.LinearGauge: persistable = new LinearGauge(); break; case ObjectType.LinearPointer: persistable = new LinearPointer(); break; case ObjectType.LinearScale: persistable = new LinearScale(); break; case ObjectType.NumericIndicator: persistable = new NumericIndicator(); break; case ObjectType.PinLabel: persistable = new PinLabel(); break; case ObjectType.PointerCap: persistable = new PointerCap(); break; case ObjectType.PointerImage: persistable = new PointerImage(); break; case ObjectType.RadialGauge: persistable = new RadialGauge(); break; case ObjectType.RadialPointer: persistable = new RadialPointer(); break; case ObjectType.RadialScale: persistable = new RadialScale(); break; case ObjectType.ScaleLabels: persistable = new ScaleLabels(); break; case ObjectType.ScalePin: persistable = new ScalePin(); break; case ObjectType.ScaleRange: persistable = new ScaleRange(); break; case ObjectType.IndicatorImage: persistable = new IndicatorImage(); break; case ObjectType.StateIndicator: persistable = new StateIndicator(); break; case ObjectType.Thermometer: persistable = new Thermometer(); break; case ObjectType.TickMarkStyle: persistable = new TickMarkStyle(); break; case ObjectType.TopImage: persistable = new TopImage(); break; case ObjectType.LookupInfo: persistable = new LookupInfo(); break; case ObjectType.LookupDestinationInfo: persistable = new LookupDestinationInfo(); break; case ObjectType.ReportSection: persistable = new ReportSection(); break; case ObjectType.MapFieldDefinition: persistable = new MapFieldDefinition(); break; case ObjectType.MapFieldName: persistable = new MapFieldName(); break; case ObjectType.MapLineLayer: persistable = new MapLineLayer(); break; case ObjectType.MapShapefile: persistable = new MapShapefile(); break; case ObjectType.MapPolygonLayer: persistable = new MapPolygonLayer(); break; case ObjectType.MapSpatialDataRegion: persistable = new MapSpatialDataRegion(); break; case ObjectType.MapSpatialDataSet: persistable = new MapSpatialDataSet(); break; case ObjectType.MapPointLayer: persistable = new MapPointLayer(); break; case ObjectType.MapTile: persistable = new MapTile(); break; case ObjectType.MapTileLayer: persistable = new MapTileLayer(); break; case ObjectType.MapField: persistable = new MapField(); break; case ObjectType.MapLine: persistable = new MapLine(); break; case ObjectType.MapPolygon: persistable = new MapPolygon(); break; case ObjectType.MapPoint: persistable = new MapPoint(); break; case ObjectType.MapLineTemplate: persistable = new MapLineTemplate(); break; case ObjectType.MapPolygonTemplate: persistable = new MapPolygonTemplate(); break; case ObjectType.MapMarkerTemplate: persistable = new MapMarkerTemplate(); break; case ObjectType.Map: persistable = new Map(m_parentReportItem); m_parentReportItem = (ReportItem)persistable; break; case ObjectType.MapBorderSkin: persistable = new MapBorderSkin(); break; case ObjectType.MapDataRegion: persistable = new MapDataRegion(m_parentReportItem); break; case ObjectType.MapMember: persistable = new MapMember(); break; case ObjectType.MapRow: persistable = new MapRow(); break; case ObjectType.MapCell: persistable = new MapCell(); break; case ObjectType.MapLocation: persistable = new MapLocation(); break; case ObjectType.MapSize: persistable = new MapSize(); break; case ObjectType.MapGridLines: persistable = new MapGridLines(); break; case ObjectType.MapBindingFieldPair: persistable = new MapBindingFieldPair(); break; case ObjectType.MapCustomView: persistable = new MapCustomView(); break; case ObjectType.MapDataBoundView: persistable = new MapDataBoundView(); break; case ObjectType.MapElementView: persistable = new MapElementView(); break; case ObjectType.MapViewport: persistable = new MapViewport(); break; case ObjectType.MapLimits: persistable = new MapLimits(); break; case ObjectType.MapColorScale: persistable = new MapColorScale(); break; case ObjectType.MapColorScaleTitle: persistable = new MapColorScaleTitle(); break; case ObjectType.MapDistanceScale: persistable = new MapDistanceScale(); break; case ObjectType.MapTitle: persistable = new MapTitle(); break; case ObjectType.MapLegend: persistable = new MapLegend(); break; case ObjectType.MapLegendTitle: persistable = new MapLegendTitle(); break; case ObjectType.MapBucket: persistable = new MapBucket(); break; case ObjectType.MapColorPaletteRule: persistable = new MapColorPaletteRule(); break; case ObjectType.MapColorRangeRule: persistable = new MapColorRangeRule(); break; case ObjectType.MapCustomColorRule: persistable = new MapCustomColorRule(); break; case ObjectType.MapCustomColor: persistable = new MapCustomColor(); break; case ObjectType.MapLineRules: persistable = new MapLineRules(); break; case ObjectType.MapPolygonRules: persistable = new MapPolygonRules(); break; case ObjectType.MapSizeRule: persistable = new MapSizeRule(); break; case ObjectType.MapMarkerImage: persistable = new MapMarkerImage(); break; case ObjectType.MapMarker: persistable = new MapMarker(); break; case ObjectType.MapMarkerRule: persistable = new MapMarkerRule(); break; case ObjectType.MapPointRules: persistable = new MapPointRules(); break; case ObjectType.PageBreak: persistable = new PageBreak(); break; case ObjectType.DataScopeInfo: persistable = new DataScopeInfo(); break; case ObjectType.LinearJoinInfo: persistable = new LinearJoinInfo(); break; case ObjectType.IntersectJoinInfo: persistable = new IntersectJoinInfo(); break; case ObjectType.BucketedDataAggregateInfos: persistable = new BucketedDataAggregateInfos(); break; case ObjectType.DataAggregateInfoBucket: persistable = new DataAggregateInfoBucket(); break; case ObjectType.NumericIndicatorRange: persistable = new NumericIndicatorRange(); break; case ObjectType.IndicatorState: persistable = new IndicatorState(); break; case ObjectType.SharedDataSetQuery: persistable = new SharedDataSetQuery(); break; case ObjectType.DataSetCore: persistable = new DataSetCore(); break; case ObjectType.DataSetParameterValue: persistable = new DataSetParameterValue(); break; case ObjectType.RIFVariantContainer: persistable = new RIFVariantContainer(); break; case ObjectType.IdcRelationship: persistable = new IdcRelationship(); break; case ObjectType.DefaultRelationship: persistable = new DefaultRelationship(); break; case ObjectType.JoinCondition: persistable = new Relationship.JoinCondition(); break; case ObjectType.BandLayoutOptions: persistable = new BandLayoutOptions(); break; case ObjectType.LabelData: persistable = new LabelData(); break; case ObjectType.Slider: persistable = new Slider(); break; case ObjectType.Coverflow: persistable = new Coverflow(); break; case ObjectType.PlayAxis: persistable = new PlayAxis(); break; case ObjectType.BandNavigationCell: persistable = new BandNavigationCell(); break; case ObjectType.Tabstrip: persistable = new Tabstrip(); break; case ObjectType.NavigationItem: persistable = new NavigationItem(); break; case ObjectType.ScopedFieldInfo: persistable = new ScopedFieldInfo(); break; default: Global.Tracer.Assert(condition: false, "Unsupported object type: " + objectType); break; } IDOwner iDOwner = persistable as IDOwner; if (iDOwner != null) { iDOwner.ParentInstancePath = m_parentIDOwner; m_parentIDOwner = iDOwner; } persistable.Deserialize(context); m_parentIDOwner = parentIDOwner; m_parentReportItem = parentReportItem; return(persistable); }
private void Init() { Grid coverGrid = new Grid { RowSpacing = 0 }; MainGrid.Children.Add(coverGrid, 0, 0); // 메인 그리드 추가 #region 주문번호 CustomLabel order_numLabel = new CustomLabel { Text = "주문 번호 : " + purchaseList.SH_PURCHACE_INDEX.ToString(), Size = 18, TextColor = Color.Black, Margin = new Thickness(15, 0, 0, 0), VerticalOptions = LayoutOptions.CenterAndExpand, }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 40 }); coverGrid.Children.Add(order_numLabel, 0, 0); #endregion BoxView borderLine1 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine1, 0, 1); #region 상품 이름 Grid nameGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView nameLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout nameCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel nameLabel = new CustomLabel { Text = "상품 이름", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_nameLabel = new CustomLabel { Text = proList[0].SH_PUR_PRODUCT_NAME + " 외 " + proList.Count + "개", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; nameGrid.Children.Add(nameLine, 0, 0); nameGrid.Children.Add(nameCover, 0, 0); nameCover.Children.Add(nameLabel); nameGrid.Children.Add(input_nameLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(nameGrid, 0, 2); BoxView borderLine2 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine2, 0, 3); #endregion #region 배송비 선불/착불 Grid delivery_priceGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView delivery_priceLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout delivery_priceCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel delivery_priceLabel = new CustomLabel { Text = "배송비", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_delivery_priceLabel = new CustomLabel { Text = pdList[0].SH_PUR_DELIVERY_PAY.ToString("N0") + "원 / " + pdList[0].SH_PUR_DELIVERY_OPTION, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; delivery_priceGrid.Children.Add(delivery_priceLine, 0, 0); delivery_priceGrid.Children.Add(delivery_priceCover, 0, 0); delivery_priceCover.Children.Add(delivery_priceLabel); delivery_priceGrid.Children.Add(input_delivery_priceLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(delivery_priceGrid, 0, 4); BoxView borderLine3 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine3, 0, 5); #endregion #region 배송지 Grid delivery_adressGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView delivery_adressLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout delivery_adressCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel delivery_adressLabel = new CustomLabel { Text = "배송지", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_delivery_adressLabel = new CustomLabel { Text = pdList[0].SH_PUR_DELIVERY_ADRESS, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; delivery_adressGrid.Children.Add(delivery_adressLine, 0, 0); delivery_adressGrid.Children.Add(delivery_adressCover, 0, 0); delivery_adressCover.Children.Add(delivery_adressLabel); delivery_adressGrid.Children.Add(input_delivery_adressLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(delivery_adressGrid, 0, 6); BoxView borderLine4 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine4, 0, 7); #endregion #region 배송 연락번호 Grid delivery_phoneGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView delivery_phoneLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout delivery_phoneCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel delivery_phoneLabel = new CustomLabel { Text = "연락처", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_delivery_phoneLabel = new CustomLabel { Text = pdList[0].SH_PUR_DELIVERY_PHONE, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; delivery_phoneGrid.Children.Add(delivery_phoneLine, 0, 0); delivery_phoneGrid.Children.Add(delivery_phoneCover, 0, 0); delivery_phoneCover.Children.Add(delivery_phoneLabel); delivery_phoneGrid.Children.Add(input_delivery_phoneLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(delivery_phoneGrid, 0, 8); BoxView borderLine5 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine5, 0, 9); #endregion #region 배송 요청사항 Grid delivery_detailGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView delivery_detailLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout delivery_detailCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel delivery_detaileLabel = new CustomLabel { Text = "배송요청사항", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_delivery_detailLabel = new CustomLabel { Text = pdList[0].SH_PUR_DELIVERY_DETAIL, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; delivery_detailGrid.Children.Add(delivery_detailLine, 0, 0); delivery_detailGrid.Children.Add(delivery_detailCover, 0, 0); delivery_detailCover.Children.Add(delivery_detaileLabel); delivery_detailGrid.Children.Add(input_delivery_detailLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(delivery_detailGrid, 0, 10); BoxView borderLine6 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine6, 0, 11); #endregion #region 결제방식 string testOption = ""; if (purchaseList.SH_PAY_METHOD == "card") { testOption = "신용카드"; } Grid pay_optionGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_optionLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_optionCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_optionLabel = new CustomLabel { Text = "결제방식", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_pay_optionLabel = new CustomLabel { Text = testOption, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; pay_optionGrid.Children.Add(pay_optionLine, 0, 0); pay_optionGrid.Children.Add(pay_optionCover, 0, 0); pay_optionCover.Children.Add(pay_optionLabel); pay_optionGrid.Children.Add(input_pay_optionLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_optionGrid, 0, 12); BoxView borderLine7 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine7, 0, 13); #endregion #region 결제방식에 따른 레이블(카드, 은행, 핸드폰 등) Grid pay_bank_phone_Grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_bank_phone_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_bank_phone_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_bank_phone_Label = new CustomLabel { Text = "", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_bank_phone_Label = new CustomLabel { Text = "", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; pay_bank_phone_Grid.Children.Add(pay_bank_phone_Line, 0, 0); pay_bank_phone_Grid.Children.Add(pay_bank_phone_Cover, 0, 0); pay_bank_phone_Cover.Children.Add(pay_bank_phone_Label); pay_bank_phone_Grid.Children.Add(input_bank_phone_Label, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_bank_phone_Grid, 0, 14); BoxView borderLine8 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine8, 0, 15); #endregion int payoption_row = 16; if (purchaseList.SH_PAY_METHOD == "card") { pay_bank_phone_Label.Text = "결제번호"; input_bank_phone_Label.Text = purchaseList.SH_IMP_UID; } //List<SH_Pay_Card> card = SH_DB.PostSearchPayCardToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString()); //input_bank_phone_Label.Text = card[0].SH_PAY_CARD_KINDS; //} //else if (ppList[0].SH_PUR_PAY_OPTION == "Business") //{ // pay_bank_phone_Label.Text = "결제은행"; // List<SH_Pay_Business> business = SH_DB.PostSearchPayBusinessToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString()); // input_bank_phone_Label.Text = business[0].SH_PAY_BUSINESS_BANK; // #region 사업자 등록번호 // Grid pay_num_Grid = new Grid // { // ColumnDefinitions = // { // new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, // new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, // }, // RowSpacing = 0, // }; // BoxView pay_num_Line = new BoxView { BackgroundColor = Color.LightGray }; // StackLayout pay_num_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; // CustomLabel pay_num_Label = new CustomLabel // { // Text = "사업자등록번호", // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // HorizontalOptions = LayoutOptions.CenterAndExpand, // }; // CustomLabel input_num_Label = new CustomLabel // { // Text = business[0].SH_PAY_BUSINESS_NUM, // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // }; // pay_num_Grid.Children.Add(pay_num_Line, 0, 0); // pay_num_Grid.Children.Add(pay_num_Cover, 0, 0); // pay_num_Cover.Children.Add(pay_num_Label); // pay_num_Grid.Children.Add(input_num_Label, 1, 0); // coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // coverGrid.Children.Add(pay_num_Grid, 0, payoption_row++); // 17 // BoxView borderLine9 = new BoxView { BackgroundColor = Color.LightGray }; // coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); // coverGrid.Children.Add(borderLine9, 0, payoption_row++); // 18 // #endregion // #region 사업자 등록이름 // Grid pay_name_Grid = new Grid // { // ColumnDefinitions = // { // new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, // new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, // }, // RowSpacing = 0, // }; // BoxView pay_name_Line = new BoxView { BackgroundColor = Color.LightGray }; // StackLayout pay_name_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; // CustomLabel pay_name_Label = new CustomLabel // { // Text = "사업자이름", // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // HorizontalOptions = LayoutOptions.CenterAndExpand, // }; // CustomLabel input_name_Label = new CustomLabel // { // Text = business[0].SH_PAY_BUSINESS_NAME, // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // }; // pay_name_Grid.Children.Add(pay_name_Line, 0, 0); // pay_name_Grid.Children.Add(pay_name_Cover, 0, 0); // pay_name_Cover.Children.Add(pay_name_Label); // pay_name_Grid.Children.Add(input_name_Label, 1, 0); // coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // coverGrid.Children.Add(pay_name_Grid, 0, payoption_row++); // 19 // BoxView borderLine10 = new BoxView { BackgroundColor = Color.LightGray }; // coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); // coverGrid.Children.Add(borderLine10, 0, payoption_row++); // 20 // #endregion //} //else if (ppList[0].SH_PUR_PAY_OPTION == "Personal") //{ // pay_bank_phone_Label.Text = "결제은행"; // List<SH_Pay_Personal> personal = SH_DB.PostSearchPayPersonalToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString()); // input_bank_phone_Label.Text = personal[0].SH_PAY_PERSONAL_BANK; // #region 개인 현금영수증 번호 // Grid pay_num_Grid = new Grid // { // ColumnDefinitions = // { // new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, // new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, // }, // RowSpacing = 0, // }; // BoxView pay_num_Line = new BoxView { BackgroundColor = Color.LightGray }; // StackLayout pay_num_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; // CustomLabel pay_num_Label = new CustomLabel // { // Text = "현금영수증번호", // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // HorizontalOptions = LayoutOptions.CenterAndExpand, // }; // CustomLabel input_num_Label = new CustomLabel // { // Text = personal[0].SH_PAY_PERSONAL_NUM, // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // }; // pay_num_Grid.Children.Add(pay_num_Line, 0, 0); // pay_num_Grid.Children.Add(pay_num_Cover, 0, 0); // pay_num_Cover.Children.Add(pay_num_Label); // pay_num_Grid.Children.Add(input_num_Label, 1, 0); // coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // coverGrid.Children.Add(pay_num_Grid, 0, payoption_row++); // 17 // BoxView borderLine9 = new BoxView { BackgroundColor = Color.LightGray }; // coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); // coverGrid.Children.Add(borderLine9, 0, payoption_row++); // 18 // #endregion // #region 개인 이름 // Grid pay_name_Grid = new Grid // { // ColumnDefinitions = // { // new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) }, // new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) }, // }, // RowSpacing = 0, // }; // BoxView pay_name_Line = new BoxView { BackgroundColor = Color.LightGray }; // StackLayout pay_name_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; // CustomLabel pay_name_Label = new CustomLabel // { // Text = "이름", // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // HorizontalOptions = LayoutOptions.CenterAndExpand, // }; // CustomLabel input_name_Label = new CustomLabel // { // Text = personal[0].SH_PAY_PERSONAL_NAME, // Size = 14, // TextColor = Color.DarkGray, // VerticalOptions = LayoutOptions.CenterAndExpand, // }; // pay_name_Grid.Children.Add(pay_name_Line, 0, 0); // pay_name_Grid.Children.Add(pay_name_Cover, 0, 0); // pay_name_Cover.Children.Add(pay_name_Label); // pay_name_Grid.Children.Add(input_name_Label, 1, 0); // coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // coverGrid.Children.Add(pay_name_Grid, 0, payoption_row++); // 19 // BoxView borderLine10 = new BoxView { BackgroundColor = Color.LightGray }; // coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); // coverGrid.Children.Add(borderLine10, 0, payoption_row++); // 20 // #endregion //} //else if (ppList[0].SH_PUR_PAY_OPTION == "Phone") //{ // pay_bank_phone_Label.Text = "통신사"; // List<SH_Pay_Phone> phone = SH_DB.PostSearchPayPhoneToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString()); // input_bank_phone_Label.Text = phone[0].SH_PAY_PHONE_KINDS; //} #region 결제금액 Grid pay_priceGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_priceLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_priceCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_priceLabel = new CustomLabel { Text = "결제금액", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_pay_priceLabel = new CustomLabel { Text = purchaseList.SH_AMOUNT.ToString("N0"), Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; pay_priceGrid.Children.Add(pay_priceLine, 0, 0); pay_priceGrid.Children.Add(pay_priceCover, 0, 0); pay_priceCover.Children.Add(pay_priceLabel); pay_priceGrid.Children.Add(input_pay_priceLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_priceGrid, 0, payoption_row++); BoxView borderLine11 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine11, 0, payoption_row++); #endregion #region 사용된 포인트 Grid pay_pointGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_pointLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_pointCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_pointLabel = new CustomLabel { Text = "사용포인트", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_pay_pointLabel = new CustomLabel { Text = purchaseList.SH_USE_POINT.ToString() + " point", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; pay_pointGrid.Children.Add(pay_pointLine, 0, 0); pay_pointGrid.Children.Add(pay_pointCover, 0, 0); pay_pointCover.Children.Add(pay_pointLabel); pay_pointGrid.Children.Add(input_pay_pointLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_pointGrid, 0, payoption_row++); BoxView borderLine12 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine12, 0, payoption_row++); #endregion #region 결제상태 Grid pay_stateGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, RowSpacing = 0, }; BoxView pay_stateLine = new BoxView { BackgroundColor = Color.LightGray }; StackLayout pay_stateCover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel pay_stateLabel = new CustomLabel { Text = "결제상태", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_pay_stateLabel = new CustomLabel { Text = purchaseList.SH_STATUS, Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; pay_stateGrid.Children.Add(pay_stateLine, 0, 0); pay_stateGrid.Children.Add(pay_stateCover, 0, 0); pay_stateCover.Children.Add(pay_stateLabel); pay_stateGrid.Children.Add(input_pay_stateLabel, 1, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(pay_stateGrid, 0, payoption_row++); BoxView borderLine13 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine13, 0, payoption_row++); #endregion #region 운송장번호 Grid deliveryNumberGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = 100 }, }, RowSpacing = 0, }; BoxView deliveryNumber_Line = new BoxView { BackgroundColor = Color.LightGray }; StackLayout deliveryNumber_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 }; CustomLabel deliveryNumber_Label = new CustomLabel { Text = "운송장번호", Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; CustomLabel input_deliveryNumber_Label = new CustomLabel { Text = "123", // default Size = 14, TextColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, }; CustomButton deliveryLookup_Button = new CustomButton { Text = "배송조회", Size = 14, TextColor = Color.White, BackgroundColor = Color.DarkGray, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, }; deliveryLookup_Button.Clicked += (sender, args) => { if (input_deliveryNumber_Label.Text == "") // 운송장 번호가 없을경우 { DisplayAlert("알림", "송장번호가 존재하지 않습니다!", "확인"); return; } else { Navigation.PushAsync(new DeliveryLookup(input_deliveryNumber_Label.Text)); } }; deliveryNumberGrid.Children.Add(deliveryNumber_Line, 0, 0); deliveryNumberGrid.Children.Add(deliveryNumber_Cover, 0, 0); deliveryNumber_Cover.Children.Add(deliveryNumber_Label); deliveryNumberGrid.Children.Add(input_deliveryNumber_Label, 1, 0); deliveryNumberGrid.Children.Add(deliveryLookup_Button, 2, 0); coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); coverGrid.Children.Add(deliveryNumberGrid, 0, payoption_row++); BoxView borderLine14 = new BoxView { BackgroundColor = Color.LightGray }; coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 }); coverGrid.Children.Add(borderLine14, 0, payoption_row++); #endregion }
public static void SetSimplePlanStrips(List <Plan> plans, Chart Chart, DateTime StartDate, ControllerEventLogs EventLog) { var backGroundColor = 1; foreach (var plan in plans) { var stripline = new StripLine(); //Creates alternating backcolor to distinguish the plans if (backGroundColor % 2 == 0) { stripline.BackColor = Color.FromArgb(120, Color.LightGray); } else { stripline.BackColor = Color.FromArgb(120, Color.LightBlue); } //Set the stripline properties stripline.IntervalOffsetType = DateTimeIntervalType.Hours; stripline.Interval = 1; stripline.IntervalOffset = (plan.StartTime - StartDate).TotalHours; stripline.StripWidth = (plan.EndTime - plan.StartTime).TotalHours; stripline.StripWidthType = DateTimeIntervalType.Hours; Chart.ChartAreas["ChartArea1"].AxisX.StripLines.Add(stripline); //Add a corrisponding custom label for each strip var Plannumberlabel = new CustomLabel(); Plannumberlabel.FromPosition = plan.StartTime.ToOADate(); Plannumberlabel.ToPosition = plan.EndTime.ToOADate(); switch (plan.PlanNumber) { case 254: Plannumberlabel.Text = "Free"; break; case 255: Plannumberlabel.Text = "Flash"; break; case 0: Plannumberlabel.Text = "Unknown"; break; default: Plannumberlabel.Text = "Plan " + plan.PlanNumber; break; } Plannumberlabel.LabelMark = LabelMarkStyle.LineSideMark; Plannumberlabel.ForeColor = Color.Black; Plannumberlabel.RowIndex = 0; var planPreemptsLabel = new CustomLabel(); planPreemptsLabel.FromPosition = plan.StartTime.ToOADate(); planPreemptsLabel.ToPosition = plan.EndTime.ToOADate(); var c = from Controller_Event_Log r in EventLog.Events where r.EventCode == 107 && r.Timestamp > plan.StartTime && r.Timestamp < plan.EndTime select r; var premptCount = c.Count().ToString(); planPreemptsLabel.Text = "Preempts Serviced During Plan: " + premptCount; planPreemptsLabel.LabelMark = LabelMarkStyle.LineSideMark; planPreemptsLabel.ForeColor = Color.Red; planPreemptsLabel.RowIndex = 1; backGroundColor++; } }
private void ConfigureScreen() { var navBar = BaseContentPage.Instance.ConfigureNavBar("Escanear Código"); CustomLabel label = new CustomLabel() { Margin = new Thickness(70, 20), Text = "Na embalagem recebida encontra-se o código qr".ToUpper(), FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.CenterAndExpand, FontSize = 15, TextColor = Color.Black }; var scanner = new ZXingScannerView { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Margin = new Thickness(0, 0, 0, 60), }; scanner.OnScanResult += OnScanResult; scanner.IsScanning = true; StackLayout footer = new StackLayout() { BackgroundColor = ColorPalette.LightBlue, Orientation = StackOrientation.Horizontal, HeightRequest = 60, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.End, Children = { new Button() { TextColor = ColorPalette.Pink, Text = "Cancelar".ToLower(), HorizontalOptions = LayoutOptions.EndAndExpand, HeightRequest = 60, BackgroundColor = Color.Transparent, Command = new Command(() => { BaseContentPage.Instance.PopView(); scanner.OnScanResult -= OnScanResult; scanner.IsScanning = false; }) } }, }; Grid wrapperGrid = new Grid() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; wrapperGrid.RowDefinitions.Add(new RowDefinition()); wrapperGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); wrapperGrid.Children.Add(scanner, 0, 0); wrapperGrid.Children.Add(footer, 0, 0); Children.Add(navBar); Children.Add(label); Children.Add(wrapperGrid); }
public void DrawLine(object oChart, plotData temp, string seriName, LineType lineType) { Chart chart = (Chart)oChart; if (chart.InvokeRequired) { SetDrawLineCallBack d = DrawLine; chart.Invoke(d, new object[] { chart, temp, seriName, lineType }); } else { //绑定数据 int index = chart.Series.Count; chart.Series.Add(seriName); Series currentSeries = chart.Series[index]; //chart.Titles[index].Alignment = System.Drawing.ContentAlignment.TopRight; currentSeries.XValueType = ChartValueType.Single; //设置X轴上的值类型 //currentSeries.Label = "#VAL"; //设置显示X Y的值 //currentSeries.LabelForeColor = Color.Black; currentSeries.ToolTip = "#VALX:#VAL"; //鼠标移动到对应点显示数值 currentSeries.ChartType = SeriesChartType.FastLine; //图类型(折线) //currentSeries.ChartType = SeriesChartType.Line; //图类型(折线) currentSeries.IsValueShownAsLabel = false; currentSeries.LegendText = seriName; currentSeries.IsVisibleInLegend = true; //chart.Legends[seriName].Enabled = true; //chart.Legends[seriName].MaximumAutoSize = 15; //chart.Series[0].IsValueShownAsLabel = true; // currentSeries.LabelForeColor = Color.Black; // currentSeries.CustomProperties = "DrawingStyle = Cylinder"; currentSeries.Points.DataBindXY(temp.xData, temp.yData); switch (lineType) { case LineType.Fre: for (int i = 1; i < 10; i++) { CustomLabel label = new CustomLabel(); label.Text = (i * 5).ToString() + "Ghz"; label.ToPosition = i * 10000000000; chart.ChartAreas[0].AxisX.CustomLabels.Add(label); label.GridTicks = GridTickTypes.Gridline; } break; case LineType.Time: for (int i = 1; i < 10; i++) { CustomLabel label = new CustomLabel(); label.Text = (i * 1).ToString() + "ns"; label.ToPosition = (float)i * 2; chart.ChartAreas[0].AxisX.CustomLabels.Add(label); label.GridTicks = GridTickTypes.Gridline; } break; } //chart.Visible = true; } }
private void PurchaseListInit() // 구매할 목록 초기화 { #region 네트워크 상태 확인 var current_network = Connectivity.NetworkAccess; // 현재 네트워크 상태 if (current_network != NetworkAccess.Internet) // 네트워크 연결 불가 { return; } #endregion #region 네트워크 연결 가능 else { if (basketList == null) { return; } int row = 0; for (int i = 0; i < basketList.Count; i++) { PurchaseListGrid.RowDefinitions.Add(new RowDefinition { Height = 100 }); PurchaseListGrid.RowDefinitions.Add(new RowDefinition { Height = 3 }); Grid inGrid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 100 }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = 30 } }, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.FillAndExpand, Margin = new Thickness(20, 0, 20, 0), RowSpacing = 0, ColumnSpacing = 0, }; #region 장바구니 상품 이미지 CachedImage product_image = new CachedImage { LoadingPlaceholder = Global.LoadingImagePath, ErrorPlaceholder = Global.NotFoundImagePath, Source = basketList[i].SH_BASKET_IMAGE, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, Aspect = Aspect.AspectFill, }; #endregion #region 상품 설명 Labellist 그리드 Grid product_label_grid = new Grid { Margin = new Thickness(10, 0, 0, 0), VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, RowSpacing = 0, ColumnSpacing = 0, RowDefinitions = { new RowDefinition { Height = GridLength.Auto }, new RowDefinition { Height = GridLength.Auto }, new RowDefinition { Height = 10 }, new RowDefinition { Height = GridLength.Auto } }, }; #region 상품 제목 Label CustomLabel pro_label = new CustomLabel { Text = basketList[i].SH_BASKET_NAME, Size = 18, TextColor = Color.Black, }; #endregion #region 상품 종류 Label (사이즈, 색상, 추가옵션) CustomLabel type_label = new CustomLabel { Text = "색상 : " + basketList[i].SH_BASKET_COLOR + ", 사이즈 : " + basketList[i].SH_BASKET_SIZE + ", " + basketList[i].SH_BASKET_COUNT + "개", Size = 14, TextColor = Color.DarkGray, }; #endregion #region 가격 내용 Label 및 장바구니 담은 날짜 CustomLabel price_label = new CustomLabel { Text = basketList[i].SH_BASKET_PRICE.ToString("N0") + "원", Size = 14, TextColor = Color.Gray, }; #endregion //상품 설명 라벨 그리드에 추가 product_label_grid.Children.Add(pro_label, 0, 0); product_label_grid.Children.Add(type_label, 0, 1); product_label_grid.Children.Add(price_label, 0, 3); #endregion #region 상품권 그리드 자식 추가 inGrid.Children.Add(product_image, 0, 0); inGrid.Children.Add(product_label_grid, 1, 0); #endregion //장바구니 리스트 그리드에 추가 PurchaseListGrid.Children.Add(inGrid, 0, row); row++; #region 구분선 BoxView gridline = new BoxView { BackgroundColor = Color.FromHex("#f4f2f2"), VerticalOptions = LayoutOptions.End, HorizontalOptions = LayoutOptions.FillAndExpand }; //구분선 그리드에 추가 PurchaseListGrid.Children.Add(gridline, 0, row); row++; #endregion } #endregion } }
private void LoadData() { CustomLabel feeName = new CustomLabel(); CustomLabel feeValue = new CustomLabel(); if (currIndex >= 0) { customButtonSubmit.Text = (currIndex + 1 != totalLoansToWaive && totalLoansToWaive > 1) ? "Continue" : "Submit"; pawnLoan = pawnloansToView[currIndex]; customLabelPageNo.Text = (currIndex + 1).ToString() + " of " + totalLoansToWaive.ToString(); labelLoanNumber.Text = pawnLoan.TicketNumber.ToString(); customLabelLoanAmtValue.Text = string.Format("{0:C}", pawnLoan.Amount); currentStoreSiteId = new SiteId() { Alias = GlobalDataAccessor.Instance.CurrentSiteId.Alias, Company = GlobalDataAccessor.Instance.CurrentSiteId.Company, Date = ShopDateTime.Instance.ShopDate, LoanAmount = 0, State = GlobalDataAccessor.Instance.CurrentSiteId.State, StoreNumber = GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, TerminalId = GlobalDataAccessor.Instance.CurrentSiteId.TerminalId }; try { int currentRow = tableLayoutPanelFeeAmount.RowCount; int currentAddlFeesRow = tableLayoutPanelAddlFees.RowCount; decimal totalFees = 0.0M; foreach (Fee fee in pawnLoan.OriginalFees) { if (fee.FeeType == FeeTypes.INTEREST) { customLabelInterestValue.Text = string.Format("{0:0.00}", fee.Value); continue; } if (fee.FeeType == FeeTypes.SERVICE) { if (fee.Value > 0) { customLabelSrvChargeValue.Text = string.Format("{0:0.00}", fee.Value); customLabelServiceChargeHeading.Visible = true; customLabelSrvChargeValue.Visible = true; } else { customLabelServiceChargeHeading.Visible = false; customLabelSrvChargeValue.Visible = false; } continue; } string feeTypeName = Commons.GetFeeName(fee.FeeType); feeName = new CustomLabel(); feeValue = new CustomLabel(); feeName.Text = feeTypeName + ":"; feeValue.Text = string.Format("{0:0.00}", fee.Value); feeName.Anchor = AnchorStyles.Right; feeValue.Anchor = AnchorStyles.Left; if (fee.CanBeProrated || fee.CanBeWaived) { tableLayoutPanelAddlFees.Controls.Add(feeName, 0, currentAddlFeesRow); tableLayoutPanelAddlFees.Controls.Add(feeValue, 1, currentAddlFeesRow); tableLayoutPanelAddlFeeHeading.Visible = true; panelAdditionalFeesHeading.Visible = true; tableLayoutPanelAddlFees.Visible = true; if (fee.CanBeWaived && !fee.CanBeProrated) { CheckBox waiveFeeChkBox = new CheckBox(); waiveFeeChkBox.Name = fee.FeeType.ToString(); waiveFeeChkBox.Anchor = AnchorStyles.Left; waiveFeeChkBox.CheckedChanged += new EventHandler(waiveFeeChkBox_CheckedChanged); tableLayoutPanelAddlFees.Controls.Add(waiveFeeChkBox, 2, currentAddlFeesRow); } else if (fee.CanBeProrated && fee.CanBeWaived) { CustomLabel prorateHeading = new CustomLabel(); prorateHeading.Text = "Prorate"; tableLayoutPanelAddlFeeHeading.Controls.Add(prorateHeading, 2, 0); CustomLabel orHeading = new CustomLabel(); orHeading.Text = " or "; tableLayoutPanelAddlFeeHeading.Controls.Add(prorateHeading, 3, 0); RadioButton prorateFeeRadButton = new RadioButton(); prorateFeeRadButton.Name = fee.FeeType.ToString(); prorateFeeRadButton.CheckedChanged += new EventHandler(prorateFeeRadButton_CheckedChanged); tableLayoutPanelAddlFees.Controls.Add(prorateFeeRadButton, 2, currentAddlFeesRow); RadioButton waiveFeeRadButton = new RadioButton(); waiveFeeRadButton.Name = fee.FeeType.ToString(); waiveFeeRadButton.CheckedChanged += new EventHandler(waiveFeeRadButton_CheckedChanged); tableLayoutPanelAddlFees.Controls.Add(waiveFeeRadButton, 3, currentAddlFeesRow); } currentAddlFeesRow++; } else { panelAdditionalFeesHeading.Visible = false; tableLayoutPanelFeeAmount.Controls.Add(feeName, 0, currentRow); tableLayoutPanelFeeAmount.Controls.Add(feeValue, 1, currentRow); currentRow++; } totalFees = totalFees + fee.Value; } decimal totalPickupAmt = pawnLoan.Amount + pawnLoan.InterestAmount + pawnLoan.ServiceCharge + totalFees; pawnLoan.PickupAmount = totalPickupAmt; customLabelTotalPickupAmt.Text = string.Format("{0:C}", totalPickupAmt); } catch (Exception ex) { BasicExceptionHandler.Instance.AddException( "Error in getting Fee information - storeloans.getcurrentloanfees", new ApplicationException(ex.Message)); } } }
private Chart SetupChart(string chartId) { //The Chart definition and look and feel var chart = new Chart { ID = chartId, Width = Unit.Pixel(Width), Height = Unit.Pixel(Height) }; chart.Attributes.Add("aria-hidden", "true"); if (String.IsNullOrEmpty(AxisXTitle)) chartAreaHeight = 70; var position = new ElementPosition(horizontalOffset, verticalOffset, chartAreaWidth, chartAreaHeight); //The ChartArea definition and look and feel var chartArea = CreateChartArea(position); if (!String.IsNullOrEmpty(AxisYTitle)) { chartArea.AxisY.Title = AxisYTitle; chartArea.AxisY.TitleFont = (Font)axisTitleFont.Clone(); } if (AxisYCustomLabels != null && AxisYCustomLabels.Count > 0) { foreach (var axisYCustomLabel in AxisYCustomLabels) { var customLabel = new CustomLabel { FromPosition = axisYCustomLabel.FromPosition, ToPosition = axisYCustomLabel.ToPosition, Text = axisYCustomLabel.Text }; if (axisYCustomLabel.DisplayGridTick) customLabel.GridTicks = GridTickTypes.TickMark; chartArea.AxisY.CustomLabels.Add(customLabel); } } if (!String.IsNullOrEmpty(AxisXTitle)) { chartArea.AxisX.Title = AxisXTitle; chartArea.AxisX.TitleFont = (Font)axisTitleFont.Clone(); } //Adding the ChartArea to the Chart. chart.ChartAreas.Add(chartArea); if (DisplayLegend) { var displayLegend = new Legend(displayLegendName) { Alignment = StringAlignment.Center, Font = (Font)defaultFont.Clone() }; chart.Legends.Add(displayLegend); var hideLegend = new Legend(hideLegendName) { Enabled = false }; chart.Legends.Add(hideLegend); } return chart; }
private void DisplayPackingResults() { // 依照 problem 整理過的順序展示 chtPackingResults.ChartAreas[0].AxisX.CustomLabels.Clear(); blockSeries.Points.Clear(); for (int i = 0; i < theProblem.Vehicles.Length; i++) { CustomLabel cl = new CustomLabel(); foreach (VehiclePackingInfo vpi in theProblem.VehicleInfos) { if (vpi.theVehicle == theProblem.Vehicles[i]) { cl.Tag = vpi; break; } } cl.Text = theProblem.Vehicles[i].licensePlate; cl.FromPosition = i - 0.5; cl.ToPosition = i + 0.5; cl.RowIndex = 0; chtPackingResults.ChartAreas[0].AxisX.CustomLabels.Add(cl); cumulatedValues[i] = 0.0f; DataPoint dp = new DataPoint(); dp.Color = Color.FromArgb(0, 255, 255, 255); dp.BorderColor = Color.Black; dp.BorderWidth = 1; dp.XValue = i; dp.YValues = new double[] { 0, theProblem.Vehicles[i].weightLimit * 1000 }; blockSeries.Points.Add(dp); } OrdersRow[][] orderSets = { theProblem.Orders, theProblem.SplitNewOrders.ToArray <OrdersRow>() }; for (int i = 0; i < orderSets.Length; i++) { foreach (OrdersRow or in orderSets[i]) { int vid = -1, aid = -1; try { vid = theProblem.VehicleIndexes[or.planVehicleId]; aid = GroupIdForIds[or.areaId]; } catch { // 沒有排入,此時 DBNull continue; } DataPoint dp = new DataPoint(); dp.Color = ColorForIds[or.areaId]; dp.BorderColor = MainForm.BorderColors[aid]; dp.Label = or.netWeight.ToString(); dp.Tag = or; dp.BorderWidth = 3; dp.XValue = vid; dp.YValues = new double[] { cumulatedValues[vid], cumulatedValues[vid] + or.netWeight }; cumulatedValues[vid] = dp.YValues[1]; blockSeries.Points.Add(dp); } } if (targetLeft) { labResultsLeft.ForeColor = Color.Maroon; labResultsLeft.Text = MethodString + theProblem.BestSolutionString; labResultsRight.ForeColor = Color.Gray; } else { labResultsRight.ForeColor = Color.Maroon; labResultsRight.Text = MethodString + theProblem.BestSolutionString; labResultsLeft.ForeColor = Color.Gray; } targetLeft = !targetLeft; foreach (DataGridViewRow dgvr in dgvOrders.Rows) { if (dgvr.DefaultCellStyle != dgvOrders.DefaultCellStyle) { dgvr.DefaultCellStyle = dgvOrders.DefaultCellStyle; } bool discarded = false; // 先看是否是捨棄 foreach (OrdersRow or in theProblem.NonLoadedOrders) { if ((int)dgvr.Cells[0].Value == or.Id) { dgvr.DefaultCellStyle = discardStyle; discarded = true; break; } } // 再看是否拆單 foreach (OrdersRow or in theProblem.SplitNewOrders) { if ((int)dgvr.Cells[0].Value == or.Id) { if (discarded) { dgvr.DefaultCellStyle = splitAndDiscardStyle; } else { dgvr.DefaultCellStyle = splitStyle; } break; } } } dgvOrders.ClearSelection(); }
/// <summary> /// /// </summary> /// <param name="areaID">areaID</param> /// <param name="param2">dropped x, y, width, height </param> /// <returns></returns> public string Nudging(string areaID, string param2) { string RetVal = string.Empty; string MapFileWPath = string.Empty; Map diMap = null; string[] paramValues; RectangleF placeHolder = new RectangleF(); string LayerId = string.Empty; string AreaId = string.Empty; string caption = string.Empty; Layer layer = null; CustomLabel CustLabel = null; Shape shape = null; string Coordinates = string.Empty; float NewX = 0, NewY = 0, Width = 0, Height = 0; PointF StartPoint, StartPointMapCoordinate; try { //step To load map from session/ NewMap/ From preserved file diMap = this.GetSessionMapObject(); paramValues = Global.SplitString(param2, Constants.Delimiters.ParamDelimiter); NewX = float.Parse(paramValues[0]); NewY = float.Parse(paramValues[1]); Width = float.Parse(paramValues[2]); Height = float.Parse(paramValues[3]); RectangleF CurExt = diMap.CurrentExtent; foreach (Layer LYR in diMap.Layers) { // Render layer only if it lies within current map extent Hashtable ht = LYR.GetRecords(LYR.LayerPath + "\\" + LYR.ID); IDictionaryEnumerator dicEnumerator = ht.GetEnumerator(); while (dicEnumerator.MoveNext()) { if (((Shape)dicEnumerator.Value).AreaId == areaID) { shape = (Shape)dicEnumerator.Value; caption = diMap.GetLabel(LYR, ref shape); layer = LYR; break; } } } StartPoint = new PointF(NewX, NewY); placeHolder.Width = Width; placeHolder.Height = Height; placeHolder.X = StartPoint.X + (placeHolder.Width / 2); placeHolder.Y = StartPoint.Y + (placeHolder.Height / 2); StartPointMapCoordinate = diMap.PointToClient(placeHolder.X, placeHolder.Y); placeHolder.X = StartPointMapCoordinate.X; placeHolder.Y = StartPointMapCoordinate.Y; if (layer.ModifiedLabels.ContainsKey(areaID)) { CustLabel = ((CustomLabel)layer.ModifiedLabels[areaID]); CustLabel.PlaceHolder = placeHolder; CustLabel.DrawPoint = StartPointMapCoordinate; } else { CustLabel = new CustomLabel(); CustLabel.AreaId = areaID; CustLabel.Caption = caption; CustLabel.LabelField = layer.LabelField; CustLabel.MultiRow = layer.LabelMultirow; CustLabel.Indent = layer.LabelIndented; CustLabel.PlaceHolder = placeHolder; CustLabel.DrawPoint = StartPointMapCoordinate; CustLabel.LabelFont = layer.LabelFont; CustLabel.ForeColor = layer.LabelColor; CustLabel.LeaderVisible = diMap.LeaderVisible; CustLabel.LeaderWidth = diMap.LeaderWidth; CustLabel.LeaderStyle = diMap.LeaderStyle; CustLabel.LeaderColor = diMap.LeaderColor; layer.ModifiedLabels.Add(areaID, CustLabel); } RetVal = this.GetBase64MapImageString(this.DrawMap(diMap)); //add map into session variable Session["DIMap"] = diMap; //serialize map in last MapFileWPath = Path.Combine(this.TempPath, HttpContext.Current.Request.Cookies["SessionID"].Value + ".xml"); this.SerializeObject(MapFileWPath, diMap); } catch (Exception ex) { //Global.WriteErrorsInLog("From Nudging->" + ex.Message); RetVal = "false" + Constants.Delimiters.ParamDelimiter + ex.Message; Global.CreateExceptionString(ex, null); } finally { } return RetVal; }
protected override void OnElementChanged(ElementChangedEventArgs <Label> e) { base.OnElementChanged(e); try { CustomLabel element = Element as CustomLabel; if (e.NewElement != null) { element = Element as CustomLabel; } else { element = e.OldElement as CustomLabel; } if (Control != null) { var label = (UILabel)Control; label.ExclusiveTouch = true; //Control.ExclusiveTouch = true; //var element = Element as CustomLabel; if (!string.IsNullOrWhiteSpace(element.CustomFontColor)) { //Control.TextColor = Color.FromHex(element.CustomFontColor).ToUIColor(); //Control.TextColor = Color.FromHex("#00A6CC").ToUIColor(); //Control.TextColor = Color.FromHex(element.CustomFontColor).ToCGColor(); } //Control.TextColor = UIColor.Black; //for place holder //var entry1 = new Entry(); //Control.Layer.BorderColor = Color.FromHex("#0000").ToCGColor(); //Control.Layer.BorderWidth = 0; //entry1.Layer.BorderWidth = 1f; // to set underline label if (element.ShallUnderLine == true) { nint startind = 0, charLength = 0; startind = element.StartIndex; //var label = (UILabel)Control; var text = (NSMutableAttributedString)label.AttributedText; if (element.NoOfChar == 0 && element.EndIndex == 0) { charLength = text.Length; } else if (element.EndIndex != 0 && element.NoOfChar != 0) { charLength = element.NoOfChar; } else if (element.EndIndex == 0) { charLength = element.NoOfChar; } else if (element.NoOfChar == 0) { charLength = element.EndIndex - element.StartIndex; } else { charLength = text.Length; } var range = new NSRange(startind, charLength); text.AddAttribute(UIStringAttributeKey.UnderlineStyle, NSNumber.FromInt32((int)NSUnderlineStyle.Single), range); } else if (element.ShallUnderLine == true && element.ShallUseHTMLOnly == false) { } else { } //for font size and font formats var fontSizes = 16.0; if (element.FontSize == 0 || element.FontSize == null) { } else { fontSizes = element.FontSize; } uint fontSize = (uint)fontSizes; if (element.FontFamily == "HelveticaReg") { label.Font = UIFont.FromName("HelveticaRegular.ttf", fontSize); //Control.Font = UIFont.FromName("HelveticaRegular.ttf", fontSize); } else if (element.FontFamily == "Helvitica77B") { label.Font = UIFont.FromName("HelveticaNeueIt77BoldCondensed.ttf", fontSize); //Control.Font = UIFont.FromName("HelveticaNeueIt77BoldCondensed.ttf", fontSize); } else if (element.FontFamily == "Helvitica57B") { label.Font = UIFont.FromName("HelveticaLT57Condensed.ttf", fontSize); //Control.Font = UIFont.FromName("HelveticaLT57Condensed.ttf", fontSize); } else { } if (element.IsHTMLText == true) { var attr = new NSAttributedStringDocumentAttributes(); var nsError = new NSError(); attr.DocumentType = NSDocumentType.HTML; var myHtmlData = NSData.FromString(element.Text, NSStringEncoding.Unicode); this.Control.AttributedText = new NSAttributedString(myHtmlData, attr, ref nsError); } } } catch (Exception ex) { var msg = ex.Message; } }