InitializeFromTypeAndPath() private method

Attempts to initialize a ModelSource with the specified root type and path.
private InitializeFromTypeAndPath ( ModelType rootType, string path, ModelProperty &sourceProperty ) : bool
rootType ModelType The root type name, which is required for instance paths
path string The source path, which is either an instance path or a static path
sourceProperty ModelProperty
return bool
Ejemplo n.º 1
0
 /// <summary>
 /// Attempts to create a new <see cref="ModelSource"/> for the specified root type and path.
 /// </summary>
 /// <param name="rootType">The root type name, which is required for instance paths</param>
 /// <param name="path">The source path, which is either an instance path or a static path</param>
 /// <returns>True if the source was created, otherwise false</returns>
 public static bool TryGetSource(ModelType rootType, string path, out ModelSource source, out ModelProperty sourceProperty)
 {
     source = new ModelSource();
     if (source.InitializeFromTypeAndPath(rootType, path, out sourceProperty))
     {
         return(true);
     }
     else
     {
         source = null;
         return(false);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Attempts to create a new <see cref="ModelSource"/> for the specified root type and path.
 /// </summary>
 /// <param name="rootType">The root type name, which is required for instance paths</param>
 /// <param name="path">The source path, which is either an instance path or a static path</param>
 /// <returns>True if the source was created, otherwise false</returns>
 public static bool TryGetSource(ModelType rootType, string path, out ModelSource source, out ModelProperty sourceProperty)
 {
     source = new ModelSource();
     if (source.InitializeFromTypeAndPath(rootType, path, out sourceProperty))
         return true;
     else
     {
         source = null;
         return false;
     }
 }