コード例 #1
0
        private void openwTreeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            mapTreeTerrain st = owTree.SelectedNode.Tag as mapTreeTerrain;

            //bs_mapTerrainType.DataSource = st.GetLeafNodes();
            //lblMasterPath.Text = st.Path(" \\ ");
            //this.BindingSource.Position = cEditor.BindingSource.IndexOf(st);

            //how to set BindingSource;
        }
コード例 #2
0
        public virtual void CreateLibMapping()
        {
            //Creates initial data for the default Medieaveal Mapset

            mapTreeTerrain mt = new mapTreeTerrain("Terrain Type Tree", 0);

            mapTileSetManager.InitmapTerrainTree(mt);
            i.Save(mt);

            //Create defaults using existing mTree
            mapTileSetManager ttm = new mapTileSetManager(i);

            ttm.Init(mt, null);

            foreach (mapTerrainType st in ttm.TerrainTypes)
            {
                this.Add(st);
            }
            foreach (mapPOIType sp in ttm.POITypes)
            {
                this.Add(sp);
            }
        }
コード例 #3
0
        private void bs_maptreeTerrain_CurrentChanged(object sender, EventArgs e)
        {
            mapTreeTerrain n = bs_maptreeTerrain.Current as mapTreeTerrain;

            bs_sysTerrainType.DataSource = n.TerrainTypes;
        }
コード例 #4
0
        protected virtual void defEventCurrentChanged(object sender, EventArgs e)
        {
            switch (_currentTree)
            {
            case mapConst.mapTreeNamePOI:
                mapTreePOI mP = this.TreeBindingSource.Current as mapTreePOI;
                if (mP != null && this._DetailBindingSource != null)
                {
                    this._DetailBindingSource.DataSource = mP.POITypes;
                }
                else
                {
                    this._DetailBindingSource.List.Clear();
                }
                break;

            case mapConst.mapTreeNameTerrain:
                mapTreeTerrain mT = this.TreeBindingSource.Current as mapTreeTerrain;
                if (this._DetailBindingSource != null)
                {
                    if (mT != null)
                    {
                        this._DetailBindingSource.DataSource = mT.TerrainTypes;
                    }
                    else
                    {
                        this._DetailBindingSource.List.Clear();
                    }
                }
                break;

            case nwdbConst.sysTreeNameDevelopment:
                //Do devStuff
                break;

            case nwdbConst.sysTreeNameStatistic:
                //Do StatStuff
                break;

            case nwdbConst.sysTreeNameItemType:
                //Do ItemStuff
                break;

            case campConst.campTreeNameFaction:
                //Do Faction Stuff
                break;

            case campConst.campTreeNameLocation:
                //Do LocationStuff
                break;

            case campConst.campTreeNameMilestone:
                //Do Milestone
                break;

            case "":
                Debug.Print("No tree Loaded");

                break;

            default:
                throw new ApplicationException("Error in TreeControl:defEventCurrentChanged:_currentTree is invalid:" + _currentTree);
            }
        }