本文整理汇总了C#中Feature.Count方法的典型用法代码示例。如果您正苦于以下问题:C# Feature.Count方法的具体用法?C# Feature.Count怎么用?C# Feature.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feature
的用法示例。
在下文中一共展示了Feature.Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseToolScript
bool ParseToolScript( string s )
{
int linecounter = -1;
try
{
//_toolpaths.Clear();
//_rawElements.Clear();
//_toolpaths.Clear();
//_features.Clear();
tabWidth = eval(tbTabWidth.Text);
float fRotation = eval(tbRotateDegrees.Text);
PointF pRotationCenter = evalPoint(tbRotateCenter.Text);
Color currentColor = Color.Green;
Feature currentFeature = new Feature( FeatureType.Reference );
Dictionary<string, string> variables = new Dictionary<string, string>();
PointF pOffset = new PointF(0, 0);
float fScale = 1.0f;
float.TryParse(tbScale.Text, out fScale);
string[] offsets = tbOffset.Text.Split(new char[] { ',' });
if (offsets.Length > 1)
{
pOffset.X = float.Parse(offsets[0]);
pOffset.Y = float.Parse(offsets[1]);
}
// grab the text
//string s = editor.Text;
// comments: C++, C, perl
// FIXME: deal with the c++ comment differently so we can match
// up line numbers below (for errors)
s = new Regex(@"/\*..*?\*/", RegexOptions.Singleline).Replace(s, "\r\n");
s = new Regex(@"//.*$", RegexOptions.Multiline).Replace(s, "");
s = new Regex(@"#.*$", RegexOptions.Multiline).Replace(s, "");
// split into single lines... ?
s = s.Replace("\r\n", "\n");
string[] lines = s.Split(new char[] { '\n' });//, StringSplitOptions.RemoveEmptyEntries);
foreach (string baseline in lines)
{
linecounter++;
string line = baseline.Trim();
if (line.Equals("")) continue;
string keyword = new Regex(@"(?:\W|\s).*$", RegexOptions.Singleline).Replace(line, "").ToUpper();
string parmstring = new Regex(@"^\S+\s+", RegexOptions.Singleline).Replace( line + " ", "").ToUpper();
foreach (string key in variables.Keys)
{
parmstring = new Regex(@"(?<=^|\s|\W)\$" + key + @"(?=$|\s|\W)").Replace(parmstring, variables[key]);
}
bool handled = false;
if (keyword.Equals("SET"))
{
// problem: variable could be an expression. either
// (1) evaluate before setting here; or (2) wrap in
// parens. each is equally valid, should be no difference
// in effects because we replace variables _before_ this
// point. if we were replacing variables _after_ this,
// then the parens would be a no brainer.
// CHANGEME? for now, eval.
string[] parms = parmstring.Split(new char[] { '=' });
parms[0] = parms[0].Trim().ToUpper();
float evar = eval(parms[1]);
if (variables.ContainsKey(parms[0])) variables[parms[0]] = evar.ToString();
else variables.Add(parms[0], evar.ToString());
logMessage(string.Format("Set {0} = {1:0.00}", parms[0], evar ));
handled = true;
}
if (!handled)
{
string[] parms = parmstring.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parms.Length; i++) parms[i] = new Regex(@"\W").Replace(parms[i], "");
handled = true;
switch (keyword)
{
// feature definitions
case "PROFILE":
if (null != currentFeature && currentFeature.Count() > 0)
//.........这里部分代码省略.........