Exemple #1
0
 private DataObjectViewModel GetObjectFromProxy(DataObjectViewModelProxy p)
 {
     if (p.Object == null)
     {
         var obj = DataContext.Create(DataContext.GetInterfaceType(this.ReferencedClass.GetDataType()));
         p.Object = DataObjectViewModel.Fetch(ViewModelFactory, DataContext, ViewModelFactory.GetWorkspace(DataContext), obj);
         _proxyCache[p.Object.Object] = p;
     }
     return(p.Object);
 }
Exemple #2
0
        private DataObjectViewModelProxy GetProxy(IDataObject obj)
        {
            DataObjectViewModelProxy result;

            if (!_proxyCache.TryGetValue(obj, out result))
            {
                result = new DataObjectViewModelProxy()
                {
                    Object = DataObjectViewModel.Fetch(ViewModelFactory, DataContext, ViewModelFactory.GetWorkspace(DataContext), obj)
                };
                _proxyCache[obj] = result;
            }
            return(result);
        }