Ejemplo n.º 1
0
        private Collection <CswNbtNodeKey> _loadNodeAsChildFromRow(CswNbtNodeKey ParentNodeKey, DataRow DataRowToAdd,
                                                                   bool UseGrouping, string GroupName,
                                                                   CswNbtViewRelationship Relationship, bool Selectable,
                                                                   bool ShowInTree,
                                                                   CswEnumNbtViewAddChildrenSetting AddChildren, Int32 RowCount,
                                                                   bool Included = true, bool Favorited = false)
        {
            CswNbtMetaDataNodeType NodeType = _CswNbtResources.MetaData.getNodeType(CswConvert.ToInt32(DataRowToAdd[_CswNbtColumnNames.NodeTypeId.ToLower()].ToString()));

            //string TableName = NodeType.TableName;
            //string PkColumnName = _CswNbtResources.getPrimeKeyColName( TableName );

            return(_loadNodeAsChild(ParentNodeKey, UseGrouping, GroupName, Relationship, Selectable, ShowInTree,
                                    AddChildren, RowCount, Included,
                                    DataRowToAdd[_CswNbtColumnNames.IconFileName.ToLower()].ToString(),
                                    DataRowToAdd[_CswNbtColumnNames.NameTemplate.ToLower()].ToString(),
                                    new CswPrimaryKey("nodes", CswConvert.ToInt32(DataRowToAdd["nodeid"])),
                                    new CswPrimaryKey(CswConvert.ToString(DataRowToAdd["relationaltable"]), CswConvert.ToInt32(DataRowToAdd["relationalid"])),
                                    DataRowToAdd[_CswNbtColumnNames.NodeName.ToLower()].ToString(),
                                    CswConvert.ToInt32(DataRowToAdd[_CswNbtColumnNames.NodeTypeId.ToLower()].ToString()),
                                    DataRowToAdd[_CswNbtColumnNames.NodeTypeName.ToLower()].ToString(),
                                    CswConvert.ToInt32(DataRowToAdd[_CswNbtColumnNames.ObjectClassId.ToLower()].ToString()),
                                    DataRowToAdd[_CswNbtColumnNames.ObjectClassName.ToLower()].ToString(),
                                    CswConvert.ToBoolean(DataRowToAdd[_CswNbtColumnNames.Locked.ToLower()]),
                                    Favorited
                                    ));
        }
Ejemplo n.º 2
0
 public Collection <CswNbtNodeKey> loadNodeAsChildFromRow(CswNbtNodeKey ParentNodeKey, DataRow DataRowToAdd,
                                                          bool UseGrouping, string GroupName, bool Selectable,
                                                          bool ShowInTree, CswEnumNbtViewAddChildrenSetting AddChildren,
                                                          Int32 RowCount, bool Included = true, bool Favorited = false)
 {
     return(_loadNodeAsChildFromRow(ParentNodeKey, DataRowToAdd, UseGrouping, GroupName, null, Selectable,
                                    ShowInTree, AddChildren, RowCount, Included, Favorited));
 }
Ejemplo n.º 3
0
        public Collection <CswNbtNodeKey> _loadNodeAsChild(CswNbtNodeKey ParentNodeKey, bool UseGrouping,
                                                           string GroupName, CswNbtViewRelationship Relationship,
                                                           bool Selectable, bool ShowInTree,
                                                           CswEnumNbtViewAddChildrenSetting AddChildren, Int32 RowCount,
                                                           bool Included,
                                                           string IconFileName, string NameTemplate,
                                                           CswPrimaryKey NodeId, CswPrimaryKey RelationalId, string NodeName, Int32 NodeTypeId,
                                                           string NodeTypeName, Int32 ObjectClassId,
                                                           string ObjectClassName, bool Locked, bool Favorited)
        {
            Collection <CswNbtNodeKey> ReturnKeyColl = new Collection <CswNbtNodeKey>();

            CswNbtTreeNode ParentNode = null;

            ParentNode = _CurrentNode ?? _TreeNode;

            Collection <CswNbtTreeNode> ParentNodes = new Collection <CswNbtTreeNode>();

            if (false == UseGrouping)
            {
                ParentNodes.Add(ParentNode);
            }
            else
            {
                // Interpret commas to denote multiple groups
                string GroupNameForLoop = GroupName;
                string ThisGroupName    = GroupName;
                do
                {
                    if (GroupNameForLoop.IndexOf(',') >= 0)
                    {
                        ThisGroupName    = GroupNameForLoop.Substring(0, GroupNameForLoop.IndexOf(',')).Trim();
                        GroupNameForLoop = GroupNameForLoop.Substring(GroupNameForLoop.IndexOf(',') + 1).Trim();
                    }
                    else
                    {
                        ThisGroupName    = GroupNameForLoop.Trim();
                        GroupNameForLoop = string.Empty;
                    }

                    CswNbtTreeNode MatchingGroup = _getMatchingGroup(ParentNode, ThisGroupName);
                    if (MatchingGroup == null)
                    {
                        CswNbtNodeKey MatchingGroupKey = null;
                        _makeNbtTreeNode(ParentNode,
                                         Elements.Group,
                                         null,
                                         ThisGroupName,
                                         Int32.MinValue,
                                         Int32.MinValue,
                                         "group.gif",
                                         false,
                                         Relationship,
                                         CswEnumNbtNodeSpecies.Group,
                                         true,
                                         false,
                                         true,
                                         false,
                                         null,
                                         out MatchingGroup,
                                         out MatchingGroupKey);
                    }

                    if (MatchingGroup != null)
                    {
                        ParentNodes.Add(MatchingGroup);
                    }
                } // do
                while(GroupNameForLoop != string.Empty);
            }     // if-else( !UseGrouping )


            foreach (CswNbtTreeNode ThisParentNode in ParentNodes)
            {
                CswNbtNodeKey  ThisKey  = null;
                CswNbtTreeNode ThisNode = null;
                _makeNbtTreeNode(ThisParentNode,
                                 Elements.Node,
                                 NodeId,
                                 NodeName,
                                 NodeTypeId,
                                 ObjectClassId,
                                 IconFileName,
                                 Selectable,
                                 Relationship,
                                 CswEnumNbtNodeSpecies.Plain,
                                 ShowInTree,
                                 Locked,
                                 Included,
                                 Favorited,
                                 RelationalId,
                                 out ThisNode,
                                 out ThisKey);
                ReturnKeyColl.Add(ThisKey);
            }

            return(ReturnKeyColl);
        }