Пример #1
0
        private void FileImport_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Importing an artifact file will clear any changes you have made to the item shown.", "Masterplan", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }
            OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Title  = "Import Artifact",
                Filter = Program.ArtifactFilter
            };

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Masterplan.Data.Artifact artifact = Serialisation <Masterplan.Data.Artifact> .Load(openFileDialog.FileName, SerialisationMode.Binary);

                if (artifact != null)
                {
                    this.fArtifact = artifact;
                    this.update_statblock();
                    return;
                }
                MessageBox.Show("The artifact could not be imported.", "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Пример #2
0
 private bool match_token(Masterplan.Data.Artifact item, string token)
 {
     if (item.Name.ToLower().Contains(token))
     {
         return(true);
     }
     return(false);
 }
Пример #3
0
 public ArtifactProfileForm(Masterplan.Data.Artifact artifact)
 {
     this.InitializeComponent();
     this.fArtifact = artifact;
     foreach (Tier value in Enum.GetValues(typeof(Tier)))
     {
         this.TierBox.Items.Add(value);
     }
     this.NameBox.Text         = this.fArtifact.Name;
     this.TierBox.SelectedItem = this.fArtifact.Tier;
 }
Пример #4
0
 private bool match(Masterplan.Data.Artifact item, string query)
 {
     string[] strArrays = query.ToLower().Split(new char[0]);
     for (int i = 0; i < (int)strArrays.Length; i++)
     {
         if (!this.match_token(item, strArrays[i]))
         {
             return(false);
         }
     }
     return(true);
 }
Пример #5
0
 public Parcel(Artifact artifact)
 {
     this.SetAsArtifact(artifact);
 }
Пример #6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="artifact">The artifact to create the parcel with.</param>
 public Parcel(Artifact artifact)
 {
     SetAsArtifact(artifact);
 }
Пример #7
0
 public ArtifactBuilderForm(Masterplan.Data.Artifact artifact)
 {
     this.InitializeComponent();
     this.fArtifact = artifact.Copy();
     this.update_statblock();
 }