public static void Initialize(ICswResources CswResources, CswNbtExplorerReturn Return, CswNbtExplorerRequest Request)
        {
            CswNbtResources NbtResources = (CswNbtResources)CswResources;
            CswPrimaryKey   NodeId       = CswConvert.ToPrimaryKey(Request.NodeId);

            if (Request.Depth <= 4 || Request.Depth > 0)  //We never want a request higher than 4 and 0 doesn't make sense
            {
                MAX_DEPTH = Request.Depth;
            }

            FilterVal = new CswCommaDelimitedString();
            if (String.IsNullOrEmpty(Request.FilterVal))
            {
                FilterVal.FromString(CswNbtArborGraph._setDefaultFilterVal(NbtResources));
            }
            else
            {
                FilterVal.FromString(Request.FilterVal);
            }


            StartingNode = NbtResources.Nodes[NodeId];
            CswNbtMetaDataNodeType startingNT = StartingNode.getNodeType();

            //Add the initial node to the graph
            _addToGraph(Return, StartingNode.NodeName, string.Empty, NodeId.ToString(), startingNT.IconFileName, 0, "Instance", NodeId.ToString(), startingNT.NodeTypeName, Int32.MinValue);

            _recurseForRelatingNodes(NbtResources, Return, StartingNode, 1, NodeId.ToString());

            _recurseForRelatedNTs(NbtResources, Return, StartingNode.NodeTypeId, 1, NodeId.ToString());
        }
        public static void GetFilterOpts(ICswResources CswResources, CswNbtExplorerReturn Return, string Request)
        {
            CswNbtResources NbtResources = (CswNbtResources)CswResources;

            CswCommaDelimitedString ValsCDS = new CswCommaDelimitedString();

            Return.Data.FilterVal = CswNbtArborGraph._setDefaultFilterVal(NbtResources);
            ValsCDS.FromString(Return.Data.FilterVal);

            foreach (CswNbtMetaDataNodeType NodeType in NbtResources.MetaData.getNodeTypes())
            {
                Return.Data.Opts.Add(new ArborFilterOpt()
                {
                    selected = ValsCDS.Contains("NT_" + NodeType.NodeTypeId),
                    text     = NodeType.NodeTypeName,
                    value    = "NT_" + NodeType.NodeTypeId.ToString()
                });
            }

            foreach (CswNbtMetaDataObjectClass ObjClass in NbtResources.MetaData.getObjectClasses())
            {
                Return.Data.Opts.Add(new ArborFilterOpt()
                {
                    selected = ValsCDS.Contains("OC_" + ObjClass.ObjectClassId.ToString()),
                    text     = ObjClass.ObjectClassName,
                    value    = "OC_" + ObjClass.ObjectClassId.ToString()
                });
            }
        }
Exemplo n.º 3
0
 public CswNbtExplorerReturn()
 {
     Data = new CswNbtArborGraph();
 }