本文整理汇总了C#中System.Text.ASCIIEncoding.StartsWith方法的典型用法代码示例。如果您正苦于以下问题:C# ASCIIEncoding.StartsWith方法的具体用法?C# ASCIIEncoding.StartsWith怎么用?C# ASCIIEncoding.StartsWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.ASCIIEncoding
的用法示例。
在下文中一共展示了ASCIIEncoding.StartsWith方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public List<PageItem> Process(int Flags, byte[] RecordData)
{
MemoryStream _ms = null;
BinaryReader _br = null;
try
{
_ms = new MemoryStream(RecordData);
_br = new BinaryReader(_ms);
Byte[] PrivateData = _br.ReadBytes(RecordData.Length);
//Ok we should have our private data which I am storing my tooltip value in...
//now lets interpret it...
string PData = new System.Text.ASCIIEncoding().GetString(PrivateData);
//If string starts with "ToolTip" then lets do something with it.. otherwise I don't care about it.
if (PData.StartsWith("ToolTip"))
{
PageRectangle pr = new PageRectangle();
StyleInfo si = new StyleInfo();
pr.SI = si;
//si.BackgroundColor = Color.Blue;// Just a test to see where the tooltip is being drawn
string[] ttd = PData.Split('|');
pr.Tooltip = ttd[0].Split(':')[1];
pr.X = X + Single.Parse(ttd[1].Split(':')[1]) * SCALEFACTOR;
pr.Y = Y + Single.Parse(ttd[2].Split(':')[1]) * SCALEFACTOR;
pr.W = Single.Parse(ttd[3].Split(':')[1]) * SCALEFACTOR;
pr.H = Single.Parse(ttd[4].Split(':')[1]) * SCALEFACTOR;
items.Add(pr);
}
else if (PData.StartsWith("PolyToolTip"))
{
PagePolygon pp = new PagePolygon();
StyleInfo si = new StyleInfo();
pp.SI = si;
//si.BackgroundColor = Color.Blue;// Just a test to see where the tooltip is being drawn
string[] ttd = PData.Split('|');
PointF[] pts = new PointF[(ttd.Length - 1) / 2];
pp.Points = pts;
pp.Tooltip = ttd[0].Split(':')[1];
for (int i = 0; i < pts.Length; i++)
{
pts[i].X = X + Single.Parse(ttd[i*2 +1]) * SCALEFACTOR;
pts[i].Y = Y + Single.Parse(ttd[i*2 +2]) * SCALEFACTOR;
}
items.Add(pp);
}
return items;
}
finally
{
if (_br != null)
_br.Close();
if (_ms != null)
_ms.Dispose();
}
}