Exemplo n.º 1
0
 /// <summary>
 /// Default constructor for CSharpClientCodeGenerator. It initializes contained generators with their default values.
 /// </summary>
 public CSharpClientCodeGenerator()
 {
     this._webContextGenerator    = new CSharpWebContextGenerator();
     this._entityProxyGenerator   = new CSharpEntityGenerator();
     this._complexObjectGenerator = new CSharpComplexObjectGenerator();
     this._domainContextGenerator = new CSharpDomainContextGenerator();
     this._enumGenerator          = new CSharpEnumGenerator();
 }
 /// <summary>
 /// Default constructor for CSharpClientCodeGenerator. It initializes contained generators with their default values.
 /// </summary>
 public CSharpClientCodeGenerator()
 {
     this._webContextGenerator = new CSharpWebContextGenerator();
     this._entityProxyGenerator = new CSharpEntityGenerator();
     this._complexObjectGenerator = new CSharpComplexObjectGenerator();
     this._domainContextGenerator = new CSharpDomainContextGenerator();
     this._enumGenerator = new CSharpEnumGenerator();
 }
Exemplo n.º 3
0
        private void GenerateContractMethod(DomainOperationEntry operation)
        {
            this.Write("[OpenRiaServices.DomainServices.Client.HasSideEffects(");

            this.Write(this.ToStringHelper.ToStringWithCulture(DomainContextGenerator.OperationHasSideEffects(operation).ToString().ToLower()));

            this.Write(")]\r\n");


            this.GenerateContractMethodAttributes(operation.Name);

            this.Write("System.IAsyncResult Begin");

            this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));

            this.Write("(\r\n");


            foreach (DomainOperationParameter parameter in operation.Parameters)
            {
                Type parameterType = CodeGenUtilities.TranslateType(parameter.ParameterType);

                this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenUtilities.GetTypeName(parameterType)));

                this.Write(" ");

                this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

                this.Write(",\r\n");
            }

            this.Write("System.AsyncCallback callback, object asyncState);\r\n");


            string returnTypeName = CSharpDomainContextGenerator.GetEndOperationReturnType(operation);

            this.Write("\t\t\r\n");

            this.Write(this.ToStringHelper.ToStringWithCulture(returnTypeName));

            this.Write(" End");

            this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));

            this.Write("(System.IAsyncResult result);\r\n");
        }
Exemplo n.º 4
0
 internal override void Initialize()
 {
     base.Initialize();
     this.DomainContextTypeName = CodeGenUtilities.GetSafeName(DomainContextGenerator.GetDomainContextTypeName(this.DomainServiceDescription));
 }