Example #1
0
 protected override void InitializeLinkControl(ConstructionParams csParam)
 {
     mInLinkHandle  = LinkInHandle;
     mOutLinkHandle = LinkOutHandle;
     AddLinkPinInfo("InLinkHandle", mInLinkHandle, null);
     AddLinkPinInfo("OutLinkHandle", mOutLinkHandle, null);
     base.InitializeLinkControl(csParam);
 }
Example #2
0
        public LinkNodeTransitionCrossfadeShow(ConstructionParams csParams, LAGraphNodeControl graphNodeControl, Guid transitionID) : base(csParams)
        {
            LAGraphNodeControl = graphNodeControl;
            TransitionID       = transitionID;

            PerformanceFirst = LAGraphNodeControl.TransitionCrossfadeDic[transitionID].PerformanceFirst;
            FadeTime         = LAGraphNodeControl.TransitionCrossfadeDic[transitionID].FadeTime;
        }
Example #3
0
 public TransitionCrossfadeShow(ConstructionParams csParams, LATransitionNodeControl transitionNodeControl, Guid transitionID) : base(csParams)
 {
     LATransitionNodeControl = transitionNodeControl;
     TransitionID            = transitionID;
     Start                = LATransitionNodeControl.Start;
     Duration             = LATransitionNodeControl.Duration;
     TransitionWhenFinish = LATransitionNodeControl.TransitionWhenFinish;
     PerformanceFirst     = LATransitionNodeControl.TransitionCrossfadeDic[transitionID].PerformanceFirst;
     FadeTime             = LATransitionNodeControl.TransitionCrossfadeDic[transitionID].FadeTime;
 }
Example #4
0
        public CodeGenerateSystem.Base.BaseNodeControl AddOrigionNode(Type nodeType, ConstructionParams csParams, double x, double y)
        {
            mIgnoreDirtySet = true;

            var ctrl = AddNodeControl(nodeType, csParams, x, y);

            ctrl.IsDeleteable = false;

            OrigionNodeControls.Add(ctrl);

            ContainLinkNodes = mCtrlNodeList.Count != OrigionNodeControls.Count;

            mIgnoreDirtySet = false;

            return(ctrl);
        }
        public void RenameAnimGraphMacrossNodeName(ConstructionParams cp, Type nodeType)
        {
            var animMac = cp as AnimMacrossConstructionParams;

            if (animMac != null)
            {
                foreach (var node in mCtrlNodeList)
                {
                    if (node.GetType() == nodeType)
                    {
                        if (node.NodeName == animMac.NodeName)
                        {
                            animMac.NodeName += "_Suffix";
                            //check new name has the same or not
                            RenameAnimGraphMacrossNodeName(cp, nodeType);
                        }
                    }
                }
            }
        }
Example #6
0
        public virtual async System.Threading.Tasks.Task Load(EngineNS.IO.XndNode xndNode)
        {
            IsLoading = true;

            var att = xndNode.FindAttrib("Head");

            att.BeginRead();
            int ver = 0;

            att.Read(out ver);
            att.Read(out mGuid);
            att.EndRead();

            ClearControlNodes();

            switch (ver)
            {
            case 0:
            {
                // 读取节点信息并创建节点
                var childNodesCtrls = xndNode.FindNode("ChildNodesCtrls");
                if (childNodesCtrls == null)
                {
                    return;
                }
                var xndChildNodes = childNodesCtrls.GetNodes();
                foreach (var cldNode in xndChildNodes)
                //foreach (XmlElement element in doc.DocumentElement.ChildNodes)
                {
                    Type ctrlType = null;
                    ConstructionParams csParam = null;
                    var childAtt = cldNode.FindAttrib("_nodeHead");
                    switch (childAtt.Version)
                    {
                    case 0:
                    {
                        childAtt.BeginRead();
                        string typeSaveName;
                        childAtt.Read(out typeSaveName);
                        ctrlType = Program.GetNodeControlTypeFromSaveString(typeSaveName);                //  Program.GetType(xmlNode.FindAttrib("Type").Value);
                        string constructParam;
                        childAtt.Read(out constructParam);
                        childAtt.EndRead();
                        if (ctrlType == null)
                        {
                            continue;
                        }
                        csParam = new ConstructionParams()
                        {
                            CSType             = this.CSType,
                            HostNodesContainer = this,
                            ConstructParam     = constructParam,
                        };
                    }
                    break;

                    case 1:
                    {
                        childAtt.BeginRead();
                        string typeSaveName;
                        childAtt.Read(out typeSaveName);
                        ctrlType = Program.GetNodeControlTypeFromSaveString(typeSaveName);                //  Program.GetType(xmlNode.FindAttrib("Type").Value);
                        childAtt.EndRead();
                        if (ctrlType == null)
                        {
                            continue;
                        }
                        csParam                    = BaseNodeControl.CreateConstructionParam(ctrlType);
                        csParam.CSType             = this.CSType;
                        csParam.HostNodesContainer = this;
                        csParam.Read(cldNode);
                    }
                    break;
                    }

                    SetConstructionParams_WPF(csParam);
                    CodeGenerateSystem.Base.BaseNodeControl nodeControl = AddNodeControl(ctrlType, csParam, double.NaN, double.NaN);
                    await nodeControl.Load(cldNode);
                }

                // 读取完成后根据id设置一遍链接节点
                foreach (var node in mCtrlNodeList)
                {
                    node.ConstructLinkInfo(this);
                }
                //foreach (var node in mCtrlNodeList)
                //{
                //    node.InitializeUsefulLinkDatas();
                //}

                IsLoading = false;
                IsDirty   = false;
                RefreshNodeProperty(null, ENodeHandleType.UpdateNodeControl);

                var origionCtrlIdsAtt = xndNode.FindAttrib("OrigionCtrlIds");
                if (origionCtrlIdsAtt != null)
                {
                    origionCtrlIdsAtt.BeginRead();
                    int count;
                    origionCtrlIdsAtt.Read(out count);
                    for (int i = 0; i < count; i++)
                    {
                        Guid oriId;
                        origionCtrlIdsAtt.Read(out oriId);
                        var ctrl = FindControl(oriId);
                        if (ctrl != null)
                        {
                            mOrigionNodeControls.Add(ctrl);
                        }
                    }
                    origionCtrlIdsAtt.EndRead();
                }
            }
            break;
            }

            AfterLoad_WPF();
            for (int i = 0; i < CtrlNodeList.Count; ++i)
            {
                CtrlNodeList[i].ContainerLoadComplete(this);
            }
            // 加载完后检查节点错误
            CheckError();
        }
Example #7
0
 partial void SetConstructionParams_WPF(ConstructionParams csParam);