예제 #1
0
 /// <summary>
 /// When implemented in a derived class, loads a dataset from
 /// a store specific to that schema manager.
 /// </summary>
 /// <param name="datasetName"></param>
 /// <returns></returns>
 /// <remarks>
 /// The default schema manager does not support loading datasets
 /// on the fly, only using datasets that have been added manually.
 /// </remarks>
 private void OnDatasetLoading(object sender, LazyItemLoadingEventArgs <string, DatasetBase> e)
 {
     try
     {
         e.Value   = LoadDataset(e.Key);
         e.IsFound = true;
     }
     catch (Exception)
     {
         e.IsFound = false;
     }
 }
예제 #2
0
        private void OnObjectLoading <T>(object sender, LazyItemLoadingEventArgs <string, T> e)
            where T : DatabaseObject, new()
        {
            T obj = new T();

            obj.Dataset = this;
            GetNamePartsFromObjectUniqueKey(obj, e.Key);

            try
            {
                LoadObject <T>(obj);

                e.Value   = obj;
                e.Key     = GetObjectUniqueKey(obj);
                e.IsFound = true;
            }
            catch (SchemaException)
            {
                e.IsFound = false;
            }
        }
예제 #3
0
 /// <summary>
 /// When implemented in a derived class, loads a dataset from
 /// a store specific to that schema manager.
 /// </summary>
 /// <param name="datasetName"></param>
 /// <returns></returns>
 /// <remarks>
 /// The default schema manager does not support loading datasets
 /// on the fly, only using datasets that have been added manually.
 /// </remarks>
 private void OnDatasetLoading(object sender, LazyItemLoadingEventArgs<string, DatasetBase> e)
 {
     try
     {
         e.Value = LoadDataset(e.Key);
         e.IsFound = true;
     }
     catch (Exception)
     {
         e.IsFound = false;
     }
 }