Exemplo n.º 1
0
        public override void Initialize(EntryEditorVM vm)
        {
            _vm = vm as TextEditorVM ?? throw new InvalidOperationException(nameof(vm));

            _vm.PropertyChanged += _vm_PropertyChanged;

            OnSubeditorChanged(_vm.Subeditor);
        }
Exemplo n.º 2
0
        public void AddCondition(ConditionOperator p_oprOperator, string p_strConditionCPL)
        {
            Int32  intCaretPosition  = TextEditorVM.CaretPosition;
            Int32  intPreTextLength  = TextEditorVM.Code.Substring(0, intCaretPosition).Trim().Length;
            Int32  intPostTextLength = TextEditorVM.Code.Substring(intCaretPosition).Trim().Length;
            string strPreOperator    = null;
            string strPostOperator   = null;

            if (intPreTextLength > 0)
            {
                strPreOperator = (p_oprOperator == ConditionOperator.And) ? " AND " : " OR ";
            }
            if (intPostTextLength > 0)
            {
                strPostOperator = (p_oprOperator == ConditionOperator.And) ? " AND " : " OR ";
            }
            string strExpression = String.Format("{0}{1}{2}", strPreOperator, p_strConditionCPL, strPostOperator);

            TextEditorVM.Code = TextEditorVM.Code.Insert(intCaretPosition, strExpression);
            TextEditorVM.ValidateCPL();
        }
Exemplo n.º 3
0
 public MainWindow()
 {
     InitializeComponent();
     tvm         = new TextEditorVM();
     DataContext = tvm;
 }