Ejemplo n.º 1
0
 private void CreatePropertyView(JsonProperty jsonProperty)
 {
     try
     {
         mListProperties.Clear();
         if (jsonProperty != null && jsonProperty.GetValue() != null)
         {
             var lics = jsonProperty;
             for (int i = 0; i < lics.Count; i++)
             {
                 var     lic     = lics[i];
                 License license = new License();
                 license.SerialNo   = (long)lic[LicDefines.KEYWORD_MSG_LICENSE_LICENSEID].Number;
                 license.Name       = lic[LicDefines.KEYWORD_MSG_LICENSE_DISPLAY].Value;
                 license.Expiration = lic[LicDefines.KEYWORD_MSG_LICENSE_EXPIRATION].Value;
                 license.MajorID    =
                     (int)lic[LicDefines.KEYWORD_MSG_LICENSE_MODULEMARJORTYPEID].Number;
                 license.MinorID =
                     (int)lic[LicDefines.KEYWORD_MSG_LICENSE_MODULEMINJORTYPEID].Number;
                 license.Type =
                     (LicOwnerType)
                     (int)lic[LicDefines.KEYWORD_MSG_LICENSE_OWNERTYPE].Number;
                 license.Value    = lic[LicDefines.KEYWORD_MSG_LICENSE_VALUE].Value;
                 license.DataType =
                     (LicDataType)(int)lic[LicDefines.KEYWORD_MSG_LICENSE_VALUETYPE].Number;
                 PropertyViewItem propItem = new PropertyViewItem();
                 propItem.Name       = license.Name;
                 propItem.SerialNo   = license.SerialNo.ToString();
                 propItem.LicType    = license.Type == LicOwnerType.Mono ? "Mono" : "Share";
                 propItem.Catetory   = propItem.LicType;
                 propItem.Expiration = license.Expiration;
                 propItem.Value      = license.Value;
                 propItem.MajorID    = license.MajorID.ToString();
                 propItem.MinorID    = license.MinorID.ToString();
                 propItem.Data       = license;
                 mListProperties.Add(propItem);
             }
         }
     }
     catch (Exception ex)
     {
         ShowErrorMessage(ex.Message);
     }
 }