Beispiel #1
0
 /// <summary>
 /// 获取样式节点
 /// </summary>
 private StyleXmlElement GetStyle(StyleType type, string name)
 {
     if (_currenDoc != null)
     {
         Designer.SaveToElement(_currenDoc.StyleElement);
         _currenDoc.Save(_currenDoc.StyleFilePath);
     }
     _currenDoc = StyleXmlDocument.GetStyleDocument(type, name);
     if (_currenDoc == null)
     {
         return(null);
     }
     return(_currenDoc.StyleElement);
 }
Beispiel #2
0
        public override bool Save()
        {
            ///得到Document里的相应页面片Element
            SnipXmlElement snipEleNew = _ownerTmpltForm.TmpltDoc.GetSnipElementById(SnipElement.Id);

            ///两个Element不是同一个对象,则更新
            if (!object.ReferenceEquals(SnipElement, snipEleNew))
            {
                SnipElement = snipEleNew;
            }

            //add by fenggy 2008-06-19
            //Snip的NAME有能修改,如果该页面片增加时没有保存且修改了NAME,以后在保存,这样的话,
            //NAME 是保存不上的,所以在这里在将修改过的名字重新赋值给页面片
            if (!string.IsNullOrEmpty(_newSnipName))
            {
                this.SnipElement.SnipName = _newSnipName;
            }

            ///得到页面片保存的Element
            SnipPageDesigner.SaveToElement(this.SnipElement);
            SnipPageDesigner.IsModified = false;

            OnSaved(EventArgs.Empty);

            return(true);
        }