Ejemplo n.º 1
0
        //protected new List<FlexNode> ChildList { get; set; }

        public FlexNode(FlexNode parentNode, FlexItem ffObject, EditableList <ActivityParameter> activityParameters, FFPresenterModel model)
            : base(parentNode, ffObject)
        {
            m_ActivityParameters = activityParameters;
            m_Model     = model;
            UseFullPath = false;
            idfRow      = -1;
        }
Ejemplo n.º 2
0
        public static FlexNodeReport CopyNode(FlexNodeReport parentNode, FlexNode nodeFF, EditableList <ActivityParameter> aps)
        {
            //We have to create two nodes for PrameterTemplate and ParameterDeletedFromTemplate
            FlexItem di1 = null;
            FlexItem di2 = null;

            if (nodeFF.DataItem != null)
            {
                var lo = nodeFF.DataItem.LinkedObject;

                if (lo is SectionTemplate)
                {
                    var st = (SectionTemplate)lo;
                    if (st.blnGrid)
                    {
                        di1 = new FlexTableItem(st);
                    }
                    else
                    {
                        di1 = new FlexLabelItem(st);
                    }
                }
                else if (lo is SectionDeletedFromTemplate)
                {
                    di1 = new FlexLabelItem((SectionDeletedFromTemplate)lo);
                }
                else if (lo is ParameterTemplate && aps != null)
                {
                    var pt = (ParameterTemplate)lo;
                    di1 = new FlexLabelItem(pt, false);
                    var needAp = true;
                    var st     = pt.ParentSection;
                    if (st != null && st.blnGrid)
                    {
                        needAp = false;
                    }
                    if (needAp)
                    {
                        var ap = aps.FirstOrDefault(c => c.idfsParameter == pt.idfsParameter);
                        if (ap != null)
                        {
                            di2 = new FlexLabelItem(pt, ap)
                            {
                                IsParameterValue = true
                            };
                            //di2.Left = di1.Width - pt.intLabelSize;
                        }
                    }
                }
                else if (lo is ParametersDeletedFromTemplate && aps != null)//String
                {
                    var pt = (ParametersDeletedFromTemplate)lo;
                    di1 = new FlexLabelItem(pt, false);
                    var ap = aps.FirstOrDefault(c => c.idfsParameter == pt.idfsParameter);
                    if (ap != null)
                    {
                        di2 = new FlexLabelItem(pt, ap)
                        {
                            IsParameterValue = true
                        }
                    }
                    ;
                }
                else if (lo is Label)
                {
                    di1 = new FlexLabelItem((Label)lo);
                }
                else if (lo is PredefinedStub)
                {
                    di1 = new FlexLabelItem(nodeFF.Text, new Size(nodeFF.Width, 0), lo);
                }
                else if (lo is String)
                {
                    di1 = new FlexLabelItem(nodeFF.DataItem.LinkedObject.ToString(), new Size(nodeFF.Width, 0), lo);
                }
            }

            var nodeReport = new FlexNodeReport(parentNode, di1);

            parentNode.Add(nodeReport);
            if (di2 != null)
            {
                var nodeReport2 = new FlexNodeReport(parentNode, di2);
                parentNode.Add(nodeReport2);
            }

            foreach (var nd in nodeFF.ChildList)
            {
                CopyNode(nodeReport, (FlexNode)nd, aps);
            }

            return(nodeReport);
        }