Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/17/13 13:35:44 (11 years ago)
Author:
mkommend
Message:

#2081: Integrated new HL path data types from the branch.

Location:
trunk/sources/HeuristicLab.Data.Views/3.3
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data.Views/3.3

  • trunk/sources/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj

    r9379 r9714  
    133133      <DependentUpon>IntRangeView.cs</DependentUpon>
    134134    </Compile>
     135    <Compile Include="Path Views\DirectoryValueView.cs">
     136      <SubType>UserControl</SubType>
     137    </Compile>
     138    <Compile Include="Path Views\DirectoryValueView.Designer.cs">
     139      <DependentUpon>DirectoryValueView.cs</DependentUpon>
     140    </Compile>
     141    <Compile Include="Path Views\FileValueView.cs">
     142      <SubType>UserControl</SubType>
     143    </Compile>
     144    <Compile Include="Path Views\FileValueView.Designer.cs">
     145      <DependentUpon>FileValueView.cs</DependentUpon>
     146    </Compile>
     147    <Compile Include="Path Views\TextFileView.cs">
     148      <SubType>UserControl</SubType>
     149    </Compile>
     150    <Compile Include="Path Views\TextFileView.Designer.cs">
     151      <DependentUpon>TextFileView.cs</DependentUpon>
     152    </Compile>
    135153    <Compile Include="Plugin.cs" />
    136154    <Compile Include="StringConvertibleMatrixColumnVisibilityDialog.cs">
     
    196214  </ItemGroup>
    197215  <ItemGroup>
     216    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
     217      <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
     218      <Name>HeuristicLab.Common.Resources-3.3</Name>
     219      <Private>False</Private>
     220    </ProjectReference>
    198221    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    199222      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
  • trunk/sources/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs

    r9705 r9714  
    2929namespace HeuristicLab.Data.Views {
    3030  [View("TextFileView")]
    31   [Content(typeof(TextFile), true)]
    32   public partial class TextFileView : ItemView {
     31  [Content(typeof(TextFileValue), true)]
     32  public sealed partial class TextFileView : ItemView {
    3333    private bool changedFileContent;
    34     protected bool ChangedFileContent {
     34    private bool ChangedFileContent {
    3535      get { return changedFileContent; }
    3636      set {
     
    4242    }
    4343
    44     public new TextFile Content {
    45       get { return (TextFile)base.Content; }
     44    public new TextFileValue Content {
     45      get { return (TextFileValue)base.Content; }
    4646      set { base.Content = value; }
    4747    }
     
    9797    }
    9898
    99     protected virtual void Content_FilePathChanged(object sender, EventArgs e) {
     99    private void Content_FilePathChanged(object sender, EventArgs e) {
    100100      UpdateTextBox();
    101101      SetEnabledStateOfControls();
    102102    }
    103     protected virtual void Content_FileDialogFilterChanged(object sender, EventArgs e) {
     103    private void Content_FileDialogFilterChanged(object sender, EventArgs e) {
    104104      saveFileDialog.Filter = Content.FileDialogFilter;
    105105    }
    106106
    107     protected virtual void textBox_TextChanged(object sender, EventArgs e) {
     107    private void textBox_TextChanged(object sender, EventArgs e) {
    108108      ChangedFileContent = fileText != textBox.Text;
    109109    }
    110110
    111     protected virtual void OnChangedFileContent() {
     111    private void OnChangedFileContent() {
    112112      SetEnabledStateOfControls();
    113113      if (ChangedFileContent) {
     
    118118    }
    119119
    120     protected bool fileSystemWatcherChangedFired = false;
    121     protected virtual void fileSystemWatcher_Changed(object sender, FileSystemEventArgs e) {
     120    private bool fileSystemWatcherChangedFired = false;
     121    private void fileSystemWatcher_Changed(object sender, FileSystemEventArgs e) {
    122122      //mkommend: cannot react on visible changed, because this event is not fired when the parent control gets visible set to false
    123123      if (!Visible) return;
     
    162162    }
    163163
    164     protected virtual void fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) {
     164    private void fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) {
    165165      //mkommend: cannot react on visible changed, because this event is not fired when the parent control gets visible set to false
    166166      if (!Visible) return;
     
    174174    }
    175175
    176     protected virtual void SaveFile() {
     176    private void SaveFile() {
    177177      //omit circular events by changing the file from HL
    178178      fileSystemWatcher.EnableRaisingEvents = false;
     
    189189    }
    190190
    191     protected virtual void saveButton_Click(object sender, EventArgs e) {
     191    private void saveButton_Click(object sender, EventArgs e) {
    192192      SaveFile();
    193193    }
    194194
    195     protected string fileText;
    196     protected virtual void UpdateTextBox() {
     195    private string fileText;
     196    private void UpdateTextBox() {
    197197      if (string.IsNullOrEmpty(Content.Value)) {
    198198        textBox.Enabled = false;
     
    201201      }
    202202
    203       fileText = ReadFile(Content.Value) ?? string.Empty;
    204       if (string.IsNullOrEmpty(fileText)) {
     203      fileText = ReadFile(Content.Value);
     204      if (fileText == null) {
    205205        textBox.Enabled = false;
    206206        textBox.Text = string.Format("The specified file \"{0}\" cannot be found.", Content.Value);
     
    211211      textBox.Text = fileText;
    212212    }
    213     protected virtual void textBox_Validated(object sender, EventArgs e) {
     213    private void textBox_Validated(object sender, EventArgs e) {
    214214      if (!ChangedFileContent) return;
    215215      string msg = string.Format("You have not saved the changes in the file \"{0}\" yet. Do you want to save the changes?", Content.Value);
     
    226226    }
    227227
    228     public static string ReadFile(string path) {
     228    private static string ReadFile(string path) {
    229229      if (!File.Exists(path)) return null;
    230       string fileContent;
     230      string fileContent = string.Empty;
    231231      using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
    232232        using (StreamReader streamReader = new StreamReader(fileStream)) {
     
    237237    }
    238238
    239     public static void WriteFile(string path, string fileContent) {
     239    private static void WriteFile(string path, string fileContent) {
    240240      using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write)) {
    241241        using (StreamWriter streamWriter = new StreamWriter(fileStream)) {
  • trunk/sources/HeuristicLab.Data.Views/3.3/Plugin.cs.frame

    r9462 r9714  
    3232  [PluginFile("HeuristicLab.Data.Views-3.3.dll", PluginFileType.Assembly)]
    3333  [PluginDependency("HeuristicLab.Common", "3.3")]
     34  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3435  [PluginDependency("HeuristicLab.Core", "3.3")]
    3536  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs

    r9695 r9714  
    125125        Invoke(new EventHandler<EventArgs<int>>(Content_ItemChanged), sender, e);
    126126      else {
     127        // if a resize of the array occurs and some other class handles the event and provides default values
     128        //then the itemChanged will occur before the reset event. hence the check was added
     129        if (dataGridView.RowCount <= e.Value) return;
    127130        dataGridView.Rows[e.Value].Cells[0].Value = Content.GetValue(e.Value);
    128131        Size size = dataGridView.Rows[e.Value].Cells[0].PreferredSize;
Note: See TracChangeset for help on using the changeset viewer.