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()
		{
      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;
      }
    }
		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()
		{
			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()
		{
			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()
		{
			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()
		{
			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);

		}
		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);
		}
		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);
		}
    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);
		}
Beispiel #15
0
        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);
            }
        }
Beispiel #16
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()
		{
			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);
		}
        private void GenerateIdentifyDatabaseFormResx()
        {
            string fullParentName    = "IdentifyDatabaseForm.cs";
            string fileName          = "IdentifyDatabaseForm.resx";
            EmbeddedResourceName ern = new EmbeddedResourceName();

            ern.AsmLocation = EMBEDDED_LOCATION;
            ern.FileName    = fileName + ".embed";
            ern.FullName    = EMBEDDED_LOCATION + "." + ern.FileName;
            string fileContent = GetFileContent(ern);
            ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fileName, fileContent, ProjectName, fullParentName, this, true);

            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);
        }
		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()
        {
            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);
        }
Beispiel #21
0
        private void GenerateAzureCopyControlResx()
        {
            var fullParentName = "AzureCopyControl.cs";
            var fileName       = "AzureCopyControl.resx";
            var ern            = new EmbeddedResourceName();

            ern.AsmLocation = this.GetEmbeddedPath();
            ern.FileName    = fileName + ".embed";
            ern.FullName    = this.GetEmbeddedPath() + "." + ern.FileName;
            var fileContent = GetFileContent(ern);
            var eventArgs   = new ProjectItemGeneratedEventArgs(fileName, fileContent, ProjectName, fullParentName, this, true);

            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);
        }
    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()
		{
			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);
    }
Beispiel #24
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);
        }
Beispiel #25
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);
        }
Beispiel #26
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);
        }
Beispiel #27
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);
        }
Beispiel #28
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;
     }
 }
Beispiel #29
0
        private void GenerateFolder1()
        {
            var foldername = "1_UserDefinedInitialization";
            var fileName   = string.Empty;
            ProjectItemGeneratedEventArgs eventArgs = null;

            //Main folder Readme.txt
            fileName  = Path.Combine(foldername, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, GetTextFolder1ReadMe(), ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Create Always
            var folderAlways = Path.Combine(foldername, "Always");

            fileName  = Path.Combine(folderAlways, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will always run first in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Timestamp trigger in "Always"
            fileName  = Path.Combine(folderAlways, "Setup.sql");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, GetTimestampTrigger(), ProjectName, this, true);
            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(this, eventArgs);

            //New Database
            var folderNewDatabase = Path.Combine(foldername, "NewDatabase");

            fileName  = Path.Combine(folderNewDatabase, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will be run first on a database creation in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Unversioned
            var folderUnversioned = Path.Combine(foldername, "UnVersioned");

            fileName  = Path.Combine(folderUnversioned, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will be run first on an existing non-versioned database in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Versioned
            var folderVersioned = Path.Combine(foldername, "Versioned");

            fileName  = Path.Combine(folderVersioned, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will be run first on an existing versioned database in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);
        }
        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);

    }
Beispiel #33
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);
        }
        public override void Generate()
        {
            foreach (var table in _model.Database.Tables.Where(x => (x.TypedTable != Models.TypedTableConstants.EnumOnly)).OrderBy(x => x.Name))
            {
                var template       = new EntityGeneratedTemplate(_model, table);
                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.RemovedTables)
            {
                var fullFileName = RELATIVE_OUTPUT_LOCATION + $"{name}.Generated.cs";
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
        public override void Generate()
        {
            foreach (var table in GetList())
            {
                var template       = new EntityGeneratedTemplate(_model, table);
                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.RemovedTables)
            {
                var fullFileName = RELATIVE_OUTPUT_LOCATION + name + ".Generated.cs";
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
        private void GenerateFolder6()
        {
            var foldername = "6_UserDefinedFinalize";
            var fileName   = string.Empty;
            ProjectItemGeneratedEventArgs eventArgs = null;

            //Main folder Readme.txt
            fileName  = Path.Combine(foldername, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, GetTextFolder4ReadMe(), ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Create Always
            var folderAlways = Path.Combine(foldername, "Always");

            fileName  = Path.Combine(folderAlways, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will always run after all other scripts in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //New Database
            var folderNewDatabase = Path.Combine(foldername, "NewDatabase");

            fileName  = Path.Combine(folderNewDatabase, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will be run after all other scripts on a database creation in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Unversioned
            var folderUnversioned = Path.Combine(foldername, "UnVersioned");

            fileName  = Path.Combine(folderUnversioned, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will be run after all other scripts on an existing non-versioned database in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);

            //Versioned
            var folderVersioned = Path.Combine(foldername, "Versioned");

            fileName  = Path.Combine(folderVersioned, "ReadMe.txt");
            eventArgs = new ProjectItemGeneratedEventArgs(fileName, "Add scripts that will be run after all other scripts on an existing versioned database in this folder. Make them embedded resources and they will be run in alphabetical order.", ProjectName, this, true);
            OnProjectItemGenerated(this, eventArgs);
        }
        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()
 {
   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;
   }
 }
 public override void Generate()
 {
     try
     {
         foreach (CustomStoredProcedure storedProcedure in _model.Database.CustomStoredProcedures.OrderBy(x => x.Name))
         {
             if (storedProcedure.Generated)
             {
                 DefinedStoredProcedureSelectCommandGeneratedTemplate template = new DefinedStoredProcedureSelectCommandGeneratedTemplate(_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;
     }
 }
Beispiel #40
0
 public override void Generate()
 {
     try
     {
         foreach (Table table in _model.Database.Tables)
         {
             if (table.Generated)
             {
                 DomainObjectGeneratedTemplate template = new DomainObjectGeneratedTemplate(_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);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
		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;
      }
    }
Beispiel #42
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 (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;
      }
    }
Beispiel #44
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);
        }
Beispiel #45
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;
     }
 }
 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;
     }
 }
Beispiel #47
0
 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;
     }
 }
Beispiel #48
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()
		{
      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;
      }
    }
Beispiel #50
0
        public override void Generate()
        {
            foreach (var item in GetListSP())
            {
                var template     = new ComplexTypesSPExtenderTemplate(_model, item);
                var fullFileName = RELATIVE_OUTPUT_LOCATION + template.FileName;
                var eventArgs    = new ProjectItemGeneratedEventArgs(fullFileName, template.FileContent, ProjectName, this, false);
                OnProjectItemGenerated(this, eventArgs);
            }

            foreach (var item in GetListFunc())
            {
                var template     = new ComplexTypesFuncExtenderTemplate(_model, item);
                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.RemovedStoredProcedures)
            {
                var fullFileName = RELATIVE_OUTPUT_LOCATION + name + ".cs";
                var eventArgs    = new ProjectItemDeletedEventArgs(fullFileName, ProjectName, this);
                OnProjectItemDeleted(this, eventArgs);
            }

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

            var gcEventArgs = new ProjectItemGenerationCompleteEventArgs(this);

            OnGenerationComplete(this, gcEventArgs);
        }
    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;
      }
    }
Beispiel #52
0
 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;
     }
 }
    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;
      }
    }
Beispiel #54
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
            foreach (var view in _model.Database.CustomViews.OrderBy(x => x.Name))
            {
                var template = new ViewsTemplate(_model, view);
                sb.Append(template.FileContent);
            }

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

            eventArgs.Properties.Add("BuildAction", 3);
            OnProjectItemGenerated(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;
            }
        }
Beispiel #56
0
		public override void Generate()
		{
			EfDtoTemplate template = new EfDtoTemplate(_model);			
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs("", template.FileContent, ProjectName, this, true);
		}
		private void GenerateIdentifyDatabaseFormResx()
		{
			string fullParentName = "IdentifyDatabaseForm.cs";
			string fileName = "IdentifyDatabaseForm.resx";
			EmbeddedResourceName ern = new EmbeddedResourceName();
			ern.AsmLocation = EMBEDDED_LOCATION;
			ern.FileName = fileName + ".embed";
			ern.FullName = EMBEDDED_LOCATION + "." + ern.FileName;
			string fileContent = GetFileContent(ern);
      ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fileName, fileContent, ProjectName, fullParentName, this, true);
			eventArgs.Properties.Add("BuildAction", 3);
			OnProjectItemGenerated(this, eventArgs);
		}
		private void GenerateUpgradeInstaller()
		{
			string fileName = "UpgradeInstaller.cs";
			string fileContent = GetFileContent(new EmbeddedResourceName(EMBEDDED_LOCATION + "." + fileName));
			//TODO - Change the version for _upgradeToVersion and _previousVersion
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fileName, fileContent, ProjectName, this, true);
			OnProjectItemGenerated(this, eventArgs);
		}
 protected virtual void OnProjectItemGenerated(object sender, ProjectItemGeneratedEventArgs pigArgs)
 {
     ProjectItemGenerated?.Invoke(sender, pigArgs);
 }
		private void GenerateDatabaseInstallerCs()
		{
			string fileName = "DatabaseInstaller.cs";
			string fileContent = GetFileContent(new EmbeddedResourceName(EMBEDDED_LOCATION + "." + fileName));
			ProjectItemGeneratedEventArgs eventArgs = new ProjectItemGeneratedEventArgs(fileName, fileContent, ProjectName, this, true);
			OnProjectItemGenerated(this, eventArgs);
		}