コード例 #1
0
        ///// <summary>
        ///// Initializes a new instance of the <see cref="freeGraphAdapter{TNode}"/> class.
        ///// </summary>
        ///// <param name="_mainPrefix">The main prefix.</param>
        ///// <param name="prefixes">The prefixes.</param>
        //public freeGraphAdapter(String _mainPrefix, String[] prefixes)
        //{
        //    Deploy(new freeGraph(), null, _mainPrefix, prefixes);
        //}

        private void Deploy(freeGraph _graph, freeGraphTypedNodesRegister _source, String _mainPrefix, String[] prefixes)
        {
            graph = _graph;
            Int32 c = 0;

            mainPrefix = _mainPrefix.or("OBJ_");

            source = _source;
            if (source == null)
            {
                source = new freeGraphTypedNodesRegister();
            }

            if (prefixes == null)
            {
                return;
            }
            typePrefixes.Add(c, mainPrefix);

            c++;
            foreach (String p in prefixes)
            {
                typePrefixes.Add(c, p);
                c++;
            }
        }
コード例 #2
0
        //public freeGraphLinkBase AddLink(IObjectWithNameWeightAndType NodeA, IObjectWithNameWeightAndType NodeB, Double w = 1, Int32 type = 0, operation onWeight = operation.assign, operation onType = operation.assign)
        //{

        //}

        //public List<freeGraphLinkBase> AddLinks(IObjectWithNameWeightAndType NodeA, IEnumerable<IObjectWithNameWeightAndType> NodeBs, Double w = 1, Int32 type = 0, operation onWeight = operation.assign, operation onType = operation.assign)
        //{

        //}

        /// <summary>
        /// Initializes a new instance of the <see cref="freeGraphAdapter{TNodeA}" /> class, attaches the graph and assigns prefixes for IDs of nodes, according to type number
        /// </summary>
        /// <param name="_graph">The graph.</param>
        /// <param name="_source">Source collection.</param>
        /// <param name="_mainPrefix">Main prefix for this type</param>
        /// <param name="prefixes">Prefixes for types</param>
        public freeGraphAdapter(freeGraph _graph, freeGraphTypedNodesRegister _source, String _mainPrefix, String[] prefixes)
        {
            Deploy(_graph, _source, _mainPrefix, prefixes);
        }