Skip to content

Commit

Permalink
Fix: warning on App upload with empty File-URL, create Artifact optio…
Browse files Browse the repository at this point in the history
…n removed
  • Loading branch information
rzander committed Dec 28, 2017
1 parent e5d5b8d commit 0cde4e4
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 28 deletions.
4 changes: 2 additions & 2 deletions RuckZuck_Tool/InstallSwPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@
<Image Source="Images/star.ico" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="miCreateArtifact" Header="Create Artifact" IsEnabled="true" ToolTip="Create an Artifact for AzureLab" Height="24px" Click="miCreateArtifact_Click">
<!--<MenuItem Name="miCreateArtifact" Header="Create Artifact" IsEnabled="true" ToolTip="Create an Artifact for AzureLab" Height="24px" Click="miCreateArtifact_Click">
<MenuItem.Icon>
<Image Source="Images/star.ico" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>-->
</ContextMenu>
</ListView.ContextMenu>
</ListView>
Expand Down
4 changes: 2 additions & 2 deletions RuckZuck_Tool/InstallSwPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ private void miCreateExe_Click(object sender, RoutedEventArgs e)
}
}

private void miCreateArtifact_Click(object sender, RoutedEventArgs e)
/*private void miCreateArtifact_Click(object sender, RoutedEventArgs e)
{
Mouse.OverrideCursor = Cursors.Wait;
try
Expand Down Expand Up @@ -906,7 +906,7 @@ private void miCreateArtifact_Click(object sender, RoutedEventArgs e)
{
Mouse.OverrideCursor = null;
}
}
}*/


}
Expand Down
2 changes: 1 addition & 1 deletion RuckZuck_Tool/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</DockPanel>
<DockPanel DockPanel.Dock="Bottom">
<TextBlock Name="tbVersion">
Version:{0} Copyright (c) 2017 by Roger Zander
Version:{0} Copyright (c) 2018 by Roger Zander
</TextBlock>
</DockPanel>
<DockPanel DockPanel.Dock="Top" VerticalAlignment="Top">
Expand Down
8 changes: 7 additions & 1 deletion RuckZuck_Tool/NewSWPanelxaml.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,20 @@ private void Button_Click(object sender, RoutedEventArgs e)
return;
}

if(((List<contentFiles>)dgSourceFiles.ItemsSource).Count(t=>!string.IsNullOrEmpty(t.URL)) == 0)
{
if (MessageBox.Show("one File-URL is empty !", "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Warning) != MessageBoxResult.OK)
return;
}

AddSoftware oSoftware = new AddSoftware();
oSoftware.Architecture = tbArchitecture.Text;
oSoftware.ContentID = tbContentId.Text;
oSoftware.Description = tbDescription.Text;

try
{
oSoftware.Files = ((List<contentFiles>)dgSourceFiles.ItemsSource);
oSoftware.Files = ((List<contentFiles>)dgSourceFiles.ItemsSource).Where(t=> !string.IsNullOrEmpty(t.URL)).ToList();
}
catch { }
try
Expand Down
6 changes: 3 additions & 3 deletions RuckZuck_Tool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Zander Tools")]
[assembly: AssemblyProduct("RuckZuck")]
[assembly: AssemblyCopyright("Copyright © 2017 by Roger Zander")]
[assembly: AssemblyCopyright("Copyright © 2018 by Roger Zander")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.0.*")]
[assembly: AssemblyFileVersion("1.6.0.4")]
[assembly: AssemblyVersion("1.6.1.*")]
[assembly: AssemblyFileVersion("1.6.1.1")]
2 changes: 1 addition & 1 deletion RuckZuck_Tool/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 33 additions & 18 deletions RuckZuck_Tool/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RuckZuck.tools")]
[assembly: AssemblyProduct("RZRZRZ")]
[assembly: AssemblyCopyright("Copyright © 2017 by Roger Zander")]
[assembly: AssemblyCopyright("Copyright © 2018 by Roger Zander")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
Expand Down Expand Up @@ -156,6 +156,8 @@ namespace RuckZuck_WCF
{
private static string _sURL = "UDP";
public static bool DisableBroadcast = false;
public static string ipfs_GW_URL = "https://gateway.ipfs.io/ipfs";

public static string sURL
{
get
Expand Down Expand Up @@ -305,17 +307,14 @@ namespace RuckZuck_WCF
{
try
{
//oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token);
//oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType));

if (string.IsNullOrEmpty(Searchstring)) //FullCatalog?
{
if (File.Exists(Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), "rzcat.json"))) //Cached content exists
{
try
{
DateTime dCreationDate = File.GetCreationTime(Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), "rzcat.json"));
if ((DateTime.Now - dCreationDate) &lt; new TimeSpan(0, 30, 0))
if ((DateTime.Now - dCreationDate) &lt; new TimeSpan(0, 30, 0)) //Cache for 30min
{
//return cached Content
string jRes = File.ReadAllText(Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), "rzcat.json"));
Expand Down Expand Up @@ -446,20 +445,12 @@ namespace RuckZuck_WCF
return false;
}

public static async void TrackDownloads(string contentID)
{
contentID.ToString();
//depreciated
}


//vNext 5.9.2017
public static async void TrackDownloads2(long SWId, string Architecture)
{
try
{
//oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token);
//oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType));
await oClient.GetStringAsync(sURL + "/rest/TrackDownloadsNew?SWId=" + SWId.ToString() + "&amp;arch=" + WebUtility.UrlEncode(Architecture));
}
catch { }
Expand Down Expand Up @@ -492,6 +483,29 @@ namespace RuckZuck_WCF

return null;
}

/// &lt;summary&gt;
/// Get IPFS.io hash
/// &lt;/summary&gt;
/// &lt;param name="contentID"&gt;&lt;/param&gt;
/// &lt;param name="fileName"&gt;&lt;/param&gt;
/// &lt;returns&gt;&lt;/returns&gt;
public static string GetIPFS(string contentID, string fileName)
{
try
{
var response = oClient.GetStringAsync(sURL + "/rest/GetIPFS?Id=" + contentID + "&amp;file=" + fileName);
response.Wait(5000);

if (response.IsCompleted)
{
return response.Result.Trim('"');
}
}
catch { }

return "";
}
}

public class GetSoftware
Expand Down Expand Up @@ -520,9 +534,9 @@ namespace RuckZuck_WCF

public bool isInstalled { get; set; }

public string XMLFile { get; set; }
//public string XMLFile { get; set; }

public string IconFile { get; set; }
//public string IconFile { get; set; }

public string IconURL
{
Expand All @@ -534,7 +548,7 @@ namespace RuckZuck_WCF
}
else
{
return "File://" + IconFile;
return ""; // "File://" + IconFile;
}
//return "https://ruckzuck.azurewebsites.net/wcf/RZService.svc/rest/GetIcon?id=" + IconId.ToString();
}
Expand Down Expand Up @@ -585,10 +599,11 @@ namespace RuckZuck_WCF
public string[] PreRequisites { get; set; }

//vNext 5.9.2017
public long SWId { get { return IconId; } set { IconId = value; } }
//public long SWId { get { return IconId; } set { IconId = value; } }
public long SWId { get; set; }

//remove if SWId is in place 5.9.2017
public long IconId { get; set; }
//public long IconId { get; set; }

public string IconURL
{
Expand Down

0 comments on commit 0cde4e4

Please sign in to comment.