コード例 #1
0
        public override void SetValue(object component, object value)
        {
            wixFiles.UndoManager.BeginNewCommandRange();

            CustomTableRowElementAdapter adapter = (CustomTableRowElementAdapter)component;

            XmlNode node = adapter.XmlElement.SelectSingleNode(String.Format("wix:Data[@Column='{0}']", this.Name), this.wixFiles.WxsNsmgr);

            if (node == null)
            {
                XmlElement newNode = adapter.XmlElement.OwnerDocument.CreateElement("Data", WixFiles.WixNamespaceUri);
                adapter.XmlElement.AppendChild(newNode);
                newNode.SetAttribute("Column", this.Name);
                node = newNode;
            }

            if (value == null || value.ToString().Length == 0)
            {
                node.InnerText = String.Empty;
            }
            else
            {
                node.InnerText = value.ToString();
            }
        }
コード例 #2
0
        public override object GetValue(object component)
        {
            CustomTableRowElementAdapter adapter = (CustomTableRowElementAdapter)component;

            XmlNode node = adapter.XmlElement.SelectSingleNode(String.Format("wix:Data[@Column='{0}']", this.Name), this.wixFiles.WxsNsmgr);

            if (node == null)
            {
                return(String.Empty);
            }

            return(node.InnerText);
        }