private type_generationGenerateentityCustomcreatemethod CreateCreateMethod(string pDef) { //create new entry type_generationGenerateentityCustomcreatemethod m = new type_generationGenerateentityCustomcreatemethod(); //get the single tokens string[] astrTokens = pDef.Split(','); for (int intIndex = 0; intIndex < astrTokens.Length; intIndex++) { astrTokens[intIndex] = astrTokens[intIndex].Replace("%%;%%", ","); } //first token is the method name m.name = astrTokens[0]; //get the attributes to filter the query ArrayList alAttr = new ArrayList(); int intCount = 1; while (intCount < astrTokens.Length) { type_generationGenerateentityCustomcreatemethodMethodattribute attr = new type_generationGenerateentityCustomcreatemethodMethodattribute(); attr.name = astrTokens[intCount]; alAttr.Add(attr); intCount++; } //Set the found attributes m.methodattribute = (type_generationGenerateentityCustomcreatemethodMethodattribute[]) alAttr.ToArray(typeof(type_generationGenerateentityCustomcreatemethodMethodattribute)); return(m); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(fdlgCustomCreateMethod)); this.lblMethodName = new System.Windows.Forms.Label(); this.txtMethodName = new System.Windows.Forms.TextBox(); this.AttributeSelector = new PVEntityGenerator.Dialogs.ctlAttributeSelector(); this.cmdCancel = new System.Windows.Forms.Button(); this.cmdOK = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lblMethodName // this.lblMethodName.AutoSize = true; this.lblMethodName.Location = new System.Drawing.Point(12, 12); this.lblMethodName.Name = "lblMethodName"; this.lblMethodName.Size = new System.Drawing.Size(73, 17); this.lblMethodName.TabIndex = 0; this.lblMethodName.Text = "Method name"; // // txtMethodName // this.txtMethodName.Location = new System.Drawing.Point(88, 8); this.txtMethodName.Name = "txtMethodName"; this.txtMethodName.Size = new System.Drawing.Size(196, 21); this.txtMethodName.TabIndex = 1; this.txtMethodName.Text = ""; // // AttributeSelector // this.AttributeSelector.AttributeAddCustomAllowed = false; this.AttributeSelector.CustomCreateMethod = null; this.AttributeSelector.CustomFindMethod = null; this.AttributeSelector.DbDefinitionDocument = null; this.AttributeSelector.Entity = null; this.AttributeSelector.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.AttributeSelector.Location = new System.Drawing.Point(8, 32); this.AttributeSelector.Name = "AttributeSelector"; this.AttributeSelector.Size = new System.Drawing.Size(456, 228); this.AttributeSelector.TabIndex = 2; // // cmdCancel // this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cmdCancel.Location = new System.Drawing.Point(480, 44); this.cmdCancel.Name = "cmdCancel"; this.cmdCancel.Size = new System.Drawing.Size(72, 24); this.cmdCancel.TabIndex = 4; this.cmdCancel.Text = "Cancel"; // // cmdOK // this.cmdOK.Location = new System.Drawing.Point(480, 12); this.cmdOK.Name = "cmdOK"; this.cmdOK.Size = new System.Drawing.Size(72, 24); this.cmdOK.TabIndex = 3; this.cmdOK.Text = "OK"; this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click); // // fdlgCustomCreateMethod // this.AcceptButton = this.cmdOK; this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.CancelButton = this.cmdCancel; this.ClientSize = new System.Drawing.Size(562, 267); this.Controls.Add(this.cmdCancel); this.Controls.Add(this.cmdOK); this.Controls.Add(this.AttributeSelector); this.Controls.Add(this.txtMethodName); this.Controls.Add(this.lblMethodName); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "fdlgCustomCreateMethod"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Custom create method"; this.ResumeLayout(false); }