public override void Generate()
		{
      try
      {
        foreach(Table table in _model.Database.Tables)
        {
          if(table.Name == "PROPERTY_ITEM_DATA_TYPE")
          {
            int ii = 0;
          }


          if(table.Generated)
          {
            SelectCommandExtenderTemplate template = new SelectCommandExtenderTemplate(_model, table);
            string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
            OnProjectItemGenerated(this, eventArgs);
          }
        }
        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch(Exception ex)
      {
        throw;
      }
    }
    public override void Generate()
		{
			//If this is a zero-touch install then there are no stored procedures
			if (_model.Database.AllowZeroTouch) return;

			foreach (Table table in _model.Database.Tables)
			{
        if(table.Generated)
        {
					if (table.PrimaryKeyColumns.Count < table.GeneratedColumns.Count)
					{
						foreach (TableComponent component in table.ComponentList)
						{
							SQLUpdateComponentTemplate template = new SQLUpdateComponentTemplate(_model, component);
							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);
    }
		public override void Generate()
		{
			if (_model.Database.AllowZeroTouch) return;
      try
      {
				//Process all views
				foreach (CustomView view in _model.Database.CustomViews.OrderBy(x => x.Name))
				{
					if (view.Generated)
					{
						SQLStoredProcedureViewAllTemplate template = new SQLStoredProcedureViewAllTemplate(_model, view);
						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;
      }
		}
    public override void Generate()
		{
      try
      {
        foreach(Table table in _model.Database.Tables)
        {
          if(table.Generated)
          {
						foreach (TableComponent component in table.ComponentList)
						{
							DomainComponentGeneratedTemplate template = new DomainComponentGeneratedTemplate(_model, component);
							string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
							ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
							OnProjectItemGenerated(this, eventArgs);
						}
          }
        }
        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch(Exception ex)
      {
        throw;
      }
    }
Esempio n. 6
0
    public override void Generate()
		{
			ConfigValuesExtenderTemplate template = new ConfigValuesExtenderTemplate(_model);
			string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
			OnProjectItemGenerated(this, eventArgs);
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
    }
		public override void Generate()
		{
			var template = new DataServiceGlobalModuleCSTemplate(_model);
			var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
			var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
			OnProjectItemGenerated(this, eventArgs);
			var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
		public override void Generate()
		{
			var template = new ProxyFactoryExtenderTemplate(_model);
			var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
			var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
			OnProjectItemGenerated(this, eventArgs);
			var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
		public override void Generate()
		{
			DataServiceStaticJScriptsTemplate template = new DataServiceStaticJScriptsTemplate(_model);
			string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
			OnProjectItemGenerated(this, eventArgs);

			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
    public override void Generate()
		{
			UpgradeVersionedTemplate template = new UpgradeVersionedTemplate(_model);
			string fullFileName = template.FileName;
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, PARENT_ITEM_NAME, ProjectItemType.Folder, this, false);
			eventArgs.Properties.Add("BuildAction", 3);
			OnProjectItemGenerated(this, eventArgs);
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
    }
		public override void Generate()
		{
			BusinessSQLHelperGeneratedTemplate template = new BusinessSQLHelperGeneratedTemplate(_model);
			string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
			OnProjectItemGenerated(this, eventArgs);

			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);

		}
Esempio n. 12
0
        public override void Generate()
        {
            CreateSchemaTemplate template           = new CreateSchemaTemplate(_model);
            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);
        }
		public override void Generate()
		{
			foreach (Table table in _model.Database.Tables.Where(x => x.Generated && !x.AssociativeTable && !x.IsTypeTable).OrderBy(x => x.Name))
			{
				EntityPrimaryKeyExtenderTemplate template = new EntityPrimaryKeyExtenderTemplate(_model, table);
				string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
				ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
				OnProjectItemGenerated(this, eventArgs);
			}
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
Esempio n. 14
0
        public override void Generate()
        {
            var template       = new SQLHelperGeneratedTemplate(_model);
            var fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
            var eventArgs      = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);

            OnProjectItemGenerated(this, eventArgs);

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
		public override void Generate()
		{
			foreach (var table in (from x in _model.Database.Tables where x.Generated && !x.AssociativeTable orderby x.Name select x))
			{
				var template = new ObjectServiceExtenderTemplate(_model, table);
				var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
				var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
				OnProjectItemGenerated(this, eventArgs);
			}
			var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
Esempio n. 16
0
        public override void Generate()
        {
            BusinessSQLHelperExtenderTemplate template = new BusinessSQLHelperExtenderTemplate(_model);
            string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);

            OnProjectItemGenerated(this, eventArgs);

            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 17
0
        public override void Generate()
        {
            //Sql Server
            var template = new CSDLTemplate(_model);
            var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 18
0
        public override void Generate()
        {
            DataServiceWebConfigMainServiceCSTemplate template = new DataServiceWebConfigMainServiceCSTemplate(_model);
            string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);

            OnProjectItemGenerated(this, eventArgs);

            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 19
0
        public override void Generate()
        {
            var template     = new CreateAuditTriggerTemplate(_model);
            var fullFileName = template.FileName;
            var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, PARENT_ITEM_NAME, ProjectItemType.Folder, this, true);

            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);
            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
        public override void Generate()
        {
            try
            {
                if (this.UseSingleFile)
                {
                    //Process all views
                    var sb = new StringBuilder();
                    sb.AppendLine("--DO NOT MODIFY THIS FILE. IT IS ALWAYS OVERWRITTEN ON GENERATION.");
                    sb.AppendLine();

                    var grantSB = new StringBuilder();
                    foreach (var storedProcedure in _model.Database.CustomStoredProcedures.Where(x => x.Generated).OrderBy(x => x.Name))
                    {
                        var template = new SQLSelectStoredProcedureTemplate(_model, storedProcedure, true, grantSB);
                        sb.Append(template.FileContent);
                    }

                    //Add Grants
                    sb.Append(grantSB.ToString());

                    var eventArgs = new ProjectItemGeneratedEventArgs("StoredProcedures.sql", sb.ToString(), ProjectName, this.ParentItemPath, ProjectItemType.Folder, this, true);
                    eventArgs.Properties.Add("BuildAction", 3);
                    OnProjectItemGenerated(this, eventArgs);
                }
                else
                {
                    foreach (var storedProcedure in _model.Database.CustomStoredProcedures.Where(x => x.Generated).OrderBy(x => x.Name))
                    {
                        var grantSB  = new StringBuilder();
                        var template = new SQLSelectStoredProcedureTemplate(_model, storedProcedure, false, grantSB);

                        //Add grants
                        var sb = new StringBuilder();
                        sb.Append(template.FileContent);
                        sb.Append(grantSB.ToString());

                        var fullFileName = template.FileName;
                        var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this.ParentItemPath, ProjectItemType.Folder, this, true);
                        eventArgs.Properties.Add("BuildAction", 3);
                        OnProjectItemGenerated(this, eventArgs);
                    }
                }

                var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
                OnGenerationComplete(this, gcEventArgs);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Esempio n. 21
0
 private void projectItemGenerator_GenerationComplete(object sender, ProjectItemGenerationCompleteEventArgs e)
 {
     nHydrateLog.LogInfo("Project Item Generation Complete: {0}", e.ProjectItemGenerator);
     try
     {
         GenerateSubItems(e.ProjectItemGenerator);
         this.OnGenerationComplete(sender, e);
     }
     catch (Exception ex)
     {
         nHydrateLog.LogWarning(ex);
     }
 }
Esempio n. 22
0
        public override void Generate()
        {
            foreach (var customView in _model.Database.CustomViews.Where(x => x.Generated).OrderBy(x => x.Name))
            {
                var template       = new ViewEntityGeneratedTemplate(_model, customView);
                var fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
                var eventArgs      = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
                OnProjectItemGenerated(this, eventArgs);
            }
            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
        public override void Generate()
        {
            foreach (Table table in _model.Database.Tables.Where(x => x.Generated && !x.AssociativeTable && (x.TypedTable != TypedTableConstants.EnumOnly) && x.AllowAuditTracking).OrderBy(x => x.Name))
            {
                var template     = new AuditEntityExtenderTemplate(_model, table);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                OnProjectItemGenerated(this, eventArgs);
            }
            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 24
0
        public override void Generate()
        {
            foreach (var table in (from x in _model.Database.Tables where x.Generated && !x.AssociativeTable orderby x.Name select x))
            {
                var template       = new EventArgsTemplate(_model, table);
                var fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
                var eventArgs      = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
                OnProjectItemGenerated(this, eventArgs);
            }
            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 25
0
        public override void Generate()
        {
            foreach (Table table in _model.Database.Tables.Where(x => x.Generated && !x.AssociativeTable && !x.IsTypeTable).OrderBy(x => x.Name))
            {
                EntityPrimaryKeyExtenderTemplate template = new EntityPrimaryKeyExtenderTemplate(_model, table);
                string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                OnProjectItemGenerated(this, eventArgs);
            }
            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 26
0
        public override void Generate()
        {
            //if (_model.Database.AllowZeroTouch) return;
            try
            {
                if (this.UseSingleFile)
                {
                    //Process all views
                    var sb = new StringBuilder();
                    sb.AppendLine("--DO NOT MODIFY THIS FILE. IT IS ALWAYS OVERWRITTEN ON GENERATION.");
                    sb.AppendLine();

                    sb.AppendLine("--##SECTION BEGIN [INTERNAL STORED PROCS]");
                    sb.AppendLine();

                    foreach (var table in _model.Database.Tables.Where(x => x.Generated && (x.TypedTable != TypedTableConstants.EnumOnly)).OrderBy(x => x.Name))
                    {
                        var template = new SQLStoredProcedureTableAllTemplate(_model, table, true);
                        sb.Append(template.FileContent);
                    }

                    sb.AppendLine("--##SECTION END [INTERNAL STORED PROCS]");
                    sb.AppendLine();

                    var eventArgs = new ProjectItemGeneratedEventArgs("StoredProcedures.sql", sb.ToString(), ProjectName, this.ParentItemPath, ProjectItemType.Folder, this, true);
                    eventArgs.Properties.Add("BuildAction", 3);
                    OnProjectItemGenerated(this, eventArgs);
                }
                else
                {
                    //Process all tables
                    foreach (var table in _model.Database.Tables.Where(x => x.Generated && (x.TypedTable != TypedTableConstants.EnumOnly)).OrderBy(x => x.Name))
                    {
                        var template     = new SQLStoredProcedureTableAllTemplate(_model, table, false);
                        var fullFileName = template.FileName;
                        var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this.ParentItemPath, ProjectItemType.Folder, this, true);
                        eventArgs.Properties.Add("BuildAction", 3);
                        OnProjectItemGenerated(this, eventArgs);
                    }
                }

                var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
                OnGenerationComplete(this, gcEventArgs);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    public override void Generate()
		{
			foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
			{
        if(table.Generated)
        {
          BusinessCollectionExtenderTemplate template = new BusinessCollectionExtenderTemplate(_model, table);
          string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
          ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
          OnProjectItemGenerated(this, eventArgs);
        }
			}
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
		public override void Generate()
		{
			string[] fileList = Directory.GetFiles(Path.Combine(AddinAppData.Instance.ExtensionDirectory, "jquery"), "*.js", SearchOption.AllDirectories);

			foreach (string fileName in fileList)
			{
				string tmpFileName = fileName.Replace(AddinAppData.Instance.ExtensionDirectory, "");
				string fullFileName = RELATIVE_OUTPUT_LOCATION + tmpFileName;
				ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, fileName, ProjectName, this, true);
				eventArgs.ContentType = ProjectItemContentType.File;
				OnProjectItemGenerated(this, eventArgs);
				ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
				OnGenerationComplete(this, gcEventArgs);
			}
		}
    public override void Generate()
		{
			foreach (Table table in _model.Database.Tables)
			{
        if(table.Generated)
        {
          DomainObjectExtenderTemplate template = new DomainObjectExtenderTemplate(_model, table);
          string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
          ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
          OnProjectItemGenerated(this, eventArgs);
        }
			}
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
		public override void Generate()
		{
			foreach (Table table in _model.Database.Tables.Where(x => x.Generated).OrderBy(x => x.Name))
			{
				if(table.Generated)
				{
					EntityPrimaryKeyTemplate template = new EntityPrimaryKeyTemplate(_model, table);
					string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
					ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
					OnProjectItemGenerated(this, eventArgs);
				}
			}
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
		}
Esempio n. 31
0
        public override void Generate()
        {
            var template = new CreateDataTemplate(_model);
            var fullFileName = template.FileName;
            var eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, PARENT_ITEM_NAME, ProjectItemType.Folder, this, true);
            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);
            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
            OnGenerationComplete(this, gcEventArgs);

            //Delete the old one
            var delEventArgs = new ProjectItemDeletedEventArgs($@"\{PARENT_ITEM_NAME}\{template.OldFileName}", ProjectName, this);
            delEventArgs.DeleteFile = true;
            OnProjectItemDeleted(this, delEventArgs);
        }
        public override void Generate()
        {
            if (!_model.AllowMocks)
            {
                return;
            }
            var template       = new ContextMockGeneratedTemplate(_model);
            var fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
            var eventArgs      = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);

            OnProjectItemGenerated(this, eventArgs);
            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 33
0
    public override void Generate()
		{
			foreach (Table table in _model.Database.Tables.OrderBy(x => x.Name))
			{
        if(table.Generated)
        {
					ObjectGridJSTemplate template = new ObjectGridJSTemplate(_model, table);
          string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
          ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, true);
          OnProjectItemGenerated(this, eventArgs);
        }
			}
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);
    }
        public override void Generate()
        {
            string[] fileList = Directory.GetFiles(Path.Combine(AddinAppData.Instance.ExtensionDirectory, "jquery.styles"), "*.*", SearchOption.AllDirectories);

            foreach (string fileName in fileList)
            {
                string tmpFileName  = fileName.Replace(AddinAppData.Instance.ExtensionDirectory, "");
                string fullFileName = RELATIVE_OUTPUT_LOCATION + tmpFileName.Replace(@"jquery.styles\", "");
                ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, fileName, ProjectName, this, true);
                eventArgs.ContentType = ProjectItemContentType.File;
                OnProjectItemGenerated(this, eventArgs);
                ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
                OnGenerationComplete(this, gcEventArgs);
            }
        }
Esempio n. 35
0
        public override void Generate()
        {
            foreach (Table table in _model.Database.Tables.Where(x => x.Generated).OrderBy(x => x.Name))
            {
                if (table.Generated)
                {
                    EntityPrimaryKeyTemplate template       = new EntityPrimaryKeyTemplate(_model, table);
                    string fullParentName                   = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
                    ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
                    OnProjectItemGenerated(this, eventArgs);
                }
            }
            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 36
0
        public override void Generate()
        {
            foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
            {
                if (table.Generated)
                {
                    BusinessObjectGeneratedTemplate template = new BusinessObjectGeneratedTemplate(_model, table);
                    string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
                    ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
                    OnProjectItemGenerated(this, eventArgs);
                }
            }
            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 37
0
        public override void Generate()
        {
            foreach (Table table in _model.Database.Tables.OrderBy(x => x.Name))
            {
                if (table.Generated)
                {
                    ObjectListPagesExtenderTemplate template = new ObjectListPagesExtenderTemplate(_model, table);
                    string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                    ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                    OnProjectItemGenerated(this, eventArgs);
                }
            }
            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 38
0
        public override void Generate()
        {
            foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
            {
                if (table.Generated)
                {
                    DomainCollectionExtenderTemplate template = new DomainCollectionExtenderTemplate(_model, table);
                    string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                    ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                    OnProjectItemGenerated(this, eventArgs);
                }
            }
            ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 39
0
 public override void Generate()
 {
     try
     {
         var template     = new FunctionsTemplate(_model);
         var fullFileName = template.FileName;
         var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this.ParentItemPath, ProjectItemType.Folder, this, true);
         eventArgs.Properties.Add("BuildAction", 3);
         OnProjectItemGenerated(this, eventArgs);
         var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
         OnGenerationComplete(this, gcEventArgs);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 40
0
        public override void Generate()
        {
            try
            {
                GenerateDatabaseInstallerCs();
                GenerateAzureCopy();
                GenerateInstallSettings();
                GenerateDatabaseInstallerDesignerCs();
                GenerateIdentifyDatabaseFormCs();
                GenerateIdentifyDatabaseFormDesigner();
                GenerateIdentifyDatabaseFormResx();
                GenerateInstallSettingsUICs();
                GenerateInstallSettingsUIResx();
                GenerateInstallSettingsUIDesigner();
                GenerateHistoryFormCs();
                GenerateHistoryFormResx();
                GenerateSqlServersCs();
                //GenerateArchiveReaderCs();
                GenerateXmlHelperCs();
                GenerateUpgradeInstaller();
                GenerateAzureCopyControlCs();
                GenerateAzureCopyControlDesigner();
                GenerateAzureCopyControlResx();

                GenerateSqlErrorCs();
                GenerateSqlErrorDesigner();
                GenerateSqlErrorResx();

                //Folder structure
                GenerateFolder1();
                GenerateFolder2();
                GenerateFolder3();
                GenerateFolder4();
                GenerateFolder5();
                GenerateFolder6();

                var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
                OnGenerationComplete(this, gcEventArgs);

                //_model.IncrementGeneratedVersion();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public override void Generate()
        {
            var template     = new ContextAuditExtenderTemplate(_model);
            var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;

            if (this.FileCount == 0)
            {
                var eventArgs = new ProjectItemDeletedEventArgs(RELATIVE_OUTPUT_LOCATION + template.FileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }
            else
            {
                ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                OnProjectItemGenerated(this, eventArgs);
                var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
                OnGenerationComplete(this, gcEventArgs);
            }
        }
    public override void Generate()
		{
			//If this is NOT a zero-touch install then there is no embedded SQL
			if (!_model.Database.AllowZeroTouch) return;
			foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
			{
				if (table.Generated)
				{
					ZeroInstallSQL_DeleteTemplate template = new ZeroInstallSQL_DeleteTemplate(_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);
    }
    public override void Generate()
		{
			foreach (Table table in (from x in _model.Database.Tables where x.Generated orderby x.Name select x))
			{
				if (table.Generated)
				{
					foreach (TableComponent component in table.ComponentList)
					{
						BusinessComponentLINQGeneratedTemplate template = new BusinessComponentLINQGeneratedTemplate(_model, component);
						string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
						ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
						OnProjectItemGenerated(this, eventArgs);
					}
				}
			}
			ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
			OnGenerationComplete(this, gcEventArgs);

    }
 public override void Generate()
 {
     try
     {
         GenerateDatabaseInstallerCs();
         GenerateDatabaseInstallerDesignerCs();
         GenerateIdentifyDatabaseFormCs();
         GenerateIdentifyDatabaseFormResx();
         GenerateSqlServersCs();
         GenerateArchiveReaderCs();
         GenerateUpgradeInstaller();
         ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
         OnGenerationComplete(this, gcEventArgs);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
		public override void Generate()
		{
			try
			{
				GenerateDatabaseInstallerCs();
				GenerateDatabaseInstallerDesignerCs();
				GenerateIdentifyDatabaseFormCs();
				GenerateIdentifyDatabaseFormResx();
				GenerateSqlServersCs();
				GenerateArchiveReaderCs();
				GenerateUpgradeInstaller();
				ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
				OnGenerationComplete(this, gcEventArgs);

			}
			catch (Exception ex)
			{				
				throw;
			}
		}
Esempio n. 46
0
        public override void Generate()
        {
            //Process views
            var sb = new StringBuilder();

            sb.AppendLine("--DO NOT MODIFY THIS FILE. IT IS ALWAYS OVERWRITTEN ON GENERATION.");
            sb.AppendLine();

            //Defined views
            var template = new ViewsTemplate(_model);

            sb.Append(template.FileContent);

            var eventArgs = new ProjectItemGeneratedEventArgs("Views.sql", sb.ToString(), ProjectName, this.PARENT_ITEM_NAME, ProjectItemType.Folder, this, true);

            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
Esempio n. 47
0
        public override void Generate()
        {
            foreach (var table in _model.Database.Tables.Where(x => x.Generated && (x.TypedTable != Models.TypedTableConstants.EnumOnly)).OrderBy(x => x.Name))
            {
                var    template     = new EntityExtenderTemplate(_model, table);
                string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var    eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                OnProjectItemGenerated(this, eventArgs);
            }

            //Process deleted items
            foreach (var name in _model.RemovedTables)
            {
                var fullFileName = RELATIVE_OUTPUT_LOCATION + string.Format("{0}.cs", name);
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
		public override void Generate()
		{
      try
      {
        foreach(CustomView view in _model.Database.CustomViews)
        {
          if(view.Generated)
          {
            DomainViewCollectionExtenderTemplate template = new DomainViewCollectionExtenderTemplate(_model, view);
            string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
            OnProjectItemGenerated(this, eventArgs);
          }
        }
        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch(Exception ex)
      {
        throw;
      }
    }
    public override void Generate()
		{
      try
      {				
				foreach (CustomStoredProcedure storedProcedure in _model.Database.CustomStoredProcedures.OrderBy(x => x.Name))
        {
          if(storedProcedure.Generated)
          {
            BusinessStoredProcedureGeneratedTemplate template = new BusinessStoredProcedureGeneratedTemplate(_model, storedProcedure);
            string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
            OnProjectItemGenerated(this, eventArgs);
          }
        }
        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch(Exception ex)
      {
        throw;
      }
    }
    public override void Generate()
		{
      try
      {
        foreach (CustomStoredProcedure storedProcedure in _model.Database.CustomStoredProcedures.OrderBy(x => x.Name))
        {
          if(storedProcedure.Generated)
          {
            DefinedStoredProcedureSelectCommandExtenderTemplate template = new DefinedStoredProcedureSelectCommandExtenderTemplate(_model, storedProcedure);
            string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
            OnProjectItemGenerated(this, eventArgs);
          }
        }
        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch(Exception ex)
      {
        throw;
      }
    }
 public override void Generate()
 {
     try
     {
         foreach (CustomStoredProcedure storedProcedure in _model.Database.CustomStoredProcedures.OrderBy(x => x.Name))
         {
             if (storedProcedure.Generated)
             {
                 DomainStoredProcedureCollectionExtenderTemplate template = new DomainStoredProcedureCollectionExtenderTemplate(_model, storedProcedure);
                 string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                 ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                 OnProjectItemGenerated(this, eventArgs);
             }
         }
         ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
         OnGenerationComplete(this, gcEventArgs);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 52
0
 public override void Generate()
 {
     try
     {
         foreach (CustomView view in _model.Database.CustomViews)
         {
             if (view.Generated)
             {
                 BusinessViewCollectionExtenderTemplate template = new BusinessViewCollectionExtenderTemplate(_model, view);
                 string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                 ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                 OnProjectItemGenerated(this, eventArgs);
             }
         }
         ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
         OnGenerationComplete(this, gcEventArgs);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 53
0
        public override void Generate()
        {
            foreach (var item in GetList())
            {
                var template       = new ActionTypesGeneratedTemplate(_model, item);
                var fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
                var eventArgs      = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
                OnProjectItemGenerated(this, eventArgs);
            }

            //Process deleted items
            foreach (var name in _model.RemovedStoredProcedures)
            {
                var fullFileName = RELATIVE_OUTPUT_LOCATION + string.Format("{0}.Generated.cs", name);
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
 public override void Generate()
 {
   try
   {
     foreach(CustomView view in _model.Database.CustomViews)
     {
       if(view.Generated)
       {
         DefinedViewSelectCommandGeneratedTemplate template = new DefinedViewSelectCommandGeneratedTemplate(_model, view);
         string fullParentName = RELATIVE_OUTPUT_LOCATION + template.ParentItemName;
         ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(template.FileName, template.FileContent, ProjectName, fullParentName, this, true);
         OnProjectItemGenerated(this, eventArgs);
       }
     }
     ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
     OnGenerationComplete(this, gcEventArgs);
   }
   catch(Exception ex)
   {
     throw;
   }
 }
Esempio n. 55
0
        public override void Generate()
        {
            foreach (var table in GetList())
            {
                var template     = new EntityPrimaryKeyExtenderTemplate(_model, table);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                OnProjectItemGenerated(this, eventArgs);
            }

            //Process deleted items
            foreach (var name in _model.RemovedTables)
            {
                var fullFileName = RELATIVE_OUTPUT_LOCATION + string.Format("{0}PrimaryKey.cs", name);
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
    public override void Generate()
		{
      return;
      try
      {
        foreach(CustomRetrieveRule rule in _model.Database.CustomRetrieveRules)
        {
          if(rule.Generated)
          {
            DefinedSelectCommandExtenderTemplate template = new DefinedSelectCommandExtenderTemplate(_model, rule);
            string fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
            OnProjectItemGenerated(this, eventArgs);
          }
        }
        ProjectItemGenerationCompleteEventArgs gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);
        OnGenerationComplete(this, gcEventArgs);
      }
      catch(Exception ex)
      {
        throw;
      }
    }
    public override void Generate()
		{
      try
      {
        foreach (CustomStoredProcedure storedProcedure in _model.Database.CustomStoredProcedures.OrderBy(x => x.Name))
        {
          if(storedProcedure.Generated)
          {
            SQLSelectStoredProcedureTemplate template = new SQLSelectStoredProcedureTemplate(_model, storedProcedure);
            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;
      }
    }