Exemplo n.º 1
0
        public override void Generate()
        {
            if (_model.Database.AllowZeroTouch)
            {
                return;
            }
            try
            {
                //Process all tables
                foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
                {
                    if (table.Generated)
                    {
                        SQLStoredProcedureTableAllTemplate template = new SQLStoredProcedureTableAllTemplate(_model, table);
                        string fullFileName = template.FileName;
                        ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, PARENT_ITEM_NAME, ProjectItemType.Folder, this, true);
                        eventArgs.Properties.Add("BuildAction", 3);
                        OnProjectItemGenerated(this, eventArgs);
                    }
                }

                ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
                OnGenerationComplete(this, gcEventArgs);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
		public override void Generate()
		{
			if (_model.Database.AllowZeroTouch) return;
      try
      {
				//Process all tables
        foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
        {
					if (table.Generated)
					{
						SQLStoredProcedureTableAllTemplate template = new SQLStoredProcedureTableAllTemplate(_model, table);
						string fullFileName = template.FileName;
						ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, PARENT_ITEM_NAME, ProjectItemType.Folder, this, true);
						eventArgs.Properties.Add("BuildAction", 3);
						OnProjectItemGenerated(this, eventArgs);
					}
        }

        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch (Exception ex)
      {
        throw;
      }
		}