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

            // ステータス同期
            _selectedParts = (PartsCollectionBase)Share.Get("SelectedParts", typeof(PartsCollection));   // 選択済みのパーツ一覧
        }
Exemple #2
0
        /// <summary>
        /// 初期化処理
        /// </summary>
        public override void OnInitInstance()
        {
            base.OnInitInstance();

            // ステータス同期
            _pos = (PartsPositionManager)Share.Get("MovingParts", typeof(PartsPositionManager));    // 移動中のパーツ一覧
        }
Exemple #3
0
 public override void OnInitInstance()
 {
     base.OnInitInstance();
     TarPane       = Pane.GetPane("GuiViewMain");
     _isAutoScroll = (DataSharingManager.Boolean)Share.Get("_isAutoScroll", typeof(DataSharingManager.Boolean));
     Timer.AddTrigger(1000, OnPorling);
 }
Exemple #4
0
 /// <summary>
 /// デフォルトコンストラクタ
 /// </summary>
 /// <param name="motherPane">このフィーチャールートで使用する主催ペーン</param>
 public FeatureGroupRoot(TGuiView motherPane)
 {
     _motherPane = motherPane;
     setPane(motherPane);
     setShare(new DataSharingManager());
     _isApplicationQuitting = (DataSharingManager.Int)Share.Get("ApplicationQuitFlag", typeof(DataSharingManager.Int));
 }
Exemple #5
0
        /// <summary>
        /// 初期化処理
        /// </summary>
        public override void OnInitInstance()
        {
            base.OnInitInstance();

            // ステータス同期
            _selectedParts = (PartsCollectionBase)Share.Get("SelectedParts", typeof(PartsCollection));
            _selectedParts.SetTemporaryMode();
        }
Exemple #6
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));                   // 移動中のパーツ一覧
        }
Exemple #7
0
        /// <summary>
        /// マウスダウンイベント転送
        /// </summary>
        public virtual void OnMouseDown(Tono.GuiWinForm.MouseState e)
        {
            if (Parts == null)
            {
                return;
            }

            if (_clickPos == null)
            {
                _clickPos = (MouseState)Share.Get("ClickPosition", typeof(MouseState));   // 移動中のパーツ一覧
            }
            SerializerEx.CopyObject(_clickPos, e);

            // パーツを取得する
            ClickParts = Parts.GetPartsAt(e.Pos, true, out var clickPane);
            ClickPane  = clickPane;

            //lock(_children.SyncRoot)	// 途中でAddChildしないので、スレッドセーフ。途中でAddChildしてしまうと下のループでAssertされる
            {
                foreach (var c in _children)
                {
                    if (c is FeatureBase && ((FeatureBase)c).Enabled == false)
                    {
                        continue;
                    }

                    if (c is IMouseListener)
                    {
#if DEBUG
                        if (c is FeatureBase)
                        {
                            TimeKeeper.SetStart(TimeKeeper.RecordType.MouseDown, ((FeatureBase)c).ID);
                        }
#endif
#if DEBUG == false
                        try
#endif
                        {
                            ((IMouseListener)c).OnMouseDown(e);
                        }
#if DEBUG == false
                        catch (Exception ex)
                        {
                            LOG.WriteLineException(ex);
                        }
#endif
#if DEBUG
                        if (c is FeatureBase)
                        {
                            TimeKeeper.SetEnd(TimeKeeper.RecordType.MouseDown, ((FeatureBase)c).ID);
                        }
#endif
                    }
                }
            }
            checkAndFireDataChanged();  // パーツ削除イベント
        }
Exemple #8
0
        public override void OnInitInstance()
        {
            base.OnInitInstance();
            SelectedParts = (PartsCollectionBase)Share.Get("SelectedParts", typeof(PartsCollection));

            TextBox = GetControl("textBoxTalk") as RichTextBox;
            TextBox?.ResetText();
            TextBox.SelectionChanged += TextBox_SelectionChanged;
            LabelTime = GetControl("LabelTalkBarTime") as Label;
        }
Exemple #9
0
        /// <summary>
        /// 初期化処理
        /// </summary>
        public override void OnInitInstance()
        {
            base.OnInitInstance();

            if (Pane is IControlUI)
            {
                _normalCursor = ((IControlUI)Pane).Cursor;
            }
            else
            {
                throw new NotSupportedException("FeatureCursorProviderは、IControlUIを実装しているPaneにのみ使用できます");
            }

            // ステータス同期
            _state = (DataSharingManager.Int)Share.Get("CursorProviderStatus", typeof(DataSharingManager.Int));
            _pos   = (PartsPositionManager)Share.Get("MovingParts", typeof(PartsPositionManager));  // 移動中のパーツ一覧
        }
Exemple #10
0
        /// <summary>
        /// 初期化処理
        /// </summary>
        public override void OnInitInstance()
        {
            base.OnInitInstance();

            _cursorSet = NamedId.FromName("CursorSet");

            if (Pane is IControlUI)
            {
                _normalCursor = ((IControlUI)Pane).Cursor;
            }
            else
            {
                throw new NotSupportedException("FeatureCursorProviderは、IControlUIを実装しているPaneにのみ使用できます");
            }

            // ステータス同期
            _state = (DataSharingManager.Int)Share.Get("CursorProviderStatus", typeof(DataSharingManager.Int));
        }
Exemple #11
0
 /// <summary>
 /// 初期化
 /// </summary>
 public override void OnInitInstance()
 {
     base.OnInitInstance();
     _noscrollmove = (DataSharingManager.Boolean)Share.Get("NoScrollMoveFlag", typeof(DataSharingManager.Boolean));
 }
Exemple #12
0
        /// <summary>
        /// パラメータを取得し、フィーチャーやトークン発行などを行う
        /// </summary>
        private void resetSwitch()
        {
            var ss           = GetParamString().Split(new char[] { ',' });
            var fis          = GetRoot().GetChildFeatureInstance();
            var tokenLidName = string.Empty;

            foreach (var s in ss)
            {
                var s2 = s.Trim();
                if (s2.StartsWith("[")) // チェックボックス関連は関係ない
                {
                    continue;
                }
                // トークン、シェアを設定する
                var com = s2.Split(new char[] { '=' });
                if (com.Length == 2)
                {
                    if (com[0].Trim().Equals("Command", StringComparison.CurrentCultureIgnoreCase))
                    {
                        switch (com[1].Trim().ToUpper())
                        {
                        case "REDRAW":
                            Pane.Invalidate(null);
                            break;

                        case "KEEPOFF":
                            ThreadSafe.SetChecked(_checkBox, false);
                            _isOn = false;
                            break;
                        }
                    }
                    if (com[0].Trim().Equals("Token", StringComparison.CurrentCultureIgnoreCase))
                    {
                        tokenLidName = com[1].Trim();
                    }
                    if (com[0].Trim().Equals("ShareBool", StringComparison.CurrentCultureIgnoreCase))
                    {
                        var b = (DataSharingManager.Boolean)Share.Get(com[1].Trim(), typeof(DataSharingManager.Boolean));
                        b.value = _isOn;
                    }
                }
                else
                {
                    // フィーチャーのEnabledを設定する
                    foreach (FeatureBase fi in fis)
                    {
                        if (s2.StartsWith("@"))
                        {
                            if (fi.Name == s2.Substring(1))
                            {
                                fi.Enabled = _isOn;
                            }
                        }
                        else
                        {
                            if (fi.GetType().Name == s2)
                            {
                                fi.Enabled = _isOn;
                            }
                        }
                    }
                }
            }
            // トークンを投げる(フィーチャーのEnableを設定した後)
            if (_isNoToken == false)
            {
                if (string.IsNullOrEmpty(tokenLidName) == false)
                {
                    Token.Add(NamedId.FromName(tokenLidName), this);
                }
            }
            else
            {
                _isNoToken = false;
            }
        }
Exemple #13
0
 /// <summary>
 /// 初期化
 /// </summary>
 public override void OnInitInstance()
 {
     _interlockGroups = (IDictionary)Share.Get("SwitchInterlockGroup", typeof(Hashtable));
 }
Exemple #14
0
        /// <summary>
        /// 切り替え
        /// </summary>
        public override void Start(NamedId who)
        {
            if (_tokenSwitch.Equals(who))
            {
                var sw = (FeatureSwitch.TagFeatureSwitch)Share.Get("TokenChangeFeatureSwitches", typeof(FeatureSwitch.TagFeatureSwitch));
                if (ID == sw.switchingFeatureID)
                {
                    _isOn = sw.sw;
                    if (_checkBox != null)
                    {
                        ThreadSafe.SetChecked(_checkBox, _isOn);
                    }
                }
                else
                {
                    return;
                }
            }
            else
            if (_tokenReadCompleted.Equals(who) == false)
            {
                if (string.IsNullOrEmpty(_interlockGroup))
                {
                    // UNDO/REDOしながら、スイッチ切り替え
                    Persister[UNDO].StartChunk(GetType().Name + ".Start");
                    Persister[REDO].StartChunk(GetType().Name + ".Start");

                    Persister[UNDO].Save(new TagFeatureSwitch(this, _isOn), _featureDataID);
                    _isOn = (_isOn ? false : true);
                    Persister[REDO].Save(new TagFeatureSwitch(this, _isOn), _featureDataID);

                    Persister[UNDO].EndChunk();
                    Persister[REDO].EndChunk();
                }
                else
                {
                    if (_isOn == false)
                    {
                        // UNDO/REDOしながら、グループの相手をOFFにする。
                        Persister[UNDO].StartChunk(GetType().Name + ".Start");
                        Persister[REDO].StartChunk(GetType().Name + ".Start");

                        var ig = (IList)_interlockGroups[_interlockGroup];
                        foreach (FeatureSwitch swf in ig)
                        {
                            if (object.ReferenceEquals(this, swf))
                            {
                                continue;
                            }
                            if (swf._isOn != false)
                            {
                                Persister[UNDO].Save(new TagFeatureSwitch(swf, swf._isOn), _featureDataID);
                                swf._isOn = false;
                                Persister[REDO].Save(new TagFeatureSwitch(swf, swf._isOn), _featureDataID);
                                if (swf._checkBox != null)
                                {
                                    ThreadSafe.SetChecked(swf._checkBox, swf._isOn);
                                }
                                swf.resetSwitch();
                            }
                        }
                        Persister[UNDO].Save(new TagFeatureSwitch(this, _isOn), _featureDataID);
                        _isOn = true;
                        Persister[REDO].Save(new TagFeatureSwitch(this, _isOn), _featureDataID);

                        Persister[UNDO].EndChunk();
                        Persister[REDO].EndChunk();
                    }
                }
            }
            if (_checkBox != null)
            {
                ThreadSafe.SetChecked(_checkBox, _isOn);
            }

            resetSwitch();
        }
Exemple #15
0
 /// <summary>
 /// 初期化
 /// </summary>
 public override void OnInitInstance()
 {
     // ステータス同期
     _pos      = (PartsPositionManager)Share.Get("MovingParts", typeof(PartsPositionManager)); // 移動中のパーツ一覧
     _clickPos = (MouseState)Share.Get("ClickPosition", typeof(MouseState));                   // 移動中のパーツ一覧
 }
Exemple #16
0
 /// <summary>
 /// 初期化
 /// </summary>
 public override void OnInitInstance()
 {
     base.OnInitInstance();
     _pos     = (PartsPositionManager)Share.Get("MovingParts", typeof(PartsPositionManager)); // 移動中のパーツ一覧
     _tarPane = Pane.GetPane("Resource");
 }
Exemple #17
0
 /// <summary>
 /// アプリ終了
 /// </summary>
 /// <param name="who"></param>
 public override void Start(NamedId who)
 {
     Pane.Control.FindForm().Visible = false;
     ((DataSharingManager.Int)Share.Get("ApplicationQuitFlag", typeof(DataSharingManager.Int))).value = 1;
 }