示例#1
0
        /// <summary>
        /// Select a List Item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Select(object sender, System.EventArgs e)
        {
            if (lblist.Tag != null)
            {
                return;
            }
            gbsettings.Enabled = false;
            btdelete.Enabled   = false;
            if (lblist.SelectedIndex < 0)
            {
                return;
            }
            gbsettings.Enabled = true;
            btdelete.Enabled   = true;

            lblist.Tag = true;
            try
            {
                SimPe.Packages.S2CPDescriptor s2cp = (SimPe.Packages.S2CPDescriptor)lblist.Items[lblist.SelectedIndex];

                tbname.Text     = s2cp.Name;
                tbguid.Text     = s2cp.Guid;
                tbauthor.Text   = s2cp.Author;
                tbdesc.Text     = s2cp.Description;
                tbver.Text      = s2cp.ObjectVersion;
                tbcontact.Text  = s2cp.Contact;
                tbgameguid.Text = s2cp.GameGuid;
                tbtitle.Text    = s2cp.Title;

                cbcompress.SelectedIndex = cbcompress.Items.Count - 1;
                for (int i = 0; i < cbcompress.Items.Count; i++)
                {
                    Sims2CommunityPack.CompressionStrength cs = (Sims2CommunityPack.CompressionStrength)cbcompress.Items[i];
                    if (cs == s2cp.Compressed)
                    {
                        cbcompress.SelectedIndex = i;
                        break;
                    }
                }


                UpdateDepText(s2cp);
            }
            catch (Exception ex)
            {
                Helper.ExceptionMessage("", ex);
            }
            finally
            {
                lblist.Tag = null;
            }
        }
示例#2
0
        /// <summary>
        /// Creates a new Insttance
        /// </summary>
        /// <param name="p">The Package this Object describes</param>
        /// <param name="author">Author of this Package</param>
        /// <param name="contact">How to contact the Autor</param>
        /// <param name="title">Title of this Package</param>
        /// <param name="description">Description for the Package</param>
        /// <param name="compressed">true if this Package should be stored compressed</param>
        /// <param name="extension">true, if you wnt to use the Community Extionsins (Will create a textFile in the Package if needed)</param>
        /// <param name="dependency">Objects this one depends on</param>
        public S2CPDescriptor(GeneratableFile p, string author, string contact, string title, string description, Sims2CommunityPack.CompressionStrength compressed, S2CPDescriptorBase[] dependency, bool extension)
            : base(p)
        {
            type             = "Object";
            gameversion      = "2141707388.153.1";
            this.description = description;
            this.compressed  = compressed;
            objectversion    = "1.0";
            crc          = "0";
            this.author  = author;
            this.contact = contact;
            this.title   = title;
            gameguid     = this.GameGuid;

            if (dependency == null)
            {
                dep = new S2CPDescriptorBase[0];
            }
            else
            {
                dep = dependency;
            }

            if (extension)
            {
                if (p != null)
                {
                    guid = GetSetGlobalGuid(p, ref name, ref this.title, ref this.author, ref this.contact, ref this.description, ref gameguid);
                }
            }
        }