public ImportedFileNavigationSearchScreenViewModel(IViewModelDependencies appCtx, Func<IZetboxContext> ctxFactory,
     IZetboxContext dataCtx, ViewModel parent, NavigationScreen screen)
     : base(appCtx, dataCtx, ctxFactory, parent, screen)
 {
     _ctxFactory = ctxFactory;
     base.Type = typeof(ImportedFile).GetObjectClass(FrozenContext);
 }
Esempio n. 2
0
 public LabeledViewContainerViewModel(IViewModelDependencies dependencies, IZetboxContext dataCtx, ViewModel parent, string label, string toolTip, ViewModel mdl)
     : base(dependencies, dataCtx, parent)
 {
     this._Label = label;
     this._ToolTip = toolTip;
     this.Model = mdl;
 }
Esempio n. 3
0
 public MultiplePropertyGroupViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     string title,
     IEnumerable<ViewModel> obj)
     : base(appCtx, dataCtx, parent, title, obj)
 {
 }
Esempio n. 4
0
 public DataTypeViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     DataType dt)
     : base(appCtx, dataCtx, parent, dt)
 {
     _dataType = dt;
 }
 public PropertiesPrewiewViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, DataType dt)
     : base(appCtx, dataCtx, parent)
 {
     if (dt == null) throw new ArgumentNullException("dt");
     _dataType = dt;
     _dataType.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_dataType_PropertyChanged);
 }
Esempio n. 6
0
 public ObjectClassViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     ObjectClass cls)
     : base(appCtx, dataCtx, parent, cls)
 {
     _class = cls;
 }
Esempio n. 7
0
        public WpfDelayedTask(ViewModel displayer, Action task)
        {
            if (task == null) throw new ArgumentNullException("task");

            _displayer = displayer;
            _task = task;
        }
 public SimpleDataObjectEditorTaskViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     ViewModel obj)
     : base(appCtx, dataCtx, parent)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     this.Object = obj;
 }
Esempio n. 9
0
 public CustomPropertyListGroupViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     string tagName,
     string title,
     IEnumerable<ViewModel> lst)
     : base(appCtx, dataCtx, parent, tagName, title, lst)
 {
 }
Esempio n. 10
0
 public CompoundObjectViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     ICompoundObject obj)
     : base(appCtx, dataCtx, parent)
 {
     _object = obj;
     _object.PropertyChanged += ObjectPropertyChanged;
 }
Esempio n. 11
0
 public EventInputViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, cal.CalendarBook targetCalendar, DateTime selectedStartDate, bool isAllDay)
     : base(appCtx, dataCtx, parent)
 {
     if (targetCalendar == null) throw new ArgumentNullException("targetCalendar");
     SelectedStartDate = selectedStartDate;
     InitialIsAllDay = isAllDay;
     TargetCalendar = targetCalendar;
 }
Esempio n. 12
0
        public FilterListViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, ObjectClass type, IFulltextSupport fulltextSupport = null)
            : base(appCtx, dataCtx, parent)
        {
            if (type == null) throw new ArgumentNullException("type");

            _type = type;
            _fulltextSupport = fulltextSupport;
        }
 public NavigationReportScreenViewModel(IViewModelDependencies appCtx,
     IZetboxContext dataCtx, ViewModel parent, NavigationScreen screen, IFileOpener fileOpener, ITempFileService tmpService)
     : base(appCtx, dataCtx, parent, screen)
 {
     _appCtx = appCtx;
     _fileOpener = fileOpener;
     _tmpService = tmpService;
 }
Esempio n. 14
0
        public ExceptionReporterViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, IProblemReporter problemReporter)
            : base(appCtx, dataCtx, parent)
        {
            if (problemReporter == null) throw new ArgumentNullException("problemReporter");

            this.problemReporter = problemReporter;
            this._exceptions = new List<Tuple<Exception, Bitmap>>();
        }
Esempio n. 15
0
        public CalendarItemViewModel(IViewModelDependencies dependencies, IZetboxContext dataCtx, ViewModel parent, IAppointmentViewModel obj)
            : base(dependencies, dataCtx, parent)
        {
            if (obj == null) throw new ArgumentNullException("obj");

            this.SlotWidth = this.OverlappingWidth = 1.0;
            this.ObjectViewModel = obj;
            this.ObjectViewModel.PropertyChanged += AppointmentViewModelChanged;
        }
Esempio n. 16
0
        public UICreator(IViewModelFactory vmf, IZetboxContext ctx, ViewModel parent)
        {
            if (vmf == null) throw new ArgumentNullException("vmf");
            if (ctx == null) throw new ArgumentNullException("ctx");

            ViewModelFactory = vmf;
            DataContext = ctx;
            Parent = parent;
        }
Esempio n. 17
0
        public ParameterInputTaskViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, Method method, Action<object[]> callback)
            : base(appCtx, dataCtx, parent)
        {
            if (callback == null) throw new ArgumentNullException("callback");

            _method = method;
            _callback = callback;
        }
Esempio n. 18
0
        public MergePropertyViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, BaseValueViewModel targetProp, BaseValueViewModel sourceProp)
            : base(appCtx, dataCtx, parent)
        {
            if (targetProp == null) throw new ArgumentNullException("targetProp");
            if (sourceProp == null) throw new ArgumentNullException("sourceProp");

            Target = targetProp;
            Source = sourceProp;
        }
        public ExceptionReporterViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, Exception ex, Bitmap screenShot, IProblemReporter problemReporter)
            : base(appCtx, dataCtx, parent)
        {
            if (problemReporter == null) throw new ArgumentNullException("problemReporter");

            this.exception = ex;
            this.screenShot = screenShot;
            this.problemReporter = problemReporter;
        }
Esempio n. 20
0
        public ValueInputTaskViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, string name, IList<BaseValueViewModel> valueModels, Action<object[]> callback)
            : base(appCtx, dataCtx, parent)
        {
            if (callback == null) throw new ArgumentNullException("callback");

            _valueModels = valueModels;
            _callback = callback;
            _name = name;
        }
Esempio n. 21
0
 public CustomPropertyGroupViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     string tagName, 
     string title,
     IEnumerable<ViewModel> lst)
     : base(appCtx, dataCtx, parent, tagName, title, lst)
 {
     // die fast
     if (lst.Count() != 1) throw new ArgumentException("lst may only contain exact one element", "lst");
 }
Esempio n. 22
0
        public NextEventsSummaryViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent)
            : base(appCtx, dataCtx, parent)
        {
            _fetchCache = new FetchCache(ViewModelFactory, DataContext, this);
            _syncContext = SynchronizationContext.Current;

            _timer = new System.Timers.Timer();
            _timer.Interval = 60 * 1000;
            _timer.Elapsed += new System.Timers.ElapsedEventHandler(_timer_Elapsed);
            _timer.Start();
        }
Esempio n. 23
0
 public DataObjectViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     IDataObject obj)
     : base(appCtx, dataCtx, parent)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     _object = obj;
     _object.PropertyChanged += Object_PropertyChanged;
     isReadOnlyStore = _object.IsReadonly;
     dataCtx.IsElevatedModeChanged += new EventHandler(dataCtx_IsElevatedModeChanged);
 }
Esempio n. 24
0
        public ActionViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, 
            IDataObject obj, Method m)
            : base(appCtx, dataCtx, parent, string.Empty, string.Empty)
        {
            if (obj == null) throw new ArgumentNullException("obj");
            if (m == null) throw new ArgumentNullException("m");

            Object = obj;
            Method = m;

            Method.PropertyChanged += MethodPropertyChanged;
        }
Esempio n. 25
0
        public void ShowModel(ViewModel mdl, Control parent)
        {
            // TODO: revive with new infrastructure
            //Layout lout = DataMocks.LookupDefaultLayout(mdl.GetType());
            //var vDesc = DataMocks.LookupViewDescriptor(Toolkit.WinForms, lout);
            //var formsView = (IFormsView)vDesc.ViewRef.Create();
            //formsView.SetRenderer(this);
            //formsView.SetDataContext(mdl);

            //var control = (Control)formsView;
            //// control.Dock = DockStyle.Fill;
            //parent.Controls.Add(control);
        }
Esempio n. 26
0
 public PropertyGroupViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     string title,
     IEnumerable<ViewModel> obj)
     : base(appCtx, dataCtx, parent)
 {
     _title = title;
     properties = new ObservableCollection<ViewModel>(obj);
     properties.CollectionChanged += PropertyListChanged;
     foreach (var prop in properties)
     {
         prop.PropertyChanged += AnyPropertyChangedHandler;
     }
 }
        private static DataTemplate SelectTemplate(ViewModel mdl, ControlKind controlKind, IFrozenContext frozenCtx)
        {
            var tr = GetTypeRef(mdl, frozenCtx);
            if (tr == null) return null;

            ViewModelDescriptor pmd = tr.GetViewModelDescriptor();
            if (pmd == null)
            {
                Logging.Log.ErrorFormat("No matching ViewModelDescriptor found for {0}", mdl.GetType());
                return null;
            }

            return CreateTemplate(pmd.GetViewDescriptor(Toolkit.WPF, controlKind));
        }
Esempio n. 28
0
        public ValueInputTaskViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent, string name,
                IEnumerable<ViewModel> items,
                IEnumerable<Tuple<object, BaseValueViewModel>> valueModels,
                Action<Dictionary<object, object>> callback)
            : base(appCtx, dataCtx, parent)
        {
            if (callback == null) throw new ArgumentNullException("callback");

            _items = items;
            _valueModels = valueModels;
            _callback = callback;
            _name = name;
        }
Esempio n. 29
0
        public ValidationError(ViewModel source)
        {
            this.Source = source;

            this.Errors = new ObservableCollection<string>();
            this.Errors.CollectionChanged += (s, e) =>
            {
                var temp = PropertyChanged;
                if (temp != null)
                {
                    temp(this, new PropertyChangedEventArgs("HasErrors"));
                }
            };
            this.Children = new ObservableCollection<ValidationError>();
        }
 private static TypeRef GetTypeRef(ViewModel mdl, IFrozenContext frozenCtx)
 {
     var tr = mdl.GetType().ToRef(frozenCtx);
     if (tr == null)
     {
         var mdlType = mdl.GetType();
         if (mdlType.IsGenericType)
         {
             Logging.Log.ErrorFormat("Unable to resolve TypeRef of given ViewModel '{0}'. You have to manually create a generic TypeRef.", mdlType);
         }
         else
         {
             Logging.Log.ErrorFormat("Unable to resolve TypeRef of given ViewModel '{0}'. Regenerate Assembly Refs.", mdlType);
         }
         return null;
     }
     return tr;
 }
Esempio n. 31
0
 public ZetboxDebuggerAsViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent)
     : base(appCtx, dataCtx, parent)
 {
     ZetboxContextDebuggerSingleton.SetDebugger(this);
 }