Esempio n. 1
0
 private void btnThingListSaveImages_Click(object sender, EventArgs e)
 {
     this.PrepareFolderBrowser(I18N.GetText("Description:BrowseImageExportFolder"));
     if (this.dlgBrowseFolder.ShowDialog() == DialogResult.OK)
     {
         PleaseWaitDialog PWD = new PleaseWaitDialog(I18N.GetText("Dialog:SaveAllImages"));
         Thread           T   = new Thread(new ThreadStart(delegate()
         {
             Application.DoEvents();
             foreach (IThing X in this.LoadedThings_)
             {
                 Image I = X.GetIcon();
                 // FIXME: Assumes no IThing has more than one image
                 if (I != null)
                 {
                     string ImageFileName = X.ToString() + ".png";
                     foreach (char C in Path.GetInvalidFileNameChars())
                     {
                         ImageFileName = ImageFileName.Replace(C, '_');
                     }
                     I.Save(Path.Combine(this.dlgBrowseFolder.SelectedPath, ImageFileName), ImageFormat.Png);
                 }
                 Application.DoEvents();
             }
             PWD.Invoke(new AnonymousMethod(delegate() { PWD.Close(); }));
         }));
         T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
         T.Start();
         PWD.ShowDialog(this);
         this.Activate();
         PWD.Dispose();
         PWD = null;
     }
 }
Esempio n. 2
0
        private void LoadItems(string FileName, ItemEditor IE)
        {
            this.PWD = new PleaseWaitDialog(I18N.GetText("Dialog:LoadItems"));
            Thread T = new Thread(new ThreadStart(delegate() { this.LoadItemsWorker(FileName, IE); }));

            T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
            T.Start();
            PWD.ShowDialog(this);
            this.Activate();
            this.PWD.Dispose();
            this.PWD = null;
            this.EnableNavigation();
            this.MarkItemChanges();
        }
Esempio n. 3
0
        private void RemoveUnchangedItems()
        {
            this.btnRemoveUnchanged.Enabled = false;
            this.PWD = new PleaseWaitDialog(I18N.GetText("Dialog:RemoveUnchanged"));
            Thread T = new Thread(new ThreadStart(delegate() { this.RemoveUnchangedItemsWorker(); }));

            T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
            T.Start();
            PWD.ShowDialog(this);
            this.Activate();
            this.PWD.Dispose();
            this.PWD = null;
            this.EnableNavigation();
            this.MarkItemChanges();
        }
Esempio n. 4
0
 private void RemoveUnchangedItems()
 {
     this.btnRemoveUnchanged.Enabled = false;
       this.PWD = new PleaseWaitDialog(I18N.GetText("Dialog:RemoveUnchanged"));
     Thread T = new Thread(new ThreadStart(delegate() { this.RemoveUnchangedItemsWorker(); }));
       T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
       T.Start();
       PWD.ShowDialog(this);
       this.Activate();
       this.PWD.Dispose();
       this.PWD = null;
       this.EnableNavigation();
       this.MarkItemChanges();
 }
Esempio n. 5
0
 private void LoadItems(string FileName, ItemEditor IE)
 {
     this.PWD = new PleaseWaitDialog(I18N.GetText("Dialog:LoadItems"));
     Thread T = new Thread(new ThreadStart(delegate() { this.LoadItemsWorker(FileName, IE); }));
       T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
       T.Start();
       PWD.ShowDialog(this);
       this.Activate();
       this.PWD.Dispose();
       this.PWD = null;
       this.EnableNavigation();
       this.MarkItemChanges();
 }
Esempio n. 6
0
 private void btnThingListSaveImages_Click(object sender, EventArgs e)
 {
     this.PrepareFolderBrowser(I18N.GetText("Description:BrowseImageExportFolder"));
       if (this.dlgBrowseFolder.ShowDialog() == DialogResult.OK) {
       PleaseWaitDialog PWD = new PleaseWaitDialog(I18N.GetText("Dialog:SaveAllImages"));
       Thread T = new Thread(new ThreadStart(delegate () {
       Application.DoEvents();
       foreach (IThing X in this.LoadedThings_) {
       Image I = X.GetIcon(); // FIXME: Assumes no IThing has more than one image
     if (I != null) {
     string ImageFileName = X.ToString() + ".png";
       foreach (char C in Path.GetInvalidFileNameChars())
         ImageFileName = ImageFileName.Replace(C, '_');
       I.Save(Path.Combine(this.dlgBrowseFolder.SelectedPath, ImageFileName), ImageFormat.Png);
     }
     Application.DoEvents();
       }
       PWD.Invoke(new AnonymousMethod(delegate() { PWD.Close(); }));
     }));
     T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
     T.Start();
     PWD.ShowDialog(this);
     this.Activate();
     PWD.Dispose();
     PWD = null;
       }
 }