Class: CapicuaGen::Gaspar::CSAboutWindowsFormFeature

Inherits:
TemplateFeature
  • Object
show all
Includes:
CapicuaGen
Defined in:
lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb

Overview

Clase generadora de una ventada “Acerca de …”

Instance Method Summary collapse

Constructor Details

#initialize(values = {}) ⇒ CSAboutWindowsFormFeature

Inicializa la caracteristica



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb', line 37

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

  # Configuro los tipos si estos no han sido configurados previamente

   self.types= [:gui, :about_form] if self.types.blank?
  

  # Configuro los templates

  set_template('aboutForm', Template.new(:file=>'aboutForm.erb'))
  set_template('aboutForm.designer', Template.new(:file=>'aboutForm.Designer.erb'))
  set_template('aboutForm.resx', Template.new(:file=>'aboutForm.resx.erb'))


end

Instance Method Details

#configure_attributesObject

Configura los atributos personalizados de la caracteristica (antes de establecer el generador)



59
60
61
62
# File 'lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb', line 59

def configure_attributes()
  self.generation_attributes[:out_dir]= "#{self.generation_attributes[:out_dir]}/#{self.generation_attributes[:namespace]}/Windows.Forms" unless self.generation_attributes.has_in_self?(:out_dir)
  self.generation_attributes[:namespace]= "#{self.generation_attributes[:namespace]}.Windows.Forms" unless self.generation_attributes.has_in_self?(:namespace)
end

#configure_template_targetsObject

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



65
66
67
68
69
70
71
72
73
# File 'lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb', line 65

def configure_template_targets


  # Configuro los templates

  set_template_target('aboutForm', TemplateTarget.new(:out_file=>"#{get_class_name}.cs", :types=>:proyect_file, :class_name=>get_class_name))
  set_template_target('aboutForm.designer', TemplateTarget.new(:out_file=>"#{get_class_name}.Designer.cs", :types=>:proyect_file, :class_name=>get_class_name))
  set_template_target('aboutForm.resx', TemplateTarget.new(:out_file=>"#{get_class_name}.resx", :types=>:proyect_file, :class_name=>get_class_name))

end

#get_class_full_nameObject



79
80
81
# File 'lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb', line 79

def get_class_full_name
  return "#{self.generation_attributes[:namespace]}.#{get_class_name}"
end

#get_class_nameObject



75
76
77
# File 'lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb', line 75

def get_class_name
  return "AboutForm"
end

#reset_attributesObject

Resetea los atributos personalizados de la caracteristica (antes de establecer el generador)



53
54
55
56
# File 'lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb', line 53

def reset_attributes
  self.generation_attributes[:out_dir]= nil
  self.generation_attributes[:namespace]= nil
end