Пример #1
0
        private AudioInfo MS_GetRow(int rowidx)
        {
            DataGridViewRow row = this.MainSheet.Rows[rowidx];

            return(new AudioInfo()
            {
                Status = (AudioInfo.Status_e)ArrayTools.IndexOf(AudioInfo.StatusStrings, v => v == "" + row.Cells[0].Value),
                ErrorMessage = "" + row.Cells[1].Value,
                AudioFile = "" + row.Cells[2].Value,
                ImageFile = "" + row.Cells[4].Value,
                MovieFile = "" + row.Cells[6].Value,
                FPS = int.Parse("" + row.Cells[8].Value),
            });
        }
Пример #2
0
        private void LoadSelectors(TreeText src)
        {
            foreach (TreeText.Node selectorNode in src.Root.Children)
            {
                string name = selectorNode.Line;

                selectorNode.ErrorChecker().CheckFairName(name, ":");

                Selector selector = new Selector()
                {
                    Name = name,
                };

                foreach (TreeText.Node propNode in selectorNode.Children)
                {
                    if (propNode.Children.Count != 1)
                    {
                        propNode.ErrorChecker().Error("プロパティの配下は1つの値でなければなりません。");
                    }

                    if (propNode.Children[0].Children.Count != 0)
                    {
                        propNode.ErrorChecker().Error("プロパティの値の配下は空でなければなりません。");
                    }

                    string propName  = propNode.Line;
                    string propValue = propNode.Children[0].Line;

                    if (propName == "@import")
                    {
                        int index = ArrayTools.IndexOf(this.Selectors.ToArray(), s => s.Name == propValue);

                        if (index == -1)
                        {
                            propNode.ErrorChecker().Error("不正なセレクタ参照です。");
                        }

                        foreach (Property property in this.Selectors[index].Properties)
                        {
                            selector.Properties.Add(new Property()
                            {
                                Name  = property.Name,
                                Value = property.Value,
                            });
                        }
                    }
                    else if (propName[0] == '@')
                    {
                        propNode.ErrorChecker().Error("不正な参照です。");
                    }
                    else
                    {
                        propNode.ErrorChecker().CheckFairName(propName, "-");
                        // propValue ⇒ 自由な文字列

                        selector.Properties.Add(new Property()
                        {
                            Name  = propName,
                            Value = propValue,
                        });
                    }
                }
                this.Selectors.Add(selector);
            }
        }