Наследование: IBinarySerializable
Пример #1
0
 /// <summary>
 /// Adds a model group to the model object. The model group must be listed in the root object,
 /// or it won't be accepted by the model.
 /// </summary>
 /// <param name="modelGroup">Model group.</param>
 public void AddModelGroup(ModelGroup modelGroup)
 {
     if (ContainsGroup(modelGroup))
     {
         modelGroup.Name = ResolveInternalGroupName(modelGroup);
         modelGroup.DescriptiveName = ResolveInternalDescriptiveGroupName(modelGroup);
         this.Groups.Add(modelGroup);
     }
 }
Пример #2
0
        public string GetInternalGroupName(ModelGroup modelGroup)
        {
            int internalNameOffset = (int) modelGroup.GetInternalNameOffset();
            if (this.GroupNames.ContainsKey(internalNameOffset))
            {
                return this.GroupNames[internalNameOffset];
            }

            return null;
        }
Пример #3
0
 public string GetInternalGroupName(ModelGroup modelGroup)
 {
     return this.GroupNames.GetInternalGroupName(modelGroup);
 }
Пример #4
0
        public bool ContainsGroup(ModelGroup modelGroup)
        {
            bool containsGroupName = this.GroupNames.GroupNames.Count(kvp => kvp.Key == modelGroup.GetInternalNameOffset()) > 0;
            bool containsDescriptiveGroupName = this.GroupNames.GroupNames.Count(kvp => kvp.Key == modelGroup.GetInternalDescriptiveNameOffset()) > 0;

            // sometimes, model groups don't contain a descriptive name.
            if (modelGroup.GetInternalDescriptiveNameOffset() > 0)
            {
                return containsGroupName && containsDescriptiveGroupName;
            }

            return containsGroupName;
        }
Пример #5
0
 public bool ContainsGroup(ModelGroup modelGroup)
 {
     return this.RootInformation.ContainsGroup(modelGroup);
 }
Пример #6
0
 /// <summary>
 /// Adds a model group to the model object. The model group must be listed in the root object,
 /// or it won't be accepted by the model.
 /// </summary>
 /// <param name="inData">Byte array containing the model group.</param>
 public void AddModelGroup(byte[] inData)
 {
     ModelGroup group = new ModelGroup(inData);
     AddModelGroup(group);
 }
Пример #7
0
 private string ResolveInternalDescriptiveGroupName(ModelGroup modelGroup)
 {
     return this.RootInformation.GetInternalDescriptiveGroupName(modelGroup);
 }
Пример #8
0
 public string ResolveInternalGroupName(ModelGroup modelGroup)
 {
     return this.RootInformation.GetInternalGroupName(modelGroup);
 }