Esempio n. 1
0
            /// <summary>
            /// 安装完成处理
            /// </summary>
            protected override void onCreated()
            {
                int methodIndex = methods.Count;

                ViewMethods = new webView.cSharp {
                    AutoParameter = AutoParameter
                }.GetTypeAttributes()
                .getFind(value => value.Value.IsAjax)
                .GetArray(value => new viewMethodIndex
                {
                    MethodIndex       = methodIndex++,
                    WebViewMethodType = value.Key,
                    Attribute         = value.Value,
                    CallName          = new webView.cSharp.viewType {
                        type = value.Key, Attribute = value.Value, DefaultNamespace = AutoParameter.DefaultNamespace + ".", IgnoreCase = AutoParameter.WebConfig.IgnoreCase
                    }.CallName
                });
                if (methodIndex != 0)
                {
                    subArray <KeyValuePair <string, int> > names = (Methods = methods.ToArray()).getArray(value => value.CallName)
                                                                   .concat(ViewMethods.getArray(value => value.CallName))
                                                                   .groupCount(value => value)
                                                                   .getFind(value => value.Value != 1);
                    if (names.Count == 0)
                    {
                        IsPubError  = Methods.any(method => method.CallName == fastCSharp.code.cSharp.ajax.PubErrorCallName);
                        MethodCount = Methods.Length + ViewMethods.Length + (IsPubError ? 0 : 1);
                        _code_.Empty();
                        create(false);
                        fastCSharp.code.coder.Add("namespace " + AutoParameter.DefaultNamespace + @"
{
" + _code_.ToString() + @"
}");
                        ts.OnCreated();
                    }
                    else
                    {
                        error.Add(@"AJAX调用名称冲突:
" + names.joinString(@"
", value => value.Key + "[" + value.Value.toString() + "]"));
                    }
                }
            }