Esempio n. 1
0
        public VFlashTypeBank(uint id, string name, VFlashTypeBankFile vFlashTypeBankFile)
            : base(id, name)
        {
            ReferencePosition = 3;
            VFlashTypeBankFile = vFlashTypeBankFile;

            Children = VFlashTypeBuilder.Build(Header.Id, vFlashTypeBankFile);
        }
Esempio n. 2
0
            public static void UpdateConfiguration(uint id, VFlashTypeBankFile vFlashTypeBankFile, List<VFlashTypeComponent> children)
            {
                var i = 0;
                vFlashTypeBankFile.TypeBank[id] = new string[children.Count];
                vFlashTypeBankFile.Steps[id] = new string[children.Count][];
                foreach (var vFlashTypeComponent in children)
                {
                    vFlashTypeBankFile.TypeBank[id][i] = vFlashTypeComponent.Version;
                    vFlashTypeBankFile.Steps[id][i] = new string[vFlashTypeComponent.Steps.Count];

                    var j = 0;
                    foreach (var step in vFlashTypeComponent.Steps)
                    {
                        vFlashTypeBankFile.Steps[id][i][j] = step.Id + ";" + step.Path + ";" + step.TransitionDelay + ";" + step.TransitionSignature;
                        j++;
                    }
                    i++;
                }

                vFlashTypeBankFile.Save();
            }
Esempio n. 3
0
            public static List<VFlashTypeComponent> Build(uint id, VFlashTypeBankFile vFlashTypeBankFile)
            {
                var newlist = new List<VFlashTypeComponent>();
                var i = 0;

                foreach (var newType in vFlashTypeBankFile.TypeBank[id].Select(type => new VFlashTypeComponent(type)))
                {
                    newType.Steps.Clear();

                    foreach (var step in vFlashTypeBankFile.Steps[id][i])
                    {
                        var properties = step.Split(';');
                        var newStep = new VFlashTypeComponent.Step(Convert.ToInt32(properties[0]))
                        {
                            Path = properties[1],
                            TransitionDelay = Convert.ToInt32(properties[2])
                        };
                        newStep.RestoreConditions(properties[3]);
                        newType.Steps.Add(newStep);
                    }

                    newlist.Add(newType);
                    i++;
                }

                return newlist;
            }