private void HandleCharacterCharacteristicsInformations(StatsUpgradeResultMessage message, ConnectedHost source) { switch (message.result) { default: TextDataAdapter.GetText("ui.popup.statboostFailed.text"); break; case 0: source.logger.Log("Caractéristique augmentée avec succés.", Common.Default.Loging.LogLevelEnum.Succes); break; case 1: source.logger.Log(TextDataAdapter.GetText("ui.charSel.deletionErrorUnsecureMode"), Common.Default.Loging.LogLevelEnum.Error); break; case 2: source.logger.Log(TextDataAdapter.GetText("ui.fight.guestAccount"), Common.Default.Loging.LogLevelEnum.Error); break; case 3: source.logger.Log(TextDataAdapter.GetText("ui.error.cantDoInFight"), Common.Default.Loging.LogLevelEnum.Error); break; case 4: source.logger.Log(TextDataAdapter.GetText("ui.popup.statboostFailed.notEnoughPoint"), Common.Default.Loging.LogLevelEnum.Error); break; } OnUpdated(); }
private void TextMaker_Load(object sender, EventArgs e) { tabControlMain.TabPages.Clear(); MyTextBox.Clear(); DefinedItems = LoadDefinedItems(@"FixedDefinitionXML.xml"); MyTextDataAdapter = new TextDataAdapter(DefinedItems); MakeControls(DefinedItems); }
/// <summary> /// Draws the plot on a GDI+ surface against the provided x and y axes. /// </summary> /// <param name="g">The GDI+ surface on which to draw.</param> /// <param name="xAxis">The X-Axis to draw against.</param> /// <param name="yAxis">The Y-Axis to draw against.</param> public override void Draw(IGraphics g, PhysicalAxis xAxis, PhysicalAxis yAxis) { SequenceAdapter data = new SequenceAdapter(DataSource, DataMember, OrdinateData, AbscissaData); TextDataAdapter textData = new TextDataAdapter(DataSource, DataMember, TextData); // first plot the marker // we can do this cast, since the constructor accepts only this type! for (int i = 0; i < data.Count; ++i) { try { PointD pt = data[i]; if (!Double.IsNaN(pt.X) && !Double.IsNaN(pt.Y)) { PointF xPos = xAxis.WorldToPhysical(pt.X, false); PointF yPos = yAxis.WorldToPhysical(pt.Y, false); Marker.Draw(g, (int)xPos.X, (int)yPos.Y); if (textData[i] != "") { SizeF size = g.MeasureString(textData[i], Font); switch (LabelTextPosition) { case LabelPositions.Above: g.DrawString(textData[i], Font, Brushes.Black, new PointF(xPos.X - size.Width / 2, yPos.Y - size.Height - Marker.Size * 2 / 3)); break; case LabelPositions.Below: g.DrawString(textData[i], Font, Brushes.Black, new PointF(xPos.X - size.Width / 2, yPos.Y + Marker.Size * 2 / 3)); break; case LabelPositions.Left: g.DrawString(textData[i], Font, Brushes.Black, new PointF(xPos.X - size.Width - Marker.Size * 2 / 3, yPos.Y - size.Height / 2)); break; case LabelPositions.Right: g.DrawString(textData[i], Font, Brushes.Black, new PointF(xPos.X + Marker.Size * 2 / 3, yPos.Y - size.Height / 2)); break; } } } } catch { throw new NPlotException("Error in TextPlot.Draw"); } } }
/// <summary> /// データファイルを開くボタンイベント /// </summary> private void btnOpenDataFile_Click(object sender, EventArgs e) { var dataFilePath = OpenFileDialogShow(); if (string.IsNullOrWhiteSpace(dataFilePath)) { return; } var dataText = ReadFile(dataFilePath); //テキストボックスに描画 MyTextDataAdapter = new TextDataAdapter(DefinedItems, dataText.ToString()); MyTextBox.Text = MyTextDataAdapter.GetParsedText(); }
private void btnOpenFile_Click(object sender, EventArgs e) { tabControlMain.TabPages.Clear(); MyTextBox.Clear(); var dataFilePath = OpenFileDialogShow(); if (string.IsNullOrWhiteSpace(dataFilePath)) { return; } DefinedItems = LoadDefinedItems(dataFilePath); MyTextDataAdapter = new TextDataAdapter(DefinedItems); MakeControls(DefinedItems); }
public NpcModel(GameRolePlayNpcInformations message) : base(message) { NpcId = message.npcId; Sex = message.sex; SpecialArtworkId = message.specialArtworkId; NpcData = GameDataAdapter.GetClass <Npc>(NpcId); if (NpcData == null) { return; } NpcName = TextDataAdapter.GetText((int)NpcData.NameId); NpcReplies = new List <Replie>(); foreach (List <int> list in this.NpcData.DialogReplies) { this.NpcReplies.Add(new Replie(list[0], TextDataAdapter.GetText(list[1]))); } }
/// <summary> /// Draws the plot on a GDI+ surface against the provided x and y axes. /// </summary> /// <param name="g">The GDI+ surface on which to draw.</param> /// <param name="xAxis">The X-Axis to draw against.</param> /// <param name="yAxis">The Y-Axis to draw against.</param> public override void Draw( Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis ) { SequenceAdapter data = new SequenceAdapter( this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData ); TextDataAdapter textData = new TextDataAdapter( this.DataSource, this.DataMember, this.TextData ); // first plot the marker // we can do this cast, since the constructor accepts only this type! for (int i=0; i<data.Count; ++i) { try { PointD pt = data[i]; if ( !Double.IsNaN(pt.X) && !Double.IsNaN(pt.Y) ) { PointF xPos = xAxis.WorldToPhysical( pt.X, false); PointF yPos = yAxis.WorldToPhysical( pt.Y, false); Marker.Draw( g, (int)xPos.X, (int)yPos.Y ); if ( textData[i] != "" ) { SizeF size = g.MeasureString( textData[i], this.Font ); switch (labelTextPosition_) { case LabelPositions.Above: g.DrawString( textData[i], font_, Brushes.Black, new PointF(xPos.X-size.Width/2,yPos.Y-size.Height-Marker.Size*2/3)); break; case LabelPositions.Below: g.DrawString( textData[i], font_, Brushes.Black, new PointF(xPos.X-size.Width/2,yPos.Y+Marker.Size*2/3)); break; case LabelPositions.Left: g.DrawString( textData[i], font_, Brushes.Black, new PointF(xPos.X-size.Width-Marker.Size*2/3,yPos.Y-size.Height/2)); break; case LabelPositions.Right: g.DrawString( textData[i], font_, Brushes.Black, new PointF(xPos.X+Marker.Size*2/3,yPos.Y-size.Height/2)); break; } } } } catch { throw new NPlotException("Error in TextPlot.Draw"); } } }
/// <summary> /// Draws the plot using the Drawing Context and X, Y axes supplied. /// </summary> public override void Draw(Context ctx, PhysicalAxis xAxis, PhysicalAxis yAxis) { SequenceAdapter data = new SequenceAdapter(this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData); TextDataAdapter textData = new TextDataAdapter(this.DataSource, this.DataMember, this.TextData); TextLayout layout = new TextLayout(); layout.Font = Font; ctx.Save(); ctx.SetColor(Colors.Black); for (int i = 0; i < data.Count; ++i) { try { Point p = data[i]; if (!Double.IsNaN(p.X) && !Double.IsNaN(p.Y)) { Point xPos = xAxis.WorldToPhysical(p.X, false); Point yPos = yAxis.WorldToPhysical(p.Y, false); // first plot the marker Marker.Draw(ctx, xPos.X, yPos.Y); // then the label if (textData[i] != "") { layout.Text = textData[i]; Size size = layout.GetSize(); switch (labelTextPosition) { case LabelPositions.Above: p.X = xPos.X - size.Width / 2; p.Y = yPos.Y - size.Height - Marker.Size * 2 / 3; break; case LabelPositions.Below: p.X = xPos.X - size.Width / 2; p.Y = yPos.Y + Marker.Size * 2 / 3; break; case LabelPositions.Left: p.X = xPos.X - size.Width - Marker.Size * 2 / 3; p.Y = yPos.Y - size.Height / 2; break; case LabelPositions.Right: p.X = xPos.X + Marker.Size * 2 / 3; p.Y = yPos.Y - size.Height / 2; break; } ctx.DrawTextLayout(layout, p); } } } catch { throw new XwPlotException("Error in TextPlot.Draw"); } } ctx.Restore(); }
/// <summary> /// Draws the plot using the Drawing Context and X, Y axes supplied. /// </summary> public override void Draw(Context ctx, PhysicalAxis xAxis, PhysicalAxis yAxis) { SequenceAdapter data = new SequenceAdapter (this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData); TextDataAdapter textData = new TextDataAdapter (this.DataSource, this.DataMember, this.TextData); TextLayout layout = new TextLayout (); layout.Font = Font; ctx.Save (); ctx.SetColor (Colors.Black); for (int i=0; i<data.Count; ++i) { try { Point p = data[i]; if (!Double.IsNaN(p.X) && !Double.IsNaN(p.Y)) { Point xPos = xAxis.WorldToPhysical (p.X, false); Point yPos = yAxis.WorldToPhysical (p.Y, false); // first plot the marker Marker.Draw (ctx, xPos.X, yPos.Y); // then the label if (textData[i] != "") { layout.Text = textData[i]; Size size = layout.GetSize (); switch (labelTextPosition) { case LabelPositions.Above: p.X = xPos.X-size.Width/2; p.Y = yPos.Y-size.Height-Marker.Size*2/3; break; case LabelPositions.Below: p.X = xPos.X-size.Width/2; p.Y = yPos.Y+Marker.Size*2/3; break; case LabelPositions.Left: p.X = xPos.X-size.Width-Marker.Size*2/3; p.Y = yPos.Y-size.Height/2; break; case LabelPositions.Right: p.X = xPos.X+Marker.Size*2/3; p.Y = yPos.Y-size.Height/2; break; } ctx.DrawTextLayout (layout, p); } } } catch { throw new XwPlotException ("Error in TextPlot.Draw"); } } ctx.Restore (); }