Click here to Skip to main content
15,884,298 members

Comments by Frederic GIRARDIN (Top 14 by date)

Frederic GIRARDIN 27-Apr-18 3:51am View    
Sorry i'm program in VB. So i add you detail with VB language

NameSpace MyFileExtention
 Namespace IFCX
  Class BL_IFCX
   inherits businessLayer
   'entry point to manage IFCX data
   private _IMPORT_ELEMENTS as IMPORT_ELEMENTS

   Public sub new(aIFCXFile as string)
      mybase.new(aIFCXFile) ' => mybase.File = aIFCXFile : _datalayer = new datalayer(_file)
   End sub

   Public sub Load()
    _IMPORT_ELEMENTS = new IMPORT_ELEMENTS(Datalayer)
   End sub
  End Class

  Class IMPORT_ELEMENT
   'Item Class
    private ROW as datarow
    Public sub new(_row as datarow)
     ROW = _row
    end sub

   Property #PropertyName# as #PropertyType#
    get
      return ROW(#PropertyColumnNameMapped#)
    end get
    set (value as #propertyType#)
     ROW(#PropertyColumnNameMapped#) = Value
    end set
   end property
  END Class

  Class IMPORT_ELEMENTS
    inherits List(of IMPORT_ELEMENT
   'List Class
   private _datalayer as datalayer
   Public sub new(aDataLayer as datalayer)
    _datalayer = adatalayer
   end sub

   public sub load()
    'classic datatable/datarow loading
    dim dt as datatable = _datalayer.loadTable("IMPORT_ELEMENTS") ' => adapter.fill(...)
    for each _row in dt.rows
     me.add(new IMPORT_ELEMENT(_row)
    next
  End class
 End NameSpace

 NameSpace ESTX
  Class BL_ESTX
   inherits BusinessLayer
   'Class to manage ESTX Data
   private withevents _BL_IFCX AS IFCX.BL_IFCX
   private _ASSIGNATIONS
   private _IFCX_File as string

  Public sub new(aESTXFile as string)
   Mybase.new(aESTXFile) ' => mybase.File = aESTXFile : mybase.dataLayer = new datalayer(aESTXFile)
  end sub

  Public sub Load()
   'load properties ' => datalayer.loadTable("PROPERTIES")
   'check for property IFCX_File to set or not inner class property that run or not BL_IFCX load process
   _ESTX_ITEMS = new ESTX_ITEMS(Datalayer)
   _ASSIGNATIONS = New ASSIGNATION(Datalayer)
  end sub

  Public property IFCX_File as string
   get
    return _IFCX_File 
   end get
   set(value as string)
    If value<>"" and system.io.path.exist(value) then
       _IFCX_File = value
       _BL_IFCX = new IFCX.BL_IFCX(_IFCX_File)
       _BL_IFCX.load()
    End if
   end set
  end property

  private Readonly Property BL_IFCX as IFCX.BL_IFCX
   get
    return _BL_IFCX
   end get
  end property

  Public readonly property IMPORT_ELEMENTS as IFCX.IMPORT_ELEMENTS
   get
    Return _BL_IFCX?.IMPORT_ELEMENTS
   end get
  End property
  End Class

  Public Class ASSIGNATION
   ' relation between ESTX_ITEM and IFCX.IMPORT_ELEMENTS
   '...
   property ESTX_ITEM_ID as integer
    get
     return ROW("ESTX_ITEM_ID")
    get end
    set (value as integer)
     ROW("ESTX_ITEM_ID") = Value
     _ESTX_ITEM = Nothing
    end set
   end property

   Property IFCX_ITEM_ID as integer
    get
     return ROW("IFCX_ITEM_ID")
    end get
    set (value as integer)
     ROW("IFCX_ITEM_ID") = value
     _IFCX_ITEM = nothing
    end set
   end property
  End Class

  readonly Property ESTX_ITEM as ESTX_ITEM
   get
    if _ESTX_ITEM is nothing then
     raiseevent Ask_ESTX_ITEM(ESTX_ITEM_ID, _ESTX_ITEM)
    end if
    return _ESTX_ITEM 
   end get
  end property

  readonly Property IFCX_ITEM as IFCX.IMPORT_ELEMENT
   get
    if _IFCX_ITEM is nothing then
     raiseevent Ask_IFCX_ITEM(IFCX_ITEM_ID, _IFCX_ITEM)
    end if
    return _IFCX_ITEM 
   end get
  end property

  Public Class ASSIGNATIONS
   inherits list(of ASSIGNATION)
  End class

  Public Class ESTX_ITEM
   'exist without IFCX_IMPORTELEMENT

   Public readonly property ASSIGNATIONS as List(of ASSIGNATION)
    get
     dim _list as List(of ASSIGNATION)
     raisevent Ask_ASSIGGNATION(ID, _list)
     return _list
    end get
   end property
  End Class

  Public Class ESTX_ITEMS
   inherits list(of ESTX_ITEM)
  End Class

 End NameSp
Frederic GIRARDIN 26-Apr-18 12:03pm View    
may you can give more detail or a sample ?
Frederic GIRARDIN 26-Apr-18 9:42am View    
But in fact this kind of wrote seems to work only with VS IDE, so component inherits items.
Frederic GIRARDIN 26-Apr-18 9:06am View    
Frederic GIRARDIN 26-Apr-18 8:37am View    
Yes, I am the author of both DLLs. Each DLL represents a file extension; which means that each contains the treatment modalities proper to its content.
An ESTX file can have a reference to IFCX content. IFCX objects are custom objects that represent the extraction of an IFC file. A kind of alternative data format. These objects have an IFCX-compliant meaning, but once an ESTX references an IFCX file, it becomes its objects. The only solution I have found for the moment disappoints me! Create both a new class of <inherited element> from IFCX.element class to add functionality to my objects, but also a new class list <inherited elements>. I am therefore forced to monitor the changes in the IFCX list to reproduce them in ESTX. It's heavy and I'm convinced that there is another way to go about it ...