Пример #1
0
        void LeftClick()
        {
            //左键单击
            // CurMemInfo = null;
            TimeLineData data = TimeLineDataManager.Instance.GetCurSelectTimeLine();

            if (data == null)
            {
                return;
            }
            data.InitDefaultTime();
            Type t = data.GetType();

            data.SetFieldValue(data);
            var memInfo = t.GetMethods();

            TimeLineDataManager.Instance.memDic.Clear();
            int selectKey = -1;

            TimeLineDataManager.Instance.curOperationAction = null;
            foreach (MethodInfo info in memInfo)
            {
                foreach (var item in data.GetActionDic())
                {
                    ActionItemData ad = item.Value;
                    if (ad.IsSelect())
                    {
                        foreach (var name in ad.methodNameList)
                        {
                            if (name == info.Name)
                            {
                                TimeLineDataManager.Instance.AddGUIMemInfo(info);
                            }
                        }
                        //移除要操作的action 用临时变量保存
                        TimeLineDataManager.Instance.curOperationAction = ad.Clone();
                        selectKey = ad.index;
                    }
                    else
                    {
                        if (LastSelectGridY != CurSelectGridY)
                        {
                            //更换timeline
                            //  TimeLineDataManager.Instance.curOperationAction = null;
                        }
                    }
                }
            }

            data.DeleteAction(selectKey);
        }
Пример #2
0
        public void ReadFromBinary(BinaryReader br)
        {
            dataName = br.ReadString();
            dataPath = br.ReadString();

            int len = br.ReadInt32();

            lineDataList.Clear();
            for (int i = 0; i < len; i++)
            {
                string type = br.ReadString();
                Type   t    = Type.GetType(type);

                TimeLineData data = Activator.CreateInstance(t) as TimeLineData;
                data.ReadFromBinary(br);
                data.InitDefaultTime();
                lineDataList.Add(data);
            }
        }