Ejemplo n.º 1
0
 internal void Connect(FlowSourceObjectBase src, FlowSourceObjectBase dest, FlowInfo flowInfo)
 {
     try
     {
         string actualSrcName  = flowInfo.SrcName;
         string actualDestName = flowInfo.DestName;
         if (src.outProperty.ContainsKey(flowInfo.SrcName) || src.replacedOutPropertyNames.TryGetValue(flowInfo.SrcName, out actualSrcName))
         {
             //property
             var flowObject = new FlowObject
             {
                 Source             = src,
                 Dest               = dest,
                 SourcePropertyName = actualSrcName,
                 SourceType         = src.outProperty[actualSrcName].MemberInfo.PropertyType,
                 DestPropertyName   = flowInfo.DestName
             };
             dest.ConnectProperty(flowObject, out actualDestName);
             flowObject.DestPropertyName = actualDestName;
             flowObject.DestType         = dest.inProperty[actualDestName].MemberInfo.PropertyType;
         }
         else
         {
             //event
             ConnectMethod(flowInfo.SrcName, dest, flowInfo.DestName, out actualSrcName, out actualDestName);
         }
         src.outIsConnected[actualSrcName]  = true;
         dest.inIsConnected[actualDestName] = true;
     }
     catch (Exception e)
     {
         throw new ConnectErrorException(e, src.Name, dest.Name, flowInfo.SrcName, flowInfo.DestName);
     }
 }
Ejemplo n.º 2
0
        private void ConnectProperty(FlowObject flow, out string actualDestName)
        {
            actualDestName = flow.DestPropertyName;
            if (!inProperty.ContainsKey(flow.DestPropertyName) && !replacedInPropertyNames.TryGetValue(flow.DestPropertyName, out actualDestName))
            {
                return;
            }
            if (inFlowList.ContainsKey(actualDestName))
            {
                //disconnect current
                // error
                throw new Exception("error in connection");

                /*InFlowList[flow.DestPropertyName].DisConnect();
                 * InFlowList.Add(flow.DestPropertyName, flow);*/
            }
            else
            {
                inFlowList.Add(actualDestName, flow);
            }
        }