Esempio n. 1
0
 public void Update(Constellation.Constellation constellation)
 {
     foreach (var node in constellation.GetNodes())
     {
         foreach (var nodeData in NodeEditorNodes.GetNodes())
         {
             if (node.Guid == nodeData.node.Guid)
             {
                 for (var i = 0; i < node.GetAttributes().Length; i++)
                 {
                     if (!nodeData.IsAttributeValueChanged())
                     {
                         nodeData.GetData().AttributesData[i].Value.Set(node.GetAttributes() [i].Value.GetString());
                         if (node.NodeType is IAttributeUpdate)
                         {
                             IAttributeUpdate needAttributeUpdate = node.NodeType as IAttributeUpdate;
                             needAttributeUpdate.OnAttributesUpdate();
                         }
                     }
                     else
                     {
                         if (isInstance)
                         {
                             constellationScript.IsDifferentThanSource = true;
                         }
                         node.GetAttributes() [i].Value.Set(nodeData.GetData().AttributesData[i].Value);
                         node.NodeType.Receive(nodeData.GetData().AttributesData[i].Value, new Constellation.Input("0000-0000-0000-0000", 999, true, "editor", "none"));
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
 private void  AddDetail(ILogDetail logDetail)
 {
     if (logDetail is IAttributeUpdate)
     {
         IAttributeUpdate attributeUpdate = (IAttributeUpdate)logDetail;
         AddDetail("Attribute update", "[" + attributeUpdate.Attribute.Name + "]</b> to <b>[" + attributeUpdate.GetValue() + "]");
     }
     else if (logDetail is IMessage)
     {
         IMessage message = (IMessage)logDetail;
         AddDetail("Message", message.MessageText);
     }
     else if (logDetail is IDelegateCall)
     {
         IDelegateCall delegateCall = (IDelegateCall)logDetail;
         // FIXME: why this could be null?
         if (delegateCall.GetInterface() != null)
         {
             AddDetail("Action handler", delegateCall.GetInterface().FullName);
         }
     }
     else if (logDetail is IExceptionReport)
     {
         IExceptionReport exceptionReport = (IExceptionReport)logDetail;
         AddDetail("<font color=red>Exception</font>", "<font color=red>" + exceptionReport.ExceptionMessage + "</font>");
     }
     else if (logDetail is IObjectReference)
     {
         IObjectReference objectReference = (IObjectReference)logDetail;
         System.Object    object_Renamed  = objectReference.GetObject();
         if (object_Renamed is IActivityState)
         {
             IActivityState activityState = (IActivityState)object_Renamed;
             AddDetail("Activitystate", activityState.Name);
         }
         else
         {
             log.Warn("unknown object reference type : " + object_Renamed);
         }
     }
     else
     {
         log.Warn("unknown log-detail type : " + logDetail);
     }
 }