Exemplo n.º 1
0
        private static string getExtensionPropertiesAsString(BIMElement paramBIMElement, bool paramBoolean)
        {
            System.Collections.IEnumerator iterator = paramBIMElement.ExtensionProperties.GetEnumerator();
            StringBuilder stringBuffer = new StringBuilder();

            stringBuffer.Append("\n");
            while (iterator.MoveNext())
            {
                BIMPropertySet bIMPropertySet = (BIMPropertySet)iterator.Current;
                string         str            = bIMPropertySet.Name;
                stringBuffer.Append("\n" + str + ":\n");
                System.Collections.IEnumerator iterator1 = bIMPropertySet.Properties.GetEnumerator();
                while (iterator1.MoveNext())
                {
                    BIMProperty bIMProperty = (BIMProperty)iterator1.Current;
                    if (bIMProperty.Number)
                    {
                        continue;
                    }
                    stringBuffer.Append(bIMProperty.Name + ": " + bIMProperty.Value);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                    if (iterator1.hasNext())
                    {
                        stringBuffer.Append(", ");
                    }
                }
            }
            return(stringBuffer.ToString());
        }
Exemplo n.º 2
0
 private void cacheElementQuantites(Session paramSession, int?paramInteger, int paramInt, bool paramBoolean)
 {
     if (!paramBoolean)
     {
         this.quantsDataMap = new Hashtable();
     }
     System.Collections.IList list = paramSession.createSQLQuery(this.elemQuantitySQL).addScalar("elemId", LongType.INSTANCE).addScalar("propId", LongType.INSTANCE).addScalar("groupName", StringType.INSTANCE).addScalar("name", StringType.INSTANCE).addScalar("value", BigDecimalType.INSTANCE).addScalar("qtyType", IntegerType.INSTANCE).addScalar("nameId", IntegerType.INSTANCE).setInteger("typeId", paramInteger.Value).setLong("modelId", this.modelId.Value).list();
     foreach (object[] arrayOfObject in list)
     {
         long?   long1      = (long?)arrayOfObject[0];
         long?   long2      = (long?)arrayOfObject[1];
         string  str1       = (string)arrayOfObject[2];
         string  str2       = (string)arrayOfObject[3];
         decimal bigDecimal = (decimal)arrayOfObject[4];
         int?    integer1   = (int?)arrayOfObject[5];
         int?    integer2   = (int?)arrayOfObject[6];
         if (paramBoolean)
         {
             BIMProperty bIMProperty = new BIMProperty();
             bIMProperty.DoubleValue = bigDecimal.doubleValue();
             bIMProperty.Number      = true;
             bIMProperty.Value       = "";
             bIMProperty.Name        = str2;
             IfcEnginePropertiesData ifcEnginePropertiesData = (IfcEnginePropertiesData)this.propsDataMap[long1];
             if (ifcEnginePropertiesData == null)
             {
                 ifcEnginePropertiesData             = new IfcEnginePropertiesData();
                 ifcEnginePropertiesData.PropSetList = new LinkedList();
                 this.propsDataMap[long1]            = ifcEnginePropertiesData;
             }
             BIMPropertySet bIMPropertySet = ifcEnginePropertiesData.findProperySet(str1);
             if (bIMPropertySet == null)
             {
                 bIMPropertySet            = new BIMPropertySet();
                 bIMPropertySet.Name       = str1;
                 bIMPropertySet.Properties = new LinkedList();
                 ifcEnginePropertiesData.PropSetList.Add(bIMPropertySet);
             }
             bIMPropertySet.Properties.add(bIMProperty);
         }
         else
         {
             IfcEngineQuantitiesData ifcEngineQuantitiesData = (IfcEngineQuantitiesData)this.quantsDataMap[long1];
             if (ifcEngineQuantitiesData == null)
             {
                 ifcEngineQuantitiesData   = new IfcEngineQuantitiesData();
                 this.quantsDataMap[long1] = ifcEngineQuantitiesData;
             }
             ifcEngineQuantitiesData.setQuantity(BIMQTOType.values()[integer2.Value], Convert.ToDouble(bigDecimal.doubleValue()));
         }
         this.progress.incrementProgress(1);
     }
 }
Exemplo n.º 3
0
 public virtual void cacheElementProperties(Session paramSession, int?paramInteger, int paramInt, bool paramBoolean)
 {
     if (paramInt == -1)
     {
         this.propsDataMap = new Hashtable();
     }
     else
     {
         this.propsDataMap = new Hashtable(paramInt);
     }
     System.Collections.IList list = paramSession.createSQLQuery(this.elemPropertySQL).addScalar("elemId", LongType.INSTANCE).addScalar("propId", LongType.INSTANCE).addScalar("groupName", StringType.INSTANCE).addScalar("name", StringType.INSTANCE).addScalar("isNumber", BooleanType.INSTANCE).addScalar("numberValue", BigDecimalType.INSTANCE).addScalar("textValue", StringType.INSTANCE).addScalar("qtyType", IntegerType.INSTANCE).setInteger("typeId", paramInteger.Value).setLong("modelId", this.modelId.Value).list();
     foreach (object[] arrayOfObject in list)
     {
         long?       long1       = (long?)arrayOfObject[0];
         long?       long2       = (long?)arrayOfObject[1];
         string      str1        = (string)arrayOfObject[2];
         string      str2        = (string)arrayOfObject[3];
         bool?       @bool       = (bool?)arrayOfObject[4];
         decimal     bigDecimal  = (decimal)arrayOfObject[5];
         string      str3        = (string)arrayOfObject[6];
         int?        integer     = (int?)arrayOfObject[7];
         BIMProperty bIMProperty = new BIMProperty();
         bIMProperty.DoubleValue = bigDecimal.doubleValue();
         bIMProperty.Number      = @bool.Value;
         bIMProperty.Value       = str3;
         bIMProperty.Name        = str2;
         IfcEnginePropertiesData ifcEnginePropertiesData = (IfcEnginePropertiesData)this.propsDataMap[long1];
         if (ifcEnginePropertiesData == null)
         {
             ifcEnginePropertiesData             = new IfcEnginePropertiesData();
             ifcEnginePropertiesData.PropSetList = new LinkedList();
             this.propsDataMap[long1]            = ifcEnginePropertiesData;
         }
         if (StringUtils.isNullOrBlank(str1))
         {
             str1 = "Misc";
         }
         BIMPropertySet bIMPropertySet = ifcEnginePropertiesData.findProperySet(str1);
         if (bIMPropertySet == null)
         {
             bIMPropertySet            = new BIMPropertySet();
             bIMPropertySet.Name       = str1;
             bIMPropertySet.Properties = new LinkedList();
             ifcEnginePropertiesData.PropSetList.Add(bIMPropertySet);
         }
         bIMPropertySet.Properties.add(bIMProperty);
         this.progress.incrementProgress(1);
     }
     cacheElementQuantites(paramSession, paramInteger, paramInt, paramBoolean);
 }