Beispiel #1
0
        public virtual ISpectraContainer AddSpectraContainer(string containerXmlFilePath)
        {
            Assembly     ass          = Assembly.GetAssembly(this.GetSpectraContainerType());
            string       typeName     = this.GetSpectraContainerType().ToString();
            BindingFlags bindingFlags = BindingFlags.CreateInstance;

            object[]             args      = new object[] { this, containerXmlFilePath };
            SpectraContainerBase container = (SpectraContainerBase)ass.CreateInstance(typeName, true, bindingFlags, null, args, null, null);

            if (container != null)
            {
                AddSpectraContainer(container);
            }
            return(container);
        }
Beispiel #2
0
 public ProjectBase(string caption, SpectraContainerDescription[] descriptions)
     : this()
 {
     this._caption = caption;
     foreach (SpectraContainerDescription desc in descriptions)
     {
         Assembly             ass          = Assembly.GetAssembly(this.GetSpectraContainerType());
         string               typeName     = this.GetSpectraContainerType().ToString();
         BindingFlags         bindingFlags = BindingFlags.CreateInstance;
         object[]             args         = new object[] { this, desc.name, desc.model, desc.spectraPaths, desc.groupsDefinition };
         SpectraContainerBase container    = (SpectraContainerBase)ass.CreateInstance(typeName, true, bindingFlags, null, args, null, null);
         if (container != null)
         {
             AddSpectraContainer(container);
         }
     }
 }