Beispiel #1
0
 private static void LoadUserProperties(DataElement container, PropertiesContainer properties)
 {
   IDictionary<string, IProperty> propertiesMap = properties.UserProperties;
   foreach(DataElement element in container.CollectChildren("property"))
   {
     string name = element.GetAttribValue("name");
     IProperty property;
     if(propertiesMap.TryGetValue(name, out property))
     {
       string valueStr = element.GetAttribValue("value");
       string errorStr = property.TrySetValue(valueStr);
       if(errorStr != null)
       {
         throw new InvalidDataException();
       }
     }
   }
 }
Beispiel #2
0
 private static void SaveUserProperties(DataElement container, PropertiesContainer properties)
 {
   foreach(KeyValuePair<string, IProperty> kvp in properties.UserProperties)
   {
     DataElement element = container.CreateChild("property");
     element.CreateAttribute("name", kvp.Key);
     element.CreateAttribute("value", kvp.Value.ToString());
   }
 }
Beispiel #3
0
 private void OnOwnerRenamed(PropertiesContainer sender, string previous)
 {
   base.TrySetValue(sender.Name);
 }
Beispiel #4
0
 private void OnOwnerSizeChanged(PropertiesContainer sender, Vector2f previous)
 {
   base.TrySetValue(m_Owner.Size.ToString());
 }
Beispiel #5
0
 private void OnSceneNameChanged(PropertiesContainer sender, string previous)
 {
   UpdateShapeRefPath();
 }
 private void OnObjectRenamed(PropertiesContainer sender, string previous)
 {
   foreach(TreeNodeEx node in this.ProjectNode.AllNodes)
   {
     if(node.Tag == sender)
     {
       node.Text = sender.Name;
     }
   }
 }