コード例 #1
0
 protected override void OnInsert(int index, Object value)
 {
     base.OnInsert(index, value);
     if (!_IsLoadInit)
     {
         WordSqlXmlAction sql  = (WordSqlXmlAction)value;
         XmlNode          node = this.ElementList[index];
         this.DocumentElement.InsertBefore(sql.ToXmlElement(this._InnerDocument), node);
     }
 }
コード例 #2
0
 protected override void OnRemove(int index, Object value)
 {
     base.OnRemove(index, value);
     if (!_IsLoadInit)
     {
         WordSqlXmlAction sql = (WordSqlXmlAction)value;
         XmlElement       ele = (XmlElement)this.DocumentElement.SelectSingleNode(string.Format(".//sql[@id='{0}']", sql.Id));
         this.DocumentElement.RemoveChild(ele);
     }
 }
コード例 #3
0
 protected override void OnSet(int index, Object oldValue, Object newValue)
 {
     base.OnSet(index, oldValue, newValue);
     if (!_IsLoadInit)
     {
         WordSqlXmlAction oldSql = (WordSqlXmlAction)oldValue;
         WordSqlXmlAction newSql = (WordSqlXmlAction)newValue;
         XmlElement       oldEle = (XmlElement)this.DocumentElement.SelectSingleNode(string.Format(".//sql[@id='{0}']", oldSql.Id));
         this.DocumentElement.ReplaceChild(newSql.ToXmlElement(this._InnerDocument), oldEle);
     }
 }
コード例 #4
0
 public void Load(string file)
 {
     this._File          = file;
     this._InnerDocument = new XmlDocument();
     this._InnerDocument.Load(file);
     this._IsLoadInit = true;
     foreach (XmlNode node in this.ElementList)
     {
         XmlElement       ele    = (XmlElement)node;
         WordSqlXmlAction action = new WordSqlXmlAction(ele);
         this.List.Add(action);
     }
     this._IsLoadInit = false;
     this._Id         = ulong.Parse(this._InnerDocument.DocumentElement.GetAttribute("id"));
 }
コード例 #5
0
 public void LoadXml(string xmlcode)
 {
     Debug.Assert(!string.IsNullOrEmpty(xmlcode), "LoadXml(string xmlcode), 'xmlcode' is empty!");
     this._InnerDocument = new XmlDocument();
     if (string.IsNullOrEmpty(xmlcode))
     {
         this._InnerDocument.LoadXml("<?xml version=\"1.0\" encoding=\"UTF-8\"?><SqlXml id=\"0\" />");
     }
     else
     {
         this._InnerDocument.LoadXml(xmlcode);
     }
     this._IsLoadInit = true;
     foreach (XmlNode node in this.ElementList)
     {
         XmlElement       ele    = (XmlElement)node;
         WordSqlXmlAction action = new WordSqlXmlAction(ele);
         this.List.Add(action);
     }
     this._IsLoadInit = false;
     this._Id         = ulong.Parse(this._InnerDocument.DocumentElement.GetAttribute("id"));
 }
コード例 #6
0
        public WordSqlXmlAction CreatAction(DictAction dictAction, string word, ulong frequency, string dictName)
        {
            WordSqlXmlAction action = new WordSqlXmlAction(this.GetId(), dictAction, word, frequency, dictName);

            return(action);
        }
コード例 #7
0
 public bool Contains(WordSqlXmlAction value)
 {
     return(List.Contains(value));
 }
コード例 #8
0
 public void Remove(WordSqlXmlAction value)
 {
     List.Remove(value);
 }
コード例 #9
0
 public void Insert(int index, WordSqlXmlAction value)
 {
     List.Insert(index, value);
 }
コード例 #10
0
 public int IndexOf(WordSqlXmlAction value)
 {
     return(List.IndexOf(value));
 }
コード例 #11
0
 public int Add(WordSqlXmlAction value)
 {
     return(List.Add(value));
 }