Skip to content

Commit

Permalink
renamed as FileName and FileNames like the system OpenFileDialog. The…
Browse files Browse the repository at this point in the history
…se DataSource[s] properties can move to OpenDataSourceDialog, but they should be simple aliases:

public MsDataFileUri DataSource => FileName;
public MsDataFileUri DataSources => FileNames;
  • Loading branch information
danjasuw committed Dec 8, 2024
1 parent 1789230 commit b6a3023
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pwiz_tools/Skyline/FileUI/BaseFileDialogNE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ private void AttachContentsAvailable(RemoteSession remoteSession)

public MsDataFileUri InitialDirectory { get; set; }

public MsDataFileUri DataSource
public MsDataFileUri FileName
{
get { return DataSources[0]; }
get { return FileNames[0]; }
}

public MsDataFileUri[] DataSources { get; protected set; }
public MsDataFileUri[] FileNames { get; protected set; }

public void SelectAllFileType(string extension, Func<string, bool> accept = null)
{
Expand Down Expand Up @@ -741,7 +741,7 @@ private void listView_ItemActivate( object sender, EventArgs e )
}
else
{
DataSources = new[] { ((SourceInfo) item.Tag).MsDataFileUri, };
FileNames = new[] { ((SourceInfo) item.Tag).MsDataFileUri, };
DialogResult = DialogResult.OK;
Close();
}
Expand Down
4 changes: 4 additions & 0 deletions pwiz_tools/Skyline/FileUI/OpenDataSourceDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* limitations under the License.
*/
using System.Collections.Generic;
using pwiz.Skyline.Model.Results;
using pwiz.Skyline.Model.Results.RemoteApi;
using pwiz.Skyline.Util;

Expand Down Expand Up @@ -50,5 +51,8 @@ public OpenDataSourceDialog(IList<RemoteAccount> remoteAccounts, IList<string> s
: base(SOURCE_TYPES, remoteAccounts, specificDataSourceFilter )
{
}

public MsDataFileUri DataSource => FileName;
public MsDataFileUri[] DataSources => FileNames;
}
}
4 changes: 2 additions & 2 deletions pwiz_tools/Skyline/FileUI/OpenFileDialogNE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void Open()
}
if (dataSourceList.Count > 0)
{
DataSources = dataSourceList.ToArray();
FileNames = dataSourceList.ToArray();
_abortPopulateList = true;
DialogResult = DialogResult.OK;
return;
Expand Down Expand Up @@ -96,7 +96,7 @@ public void Open()
{
if (DataSourceUtil.IsDataSource(fileOrDirName))
{
DataSources = new[] { MsDataFileUri.Parse(fileOrDirName) };
FileNames = new[] { MsDataFileUri.Parse(fileOrDirName) };
DialogResult = DialogResult.OK;
return;
}
Expand Down

0 comments on commit b6a3023

Please sign in to comment.