Exemple #1
0
        public IProperties Clone()          //浅拷贝
        {
            DefaultProperties df = new DefaultProperties();

            df.properties = (Hashtable)properties.Clone();            //注意:这里是浅拷贝.
            return(df);
        }
Exemple #2
0
        /// <summary>
        /// 从一个XmlElement元素节点创建一个DefaultProperties对象
        /// </summary>
        public virtual object FromXmlElement(XmlElement element)
        {
            DefaultProperties defaultProperties = new DefaultProperties();

            defaultProperties.SetValueFromXmlElement(element);
            return(defaultProperties);
        }
		public IProperties Clone()  //浅拷贝
		{
			DefaultProperties df = new DefaultProperties();
			df.properties = (Hashtable)properties.Clone();//注意:这里是浅拷贝.
			return df;
		}
		/// <summary>
		/// 从一个XmlElement元素节点创建一个DefaultProperties对象
		/// </summary>
		public virtual object FromXmlElement(XmlElement element)
		{
			DefaultProperties defaultProperties = new DefaultProperties();
			defaultProperties.SetValueFromXmlElement(element);
			return defaultProperties;
		}
		public IXmlConvertable CreateMemento()
		{
			DefaultProperties properties = new DefaultProperties();
			string[] bookMarks = new string[((TextEditorControl)this.Control).Document.BookmarkManager.Marks.Count];
			for (int i = 0; i < bookMarks.Length; ++i) 
			{
				bookMarks[i] = ((TextEditorControl)this.Control).Document.BookmarkManager.Marks[i].ToString();
			}
			properties.SetProperty("Bookmarks",   String.Join(",", bookMarks));
			properties.SetProperty("CaretOffset", ((TextEditorControl)this.Control).ActiveTextAreaControl.Caret.Offset);
			properties.SetProperty("VisibleLine", ((TextEditorControl)this.Control).ActiveTextAreaControl.TextArea.TextViewMargin.FirstVisibleLine);
			properties.SetProperty("HighlightingLanguage", ((TextEditorControl)this.Control).Document.HighlightingStrategy.Name);
			properties.SetProperty("Foldings", ((TextEditorControl)this.Control).Document.FoldingManager.SerializeToString());
			return properties;
		}