Example #1
0
        public override void OnInitInstance()
        {
            base.OnInitInstance();

            // ステータス同期
            _selectedParts = (PartsCollectionBase)Share.Get("SelectedParts", typeof(PartsCollection));   // 選択済みのパーツ一覧
        }
Example #2
0
        /// <summary>
        /// 初期化(共有変数の割当など)
        /// </summary>
        public override void OnInitInstance()
        {
            base.OnInitInstance();

            // ステータス同期
            _selectedParts = (PartsCollectionBase)Share.Get("SelectedParts", typeof(PartsCollection));     // 選択済みのパーツ一覧
            _pos           = (PartsPositionManager)Share.Get("MovingParts", typeof(PartsPositionManager)); // 移動中のパーツ一覧
            _clickPos      = (MouseState)Share.Get("ClickPosition", typeof(MouseState));                   // 移動中のパーツ一覧
        }
Example #3
0
 /// <summary>
 /// Cloneなどで用いる
 /// </summary>
 /// <param name="dst"></param>
 protected void copyBasePropertyTo(PartsCollectionBase dst)
 {
     if (_removedParts is ListDummy)
     {
         dst._removedParts = new ListDummy();
         dst._addedParts   = new ListDummy();
     }
     else
     {
         dst._removedParts = new ArrayList(_removedParts);
         dst._addedParts   = new ArrayList(_addedParts);
     }
     dst._skipzones = new List <ScreenRect>(_skipzones);
 }
Example #4
0
        /// <summary>
        /// パーツの座標を実際に書き換える
        /// </summary>
        /// <param name="partsCollection">パーツ領域の描画更新をする場合、Partsインスタンスを指定する</param>
        public void SetNowPositionsToParts(PartsCollectionBase partsCollection)
        {
            foreach (DictionaryEntry de in this)
            {
                var parts = (PartsBase)de.Key;
                var pos   = (PartsPositionManager.Pos3)de.Value;

                if (partsCollection != null)
                {
                    partsCollection.Invalidate(parts, pos.NowPane); // 移動前のInvalidate
                }
                parts.Rect = pos.Now;                               // 位置を調整する
                if (partsCollection != null)
                {
                    partsCollection.Invalidate(parts, pos.NowPane); // 移動後のInvalidate
                }
            }
        }
Example #5
0
        /// <summary>
        /// インスタンスを初期化する
        /// </summary>
        /// <param name="with">基準位置とパーツの種類の元情報</param>
        /// <param name="pane">基準位置のスクロールとズーム値を記憶するためのインプット</param>
        public void Initialize(PartsCollectionBase with)
        {
            Clear();

            _lastDevelpType = DevelopType.Unknown;

            foreach (PartsCollectionBase.PartsEntry pe in with)
            {
                var p = new Pos3
                {
                    OrgPane = RichPaneBinder.CreateCopyComplete(pe.Pane),
                    NowPane = pe.Pane,
                    Org     = (CodeRect)pe.Parts.Rect.Clone(), // 符号化の座標(符号しない場合、単なるパーツ座標)
                    Pre     = (CodeRect)pe.Parts.Rect.Clone(), // 符号化の座標(符号しない場合、単なるパーツ座標)
                    Now     = (CodeRect)pe.Parts.Rect.Clone(), // 符号化の座標(符号しない場合、単なるパーツ座標)
                    Offset  = CodePos.FromInt(0, 0)
                };
                base[pe.Parts] = p;
            }
        }