/// <summary> /// Returns object type name for the given hierarchy item. /// </summary> /// <param name="hierarchy">Server explorer facade object to be used for Server Explorer hierarchy interaction.</param> /// <param name="item">Item identifier.</param> /// <returns> /// Returns object type name for the given hierarchy item. /// </returns> protected override string GetObjectType(ServerExplorerFacade hierarchy, int item) { if (hierarchy == null) { throw new ArgumentNullException("hierarchy"); } if (item < 0) { throw new ArgumentOutOfRangeException("item"); } return(hierarchy.GetObjectType(item)); }
/// <summary> /// Checks object type for the given node using document/view factory and returns /// it if checking succeeds. /// </summary> /// <param name="hierarchy">Server explorer facade object to be used for Server Explorer hierarchy interaction.</param> /// <param name="item">Item identifier.</param> /// <returns> /// Returns object type name, which should be used to create document /// and view objects instances. /// </returns> protected override string GetObjectType(ServerExplorerFacade hierarchy, int item) { if (hierarchy == null) throw new ArgumentNullException("hierarchy"); if (item < 0) throw new ArgumentOutOfRangeException("item"); // Get object type for given node string typeName = hierarchy.GetObjectType(item); // Checks object type using factory if (!String.IsNullOrEmpty(typeName) && DocumentViewFactory.Instance.IsObjectTypeRegistered(typeName)) return typeName; return null; }
/// <summary> /// Checks object type for the given node using document/view factory and returns /// it if checking succeeds. /// </summary> /// <param name="hierarchy">Server explorer facade object to be used for Server Explorer hierarchy interaction.</param> /// <param name="item">Item identifier.</param> /// <returns> /// Returns object type name, which should be used to create document /// and view objects instances. /// </returns> protected override string GetObjectType(ServerExplorerFacade hierarchy, int item) { if (hierarchy == null) { throw new ArgumentNullException("hierarchy"); } if (item < 0) { throw new ArgumentOutOfRangeException("item"); } // Get object type for given node string typeName = hierarchy.GetObjectType(item); // Checks object type using factory if (!String.IsNullOrEmpty(typeName) && DocumentViewFactory.Instance.IsObjectTypeRegistered(typeName)) { return(typeName); } return(null); }
/// <summary> /// Checks object type for the given node (must be Table or View) and returns TableData /// it if checking succeeds. /// </summary> /// <param name="hierarchy">Server explorer facade object to be used for Server Explorer hierarchy interaction.</param> /// <param name="item">Item identifier.</param> /// <returns> /// Returns TableData if object type name of given hierarchy item is Table or View. /// Otherwize returns null. /// </returns> protected override string GetObjectType(ServerExplorerFacade hierarchy, int item) { if (hierarchy == null) { throw new ArgumentNullException("hierarchy"); } if (item < 0) { throw new ArgumentOutOfRangeException("item"); } // Get type of the current node string typeName = hierarchy.GetObjectType(item); // If this is a table or a view, data editing is supported. if (DataInterpreter.CompareInvariant(typeName, TableDescriptor.TypeName) || DataInterpreter.CompareInvariant(typeName, ViewDescriptor.TypeName)) { return(TableDataDescriptor.TypeName); } // Else data editing is not supported return(null); }
/// <summary> /// Returns object type name for the given hierarchy item. /// </summary> /// <param name="hierarchy">Server explorer facade object to be used for Server Explorer hierarchy interaction.</param> /// <param name="item">Item identifier.</param> /// <returns> /// Returns object type name for the given hierarchy item. /// </returns> protected override string GetObjectType(ServerExplorerFacade hierarchy, int item) { if (hierarchy == null) throw new ArgumentNullException("hierarchy"); if (item < 0) throw new ArgumentOutOfRangeException("item"); return hierarchy.GetObjectType(item); }
/// <summary> /// Checks object type for the given node (must be Table or View) and returns TableData /// it if checking succeeds. /// </summary> /// <param name="hierarchy">Server explorer facade object to be used for Server Explorer hierarchy interaction.</param> /// <param name="item">Item identifier.</param> /// <returns> /// Returns TableData if object type name of given hierarchy item is Table or View. /// Otherwize returns null. /// </returns> protected override string GetObjectType(ServerExplorerFacade hierarchy, int item) { if (hierarchy == null) throw new ArgumentNullException("hierarchy"); if (item < 0) throw new ArgumentOutOfRangeException("item"); // Get type of the current node string typeName = hierarchy.GetObjectType(item); // If this is a table or a view, data editing is supported. if (DataInterpreter.CompareInvariant(typeName, TableDescriptor.TypeName) || DataInterpreter.CompareInvariant(typeName, ViewDescriptor.TypeName)) return TableDataDescriptor.TypeName; // Else data editing is not supported return null; }