/// <summary>
        /// XMLNodeをデータにデシリアライズする。
        /// </summary>
        /// <param name="node">復号対象のXMLノード。</param>
        public static AccessorDefinition DeserializeElement(XmlElement node)
        {
            var ret = new AccessorDefinition();
            XmlAttribute attr;

            if (node.Name != "Accessor")
            {
                throw new FormatException("アクセサ定義ノードではありません。");
            }

            attr = node.Attributes["Name"];
            if (attr == null)
            {
                throw new FormatException("名称が未定義です。");
            }
            ret.Name = attr.Value;

            attr = node.Attributes["DisplayName"];
            if (attr == null)
            {
                throw new FormatException("表示名が未定義です。");
            }
            ret.DisplayName = attr.Value;

            attr = node.Attributes["ValueType"];
            if (attr == null)
            {
                throw new FormatException("アクセサのデータ型が未定義です。");
            }
            ret.ValueType = attr.Value;

            attr = node.Attributes["ArrayValue"];
            if (attr == null)
            {
                throw new FormatException("配列型アクセサ状態が未定義です。");
            }
            ret.ArrayValue = bool.Parse(attr.Value);

            return ret;
        }
        /// <summary>
        /// 定義情報の更新を行う。
        /// </summary>
        public override bool ApplyData()
        {
            if (!ValidateInput()) return false;

            if (Definition == null)
            {
                Definition = new ClassDefinition();
                Definition.Guid = Project.NewScriptGuid();

                Project.ClassDefinitions.Add(Definition);
            }

            Definition.Name = ctlName.Text;
            Definition.Namespace = ctlNamespace.Text;

            Definition.Extends = (string)ctlExtends.SelectedValue;
            Definition.RequiredIdentifier = ctlRequiredIdentifier.Checked;

            var accessorList = (DataTable)ctlAccessorList.DataSource;
            foreach (var accessor in Definition.Accessors.ToArray())
            {
                Definition.Accessors.Remove(accessor);
            }

            foreach (DataRow row in accessorList.Rows)
            {
                if (IsBlankAccessorRow(row)) continue;
                if (row.Field<dynamic>("Extends") is ClassDefinition) continue;

                var accessor = new AccessorDefinition()
                {
                    Name = row.Field<string>("Name"),
                    DisplayName = row.Field<string>("DisplayName"),
                    ValueType = row.Field<string>("ValueType"),
                    ArrayValue = row.Field<bool?>("ArrayValue") ?? false
                };

                if (String.IsNullOrEmpty(accessor.DisplayName))
                {
                    accessor.DisplayName = accessor.Name;
                }

                Definition.Accessors.Add(accessor);
            }

            if (!InvokeCommand("SaveProject").Parameter["Result"]) return false;

            var ret = base.ApplyData();

            RefreshCaption();

            return ret;
        }