- Timestamp:
- 07/17/13 13:35:44 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 deleted
- 7 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3
-
Property
svn:mergeinfo
set to
/branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data.Views/3.3 merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/sources/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj
r9379 r9714 133 133 <DependentUpon>IntRangeView.cs</DependentUpon> 134 134 </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> 135 153 <Compile Include="Plugin.cs" /> 136 154 <Compile Include="StringConvertibleMatrixColumnVisibilityDialog.cs"> … … 196 214 </ItemGroup> 197 215 <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> 198 221 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 199 222 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> -
trunk/sources/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs
r9705 r9714 29 29 namespace HeuristicLab.Data.Views { 30 30 [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 { 33 33 private bool changedFileContent; 34 pr otectedbool ChangedFileContent {34 private bool ChangedFileContent { 35 35 get { return changedFileContent; } 36 36 set { … … 42 42 } 43 43 44 public new TextFile Content {45 get { return (TextFile )base.Content; }44 public new TextFileValue Content { 45 get { return (TextFileValue)base.Content; } 46 46 set { base.Content = value; } 47 47 } … … 97 97 } 98 98 99 pr otected virtualvoid Content_FilePathChanged(object sender, EventArgs e) {99 private void Content_FilePathChanged(object sender, EventArgs e) { 100 100 UpdateTextBox(); 101 101 SetEnabledStateOfControls(); 102 102 } 103 pr otected virtualvoid Content_FileDialogFilterChanged(object sender, EventArgs e) {103 private void Content_FileDialogFilterChanged(object sender, EventArgs e) { 104 104 saveFileDialog.Filter = Content.FileDialogFilter; 105 105 } 106 106 107 pr otected virtualvoid textBox_TextChanged(object sender, EventArgs e) {107 private void textBox_TextChanged(object sender, EventArgs e) { 108 108 ChangedFileContent = fileText != textBox.Text; 109 109 } 110 110 111 pr otected virtualvoid OnChangedFileContent() {111 private void OnChangedFileContent() { 112 112 SetEnabledStateOfControls(); 113 113 if (ChangedFileContent) { … … 118 118 } 119 119 120 pr otectedbool fileSystemWatcherChangedFired = false;121 pr otected virtualvoid fileSystemWatcher_Changed(object sender, FileSystemEventArgs e) {120 private bool fileSystemWatcherChangedFired = false; 121 private void fileSystemWatcher_Changed(object sender, FileSystemEventArgs e) { 122 122 //mkommend: cannot react on visible changed, because this event is not fired when the parent control gets visible set to false 123 123 if (!Visible) return; … … 162 162 } 163 163 164 pr otected virtualvoid fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) {164 private void fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) { 165 165 //mkommend: cannot react on visible changed, because this event is not fired when the parent control gets visible set to false 166 166 if (!Visible) return; … … 174 174 } 175 175 176 pr otected virtualvoid SaveFile() {176 private void SaveFile() { 177 177 //omit circular events by changing the file from HL 178 178 fileSystemWatcher.EnableRaisingEvents = false; … … 189 189 } 190 190 191 pr otected virtualvoid saveButton_Click(object sender, EventArgs e) {191 private void saveButton_Click(object sender, EventArgs e) { 192 192 SaveFile(); 193 193 } 194 194 195 pr otectedstring fileText;196 pr otected virtualvoid UpdateTextBox() {195 private string fileText; 196 private void UpdateTextBox() { 197 197 if (string.IsNullOrEmpty(Content.Value)) { 198 198 textBox.Enabled = false; … … 201 201 } 202 202 203 fileText = ReadFile(Content.Value) ?? string.Empty;204 if ( string.IsNullOrEmpty(fileText)) {203 fileText = ReadFile(Content.Value); 204 if (fileText == null) { 205 205 textBox.Enabled = false; 206 206 textBox.Text = string.Format("The specified file \"{0}\" cannot be found.", Content.Value); … … 211 211 textBox.Text = fileText; 212 212 } 213 pr otected virtualvoid textBox_Validated(object sender, EventArgs e) {213 private void textBox_Validated(object sender, EventArgs e) { 214 214 if (!ChangedFileContent) return; 215 215 string msg = string.Format("You have not saved the changes in the file \"{0}\" yet. Do you want to save the changes?", Content.Value); … … 226 226 } 227 227 228 p ublicstatic string ReadFile(string path) {228 private static string ReadFile(string path) { 229 229 if (!File.Exists(path)) return null; 230 string fileContent ;230 string fileContent = string.Empty; 231 231 using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { 232 232 using (StreamReader streamReader = new StreamReader(fileStream)) { … … 237 237 } 238 238 239 p ublicstatic void WriteFile(string path, string fileContent) {239 private static void WriteFile(string path, string fileContent) { 240 240 using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write)) { 241 241 using (StreamWriter streamWriter = new StreamWriter(fileStream)) { -
trunk/sources/HeuristicLab.Data.Views/3.3/Plugin.cs.frame
r9462 r9714 32 32 [PluginFile("HeuristicLab.Data.Views-3.3.dll", PluginFileType.Assembly)] 33 33 [PluginDependency("HeuristicLab.Common", "3.3")] 34 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 34 35 [PluginDependency("HeuristicLab.Core", "3.3")] 35 36 [PluginDependency("HeuristicLab.Core.Views", "3.3")] -
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs
r9695 r9714 125 125 Invoke(new EventHandler<EventArgs<int>>(Content_ItemChanged), sender, e); 126 126 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; 127 130 dataGridView.Rows[e.Value].Cells[0].Value = Content.GetValue(e.Value); 128 131 Size size = dataGridView.Rows[e.Value].Cells[0].PreferredSize; -
trunk/sources/HeuristicLab.Data/3.3
-
Property
svn:mergeinfo
set to
/branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data/3.3 merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/sources/HeuristicLab.Data/3.3/HeuristicLab.Data-3.3.csproj
r8600 r9714 117 117 <Compile Include="Comparison.cs" /> 118 118 <Compile Include="ComparisonType.cs" /> 119 <Compile Include="Path Types\DirectoryValue.cs" /> 120 <Compile Include="Path Types\FileValue.cs" /> 121 <Compile Include="Path Types\PathValue.cs" /> 122 <Compile Include="Path Types\TextFileValue.cs" /> 119 123 <Compile Include="PercentMatrix.cs" /> 120 124 <Compile Include="PercentArray.cs" /> … … 212 216 --> 213 217 <PropertyGroup> 214 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)218 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 215 219 set ProjectDir=$(ProjectDir) 216 220 set SolutionDir=$(SolutionDir) … … 219 223 call PreBuildEvent.cmd 220 224 </PreBuildEvent> 221 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">225 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 222 226 export ProjectDir=$(ProjectDir) 223 227 export SolutionDir=$(SolutionDir) -
trunk/sources/HeuristicLab.Data/3.3/Path Types/TextFileValue.cs
r9706 r9714 27 27 [Item("TextFile", "Represents the content and path to a text file.")] 28 28 [StorableClass] 29 public class TextFile : FileValue {29 public class TextFileValue : FileValue { 30 30 [StorableConstructor] 31 protected TextFile (bool deserializing) : base(deserializing) { }32 protected TextFile (TextFile original, Cloner cloner)31 protected TextFileValue(bool deserializing) : base(deserializing) { } 32 protected TextFileValue(TextFileValue original, Cloner cloner) 33 33 : base(original, cloner) { 34 34 } 35 35 public override IDeepCloneable Clone(Cloner cloner) { 36 return new TextFile (this, cloner);36 return new TextFileValue(this, cloner); 37 37 } 38 38 39 public TextFile ()39 public TextFileValue() 40 40 : base() { 41 41 }
Note: See TracChangeset
for help on using the changeset viewer.