コード例 #1
0
ファイル: Environment.cs プロジェクト: siegjan6/HMI
        public void Deserialize(BinaryFormatter bf, Stream s)
        {
            int version = (int)bf.Deserialize(s);

            int objCount = (int)bf.Deserialize(s);

            _objs.Clear();
            _objs.Capacity = objCount;
            for (int i = 0; i < objCount; i++)
            {
                DrawType type = (DrawType)bf.Deserialize(s);
                IDrawObj obj  = CreateDrawObj(type);
                //DrawGroup控件需要提前获取Form,用来创建子控件
                if (obj.Type == DrawType.Group)
                {
                    obj.Parant = Container;
                }
                obj.Deserialize(bf, s);
                _objs.Add(obj);
            }

            _rect          = (Rectangle)bf.Deserialize(s);
            _style         = (FormStyle)bf.Deserialize(s);
            BorderStyle    = (FormBorderStyle)bf.Deserialize(s);
            _defaultLayer  = (int)bf.Deserialize(s);
            _visibleLayers = (BitArray)bf.Deserialize(s);
            _lockedLayers  = (BitArray)bf.Deserialize(s);
            _caption       = (string)bf.Deserialize(s);

            _backBrush.Data.Deserialize(bf, s);
        }
コード例 #2
0
        public override void Deserialize(BinaryFormatter bf, Stream s)
        {
            base.Deserialize(bf, s);

            int version = (int)bf.Deserialize(s);

            int objCount = (int)bf.Deserialize(s);

            _objList.Clear();
            _objList.Capacity = objCount;
            for (int i = 0; i < objCount; i++)
            {
                DrawType type = (DrawType)bf.Deserialize(s);
                IDrawObj obj  = Parant.Common.CreateDrawObj(type);
                //DrawGroup控件需要提前获取Form,用来创建子控件
                if (obj.Type == DrawType.Group)
                {
                    obj.Parant = Parant;
                }
                obj.Deserialize(bf, s);
                _objList.Add(obj);
            }
        }