Ignore:
Timestamp:
Mar 25, 2010, 4:42:42 PM (12 years ago)
Author:
Matthäus Wander
Message:

AnotherEditor:

  • Editor called IPlugin.Dispose() during Save (expected non-standard behaviour of Dispose()) -> changed to not call Dispose, except when object is meant to be destroyed
  • renamed another editor-internal Dispose() method to PreSave() to better reflect the expected behaviour (PreSave() is called before serializing an object)

BooleanFunctionParser, TextInput and VigenereAnalyser were partly relying on the Dispose() call from editor during save --> changed, they use standard Dispose() behaviour now.

FileInput and FileOutput seem to rely on non-standard Dispose() as well --> can't fix, testing measures blocked by #139. Beware: FileInput/FileOutput may be broken currently.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/TextInput/TextInput.cs

    r1205 r1258  
    237237      textInputPresentation = new TextInputPresentation();
    238238      Presentation = textInputPresentation;
    239       textInputPresentation.textBoxInputText.TextChanged += textBoxInputText_TextChanged;
    240239    }
    241240
     
    243242    {
    244243      this.NotifyUpdate();
    245       settings.HasChanges = true;
     244
     245      // No dispatcher necessary, handler is being called from GUI component
    246246      textInputPresentation.labelBytesCount.Content = string.Format("{0:0,0}", Encoding.Default.GetBytes(textInputPresentation.textBoxInputText.Text.ToCharArray()).Length) + " Bytes";
     247      settings.Text = textInputPresentation.textBoxInputText.Text;
    247248    }
    248249
     
    310311          listCryptoolStreams.Add(cryptoolStream);
    311312
    312           cryptoolStream.OpenRead(this.GetPluginInfoAttribute().Caption, arr);
     313          cryptoolStream.OpenRead(arr);
    313314          // ShowProgress(100, 100);
    314315          // GuiLogMessage("Got request for Stream. CryptoolStream created: " + cryptoolStream.FileName, NotificationLevel.Debug);
     
    443444    {
    444445      if (textInputPresentation.textBoxInputText != null)
    445         textInputPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    446         {
    447           textInputPresentation.textBoxInputText.Text = settings.Text;
    448         }, null);
     446      {
     447          textInputPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     448          {
     449              textInputPresentation.textBoxInputText.Text = settings.Text;
     450          }, null);
     451      }
     452
     453      textInputPresentation.textBoxInputText.TextChanged += textBoxInputText_TextChanged;
    449454    }
    450455
     
    459464      byteArrayOutput = null;
    460465
    461       settings.Text = (string)textInputPresentation.textBoxInputText.Dispatcher.Invoke(
    462         DispatcherPriority.Normal, (DispatcherOperationCallback)delegate
    463       {
    464         return textInputPresentation.textBoxInputText.Text;
    465       }, null);
     466      textInputPresentation.textBoxInputText.TextChanged -= textBoxInputText_TextChanged;
    466467    }
    467468
     
    472473      string value = (string)this.textInputPresentation.textBoxInputText.Dispatcher.Invoke(DispatcherPriority.Normal, (DispatcherOperationCallback)delegate
    473474      {
    474         return textInputPresentation.textBoxInputText.Text;
     475          return textInputPresentation.textBoxInputText.Text;
    475476      }, textInputPresentation);
    476477
Note: See TracChangeset for help on using the changeset viewer.