Exemplo n.º 1
0
        public LibraryForm(Masterplan.Data.Library lib)
        {
            this.InitializeComponent();
            this.fLibrary = lib;
            string userName     = SystemInformation.UserName;
            string computerName = SystemInformation.ComputerName;
            Label  infoLbl      = this.InfoLbl;

            string[] strArrays = new string[] { "Note that when you create a library it will be usable only by this user (", userName, ") on this computer (", computerName, ")." };
            infoLbl.Text      = string.Concat(strArrays);
            this.NameBox.Text = this.fLibrary.Name;
            this.NameBox_TextChanged(null, null);
        }
Exemplo n.º 2
0
        private void add_library(Masterplan.Data.Library library)
        {
            switch (this.fSource)
            {
            case DemographicsSource.Creatures:
            {
                List <Creature> .Enumerator enumerator = library.Creatures.GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        Creature current = enumerator.Current;
                        switch (this.fMode)
                        {
                        case DemographicsMode.Level:
                        {
                            this.@add(current.Level.ToString());
                            continue;
                        }

                        case DemographicsMode.Role:
                        case DemographicsMode.Status:
                        {
                            this.analyse_role(current.Role);
                            continue;
                        }

                        default:
                        {
                            continue;
                        }
                        }
                    }
                    break;
                }
                finally
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }

            case DemographicsSource.Traps:
            {
                List <Trap> .Enumerator enumerator1 = library.Traps.GetEnumerator();
                try
                {
                    while (enumerator1.MoveNext())
                    {
                        Trap trap = enumerator1.Current;
                        switch (this.fMode)
                        {
                        case DemographicsMode.Level:
                        {
                            this.@add(trap.Level.ToString());
                            continue;
                        }

                        case DemographicsMode.Role:
                        case DemographicsMode.Status:
                        {
                            this.analyse_role(trap.Role);
                            continue;
                        }

                        default:
                        {
                            continue;
                        }
                        }
                    }
                    break;
                }
                finally
                {
                    ((IDisposable)enumerator1).Dispose();
                }
            }

            case DemographicsSource.MagicItems:
            {
                List <MagicItem> .Enumerator enumerator2 = library.MagicItems.GetEnumerator();
                try
                {
                    while (enumerator2.MoveNext())
                    {
                        MagicItem magicItem = enumerator2.Current;
                        if (this.fMode != DemographicsMode.Level)
                        {
                            continue;
                        }
                        this.@add(magicItem.Level.ToString());
                    }
                    break;
                }
                finally
                {
                    ((IDisposable)enumerator2).Dispose();
                }
            }

            default:
            {
                return;
            }
            }
        }