コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: ILabeledViewModel.cs プロジェクト: daszat/zetbox
 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;
 }
コード例 #3
0
 public MultiplePropertyGroupViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     string title,
     IEnumerable<ViewModel> obj)
     : base(appCtx, dataCtx, parent, title, obj)
 {
 }
コード例 #4
0
ファイル: DataTypeViewModel.cs プロジェクト: daszat/zetbox
 public DataTypeViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     DataType dt)
     : base(appCtx, dataCtx, parent, dt)
 {
     _dataType = dt;
 }
コード例 #5
0
 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);
 }
コード例 #6
0
ファイル: ObjectClassViewModel.cs プロジェクト: daszat/zetbox
 public ObjectClassViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     ObjectClass cls)
     : base(appCtx, dataCtx, parent, cls)
 {
     _class = cls;
 }
コード例 #7
0
ファイル: WpfDelayedTask.cs プロジェクト: jrgcubano/zetbox
        public WpfDelayedTask(ViewModel displayer, Action task)
        {
            if (task == null) throw new ArgumentNullException("task");

            _displayer = displayer;
            _task = task;
        }
コード例 #8
0
 public SimpleDataObjectEditorTaskViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     ViewModel obj)
     : base(appCtx, dataCtx, parent)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     this.Object = obj;
 }
コード例 #9
0
 public CustomPropertyListGroupViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     string tagName,
     string title,
     IEnumerable<ViewModel> lst)
     : base(appCtx, dataCtx, parent, tagName, title, lst)
 {
 }
コード例 #10
0
 public CompoundObjectViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     ICompoundObject obj)
     : base(appCtx, dataCtx, parent)
 {
     _object = obj;
     _object.PropertyChanged += ObjectPropertyChanged;
 }
コード例 #11
0
ファイル: EventInputViewModel.cs プロジェクト: daszat/zetbox
 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;
 }
コード例 #12
0
ファイル: FilterListViewModel.cs プロジェクト: daszat/zetbox
        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;
        }
コード例 #13
0
 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;
 }
コード例 #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>>();
        }
コード例 #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;
        }
コード例 #16
0
ファイル: UICreator.cs プロジェクト: daszat/zetbox
        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;
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #19
0
        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;
        }
コード例 #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;
        }
コード例 #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");
 }
コード例 #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();
        }
コード例 #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);
 }
コード例 #24
0
ファイル: ActionViewModel.cs プロジェクト: jrgcubano/zetbox
        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;
        }
コード例 #25
0
ファイル: Renderer.cs プロジェクト: jrgcubano/zetbox
        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);
        }
コード例 #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;
     }
 }
コード例 #27
0
        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));
        }
コード例 #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;
        }
コード例 #29
0
ファイル: ValidationManager.cs プロジェクト: daszat/zetbox
        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>();
        }
コード例 #30
0
 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;
 }
コード例 #31
0
 public ZetboxDebuggerAsViewModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent)
     : base(appCtx, dataCtx, parent)
 {
     ZetboxContextDebuggerSingleton.SetDebugger(this);
 }