Ejemplo n.º 1
0
        // ICloneable

        public object Clone()
        {
            var methodClone = (MethodModel)_method.Clone();
            var result      = new MethodViewModel(methodClone, null, false);

            return(result);
        }
Ejemplo n.º 2
0
        public MethodEditingViewModel(MethodViewModel method)
        {
            _realMethod = method;   // link
            _method     = (MethodViewModel)method.Clone();

            OkCommand     = new RelayCommand(OkCommand_OnExecute);
            CancelCommand = new RelayCommand(CancelCommand_OnExecute);
            ResetCommand  = new RelayCommand(ResetCommand_OnExecute);
        }
Ejemplo n.º 3
0
        // Public

        public ThreadViewModel(ThreadModel threadModel)
        {
            _thread = threadModel;
            Methods = new ObservableCollection <MethodViewModel>();

            foreach (var method in threadModel.Methods)
            {
                var m = new MethodViewModel(method, this);
                m.ChangeEvent += OnChange;
                Methods.Add(m);
            }
        }
Ejemplo n.º 4
0
        public MethodViewModel(MethodModel method, ITimed parent, bool createNestedTree = true)
        {
            _method       = method;
            Parent        = parent;
            NestedMethods = new ObservableCollection <MethodViewModel>();

            if (!createNestedTree)
            {
                return;
            }

            foreach (var nestedMethod in method.NestedMethods)
            {
                var m = new MethodViewModel(nestedMethod, this);
                m.ChangeEvent += OnChange;
                NestedMethods.Add(m);
            }
        }