Class: CapicuaGen::Gaspar::CSProyectWindowsFormFeature

Inherits:
CSProyectFeature
  • Object
show all
Includes:
CapicuaGen, CapicuaGen::Gaspar
Defined in:
lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Source/cs_proyect_windows_form_feature.rb

Overview

Caracteristica generador de proyectos de Windows Form.

Instance Method Summary collapse

Methods included from CapicuaGen::Gaspar

#get_about_class_full_name, #get_about_class_name, #get_db_connection_name_method, #get_db_connection_provider_method, #get_db_connection_string_method, #get_entity_by_catalog_name, #get_entity_catalogs_full_name, #get_entity_catalogs_name, #get_entity_data_access_full_name, #get_entity_data_access_name, #get_entity_full_name, #get_entity_interface_full_name, #get_entity_interface_name, #get_entity_name, #get_main_form_class_full_name, #get_main_form_class_name, #get_namespaces, #get_namespaces_text, #get_splash_class_full_name, #get_splash_class_name

Methods inherited from CSProyectFeature

#configure_attributes, #get_proyect_files, #get_type, #reset_attributes

Constructor Details

#initialize(values = {}) ⇒ CSProyectWindowsFormFeature

Inicializa la caracteristica



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Source/cs_proyect_windows_form_feature.rb', line 42

def initialize(values= {})
  super(values)

  # Configuro los tipos si estos no han sido configurados previamente

  self.types= [:proyect, :soluction, :app_config] if self.types.blank?

  # Configuro los templates

  set_template('soluction', Template.new(:file => 'Soluction.erb'))
  set_template('proyect', Template.new(:file => 'Proyect.erb'))
  set_template('app.config', Template.new(:file => 'App.erb'))
  set_template('assemblyInfo', Template.new(:file => 'AssemblyInfo.erb'))
  set_template('program', Template.new(:file => 'Program.erb'))
  set_template('excepcion_controlada', Template.new(:file => 'ExcepcionControlada.erb'))
  set_template('control_excepciones', Template.new(:file => 'ControlExcepciones.erb'))

  # Configuro los Guid de la solucion

  self.generation_attributes[:soluction_guid]= UUIDTools::UUID.random_create.to_s.upcase
  self.generation_attributes[:project_guid]  = UUIDTools::UUID.random_create.to_s.upcase


end

Instance Method Details

#configure_template_targetsObject

Configura los objetivos de las platillas (despues de establecer el generador)



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Source/cs_proyect_windows_form_feature.rb', line 65

def configure_template_targets

  # Configuro los templates

  set_template_target('soluction', TemplateTarget.new(:out_file => "../#{@generator.generation_attributes[:namespace]}.sln", :types => :soluction))
  set_template_target('proyect', TemplateTarget.new(:out_file => "#{@generator.generation_attributes[:namespace]}.csproj", :types => :proyect))
  set_template_target('app.config', TemplateTarget.new(:out_file => "App.Config", :types => :proyect_file))
  set_template_target('assemblyInfo', TemplateTarget.new(:out_file => 'Properties/AssemblyInfo.cs', :types => :proyect_file))
  set_template_target('program', TemplateTarget.new(:out_file => "Program.cs", :types => :proyect_file))
  set_template_target('excepcion_controlada', TemplateTarget.new(:out_file => "ExcepcionControlada.cs", :types => :proyect_file))
  set_template_target('control_excepciones', TemplateTarget.new(:out_file => "ControlExcepciones.cs", :types => :proyect_file))

end

#get_app_config_fileObject

Devuelve la localizacion del archivo app.config



79
80
81
# File 'lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Source/cs_proyect_windows_form_feature.rb', line 79

def get_app_config_file
  return File.join(generation_attributes[:out_dir], get_template_target_by_name('app.config').out_file)
end