Exemple #1
0
        public object Clone()
        {
            AreaConfig copy = null;

            //MemoryStream stream = new MemoryStream();
            //BinaryFormatter formatter = new BinaryFormatter();
            //using (stream)
            //{
            //    formatter.Serialize(stream, this);
            //    stream.Position = 0;
            //    copy = formatter.Deserialize(stream) as AreaConfig;
            //    stream.Close();
            //}
            copy = this.MemberwiseClone() as AreaConfig;
            copy._allelements      = new List <Elements>();
            copy._selectedelements = new List <Elements>();
            copy._allelements.AddRange(this.AllElements.ToArray());
            copy._selectedelements.AddRange(this.SelectedElements.ToArray());
            return(copy);
        }
Exemple #2
0
 /// <summary> 构造函数
 /// </summary>
 public History(Point location, AreaConfig config)
 {
     _scrolllocation = location;
     _config         = config;
 }
Exemple #3
0
 /// <summary> 新建工作区域配置
 /// </summary>
 /// <returns>成功返回true,否则返回false</returns>
 public Boolean NewWork()
 {
     Config = new AreaConfig();
     return(true);
 }