チャット枠の位置、サイズ情報を表します。
Inheritance: HarrietNotifiableModelBase
Ejemplo n.º 1
0
        /// <summary>フィールド初期化を行います。</summary>
        private void Initialize()
        {
            var chatWindowPosition = new ChatWindowPositionModel(
                _mainWindow,
                _setting.ChatWindowLayout,
                _relocator
                );

            _chatWindow = new ChatWindowModel(chatWindowPosition);

            var voiceOperator = new VoiceOperator(_setting.Voice);
            voiceOperator.LipSynchRequested += (_, e) => _lipSyncher = e.LipSyncher;

            var scriptRequestor = new SimpleScriptRequestor();

            var api = new ScriptApi(
                _mainWindow, _character, voiceOperator, _chatWindow, scriptRequestor,
                _setting,
                _setting.ScriptApi,
                _characterName
                );

            var dict = new PythonDictionary();
            _updateProcessor = new IronPythonUpdateProcessor(api, _setting.ScriptUpdate, dict);

            var ironPythonReader = new IronPythonMainScriptReader(api, dict);
            _scriptStateManager = new ScriptStateManager(ironPythonReader, _setting.ScriptRoutine, _characterName);

            scriptRequestor.ScriptRequested += (_, e) => _scriptStateManager.Request(
                e.ScriptName,
                e.Priority
                );

        }
        public ChatWindowPositionViewModel(ChatWindowPositionModel model)
        {
            _model = model;
            Layout = new ChatWindowLayoutViewModel(model.Layout);

            Left = model.Left;
            Top = model.Top;
            Width = model.Width;
            Height = model.Height;

            AssignToModel(model);
        }
        private void AssignToModel(ChatWindowPositionModel model)
        {
            //OKなパターン: 明示的にメンバメソッドで実装
            PropertyChangedEventManager.AddHandler(
                model,
                OnModelPropertyChanged,
                string.Empty
                );

            this.PropertyChanged += (_, e) =>
            {
                if (e.PropertyName == nameof(Left))
                {
                    _model.Left = Left;
                }
                else if (e.PropertyName == nameof(Top))
                {
                    _model.Top = Top;
                }
                else if (e.PropertyName == nameof(Width))
                {
                    _model.Width = Width;
                }
                else if (e.PropertyName == nameof(Height))
                {
                    _model.Height = Height;
                }

            };

        }
Ejemplo n.º 4
0
 public ChatWindowModel(ChatWindowPositionModel positionModel)
 {
     Position = positionModel;
 }
Ejemplo n.º 5
0
 public ChatWindowModel(ChatWindowPositionModel positionModel)
 {
     Position = positionModel;
 }