コード例 #1
0
ファイル: StepProvider.cs プロジェクト: rstuven/cuke4vs
        private static string GetAttributeValue(CodeAttribute attribute, CodeClass codeClass)
        {
            var value = attribute.Value;
            if (!string.IsNullOrEmpty(value))
            {
                if (value[0] != '"' && value[0] != '@')
                {
                    var variable = codeClass.GetIEnumerable<CodeVariable>()
                        .Where(v => v.IsConstant && v.Name == value)
                        .FirstOrDefault();

                    if (variable != null)
                    {
                        var initExpression = variable.InitExpression as string;
                        if (initExpression != null)
                        {
                            value = initExpression;
                        }
                    }
                }
            }
            return value;
        }
コード例 #2
0
ファイル: StepProvider.cs プロジェクト: rstuven/cuke4vs
        public void ProcessItem(CodeClass codeClass)
        {
            if (codeClass == null) return;
            lock (this)
            {
                RemoveAttributesFor(codeClass.FullName);

                foreach (var attribute in codeClass.GetIEnumerable<CodeAttribute>())
                {
                    var parent = attribute.Parent as CodeElement;

                    Debug.Print("StepProvider: Add '{0}', parent='{1}'", attribute.Name, parent != null ? parent.Name : "<null>");

                    AddStep(attribute, codeClass);
                }
            }
        }