private void Button_Click(object sender, RoutedEventArgs e) { try { //open file from a directory OpenFileDialog FileDialog = new OpenFileDialog(); FileDialog.Filter = "Word File (.docx ,.doc)|*.docx;*.doc"; if (FileDialog.ShowDialog() == true) { FilePathStr = FileDialog.FileName; } FilePath.Text = FilePathStr; //create a work copy and validate .doc/.docx WordAsXML helper = new WordAsXML(); if (isCopyNeed.IsChecked == true) { FilePathStr = helper.CreateDocCopy(FilePathStr); } isFileDoc = helper.ValidateFile(FilePathStr); if (isFileDoc) { FilePathStr = helper.ConvertDocToDocx(FilePathStr); } //count file spaces and print the result ContainerSize = helper.ContainerSize(FilePathStr); containerSizeField.Text = ContainerSize.ToString(); } catch (Exception ex) { statusField.Text += ex.Message + "\n"; } }
public ModdedItem(string Name, bool IsBigCraftable, bool HasQualities, ContainerSize Size) { this.Name = Name; this.IsBigCraftable = IsBigCraftable; this.HasQualities = HasQualities; this.SizeString = Size.ToString(); this.ObjectId = null; }
/// <param name="Size">Must be a Size within <see cref="ValidSizes"/></param> public BundleBag(ContainerSize Size, bool Autofill) : base(ItemBagsMod.Translate("BundleBagName"), ItemBagsMod.Translate("BundleBagDescription"), Size, true) { if (!ValidSizes.Contains(Size)) { throw new InvalidOperationException(string.Format("Size '{0}' is not valid for BundleBag types", Size.ToString())); } this.Autofill = Autofill; }