Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Merge pull request #28 from Azure/next-public-release
Browse files Browse the repository at this point in the history
Next public release
  • Loading branch information
xpouyat committed Dec 23, 2014
2 parents a3fe636 + 528d577 commit 1207399
Show file tree
Hide file tree
Showing 22 changed files with 1,021 additions and 515 deletions.
12 changes: 12 additions & 0 deletions AMSExplorer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@
<setting name="PremiumWorkflowPresetXMLFilesCurrentFolder" serializeAs="String">
<value />
</setting>
<setting name="AMEPrice" serializeAs="String">
<value>1.99</value>
</setting>
<setting name="LegacyEncodingPrice" serializeAs="String">
<value>1.39</value>
</setting>
<setting name="IndexingPrice" serializeAs="String">
<value>10</value>
</setting>
<setting name="Currency" serializeAs="String">
<value>$</value>
</setting>
</AMSExplorer.Properties.Settings>
</userSettings>
</configuration>
31 changes: 16 additions & 15 deletions AMSExplorer/AssetInformation.Designer.cs

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

55 changes: 17 additions & 38 deletions AMSExplorer/AssetInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ public partial class AssetInformation : Form
private ILocator TempLocator = null;
private ILocator TempMetadaLocator = null;
private List<IContentKeyAuthorizationPolicy> MyPolicies = null;
private Mainform MyMainForm;

public AssetInformation()
public AssetInformation(Mainform mainform)
{
InitializeComponent();
this.Icon = Bitmaps.Azure_Explorer_ico;
MyMainForm = mainform;
}

private void contextMenuStripDG_MouseClick(object sender, MouseEventArgs e)
Expand Down Expand Up @@ -594,6 +596,8 @@ private void DoDisplayKeyProperties()
{
IContentKey key = MyAsset.ContentKeys.Skip(listViewKeys.SelectedIndices[0]).Take(1).FirstOrDefault();
dataGridViewKeys.Rows.Clear();
dataGridViewKeys.Rows.Add("Name", key.Name != null ? key.Name : "<no name>");
/*
if (key.Name != null)
{
dataGridViewKeys.Rows.Add("Name", key.Name);
Expand All @@ -602,6 +606,7 @@ private void DoDisplayKeyProperties()
{
dataGridViewKeys.Rows.Add("Name", "<no name>");
}
* */

dataGridViewKeys.Rows.Add("Id", key.Id);
dataGridViewKeys.Rows.Add("Content key type", key.ContentKeyType);
Expand Down Expand Up @@ -772,14 +777,12 @@ private void DoDownloadFile()
IAssetFile AF = MyAsset.AssetFiles.Skip(listViewFiles.SelectedIndices[0]).Take(1).FirstOrDefault();
if (AF == null) return;

Mainform parent = (Mainform)this.Owner;

if (folderBrowserDialogDownload.ShowDialog() == DialogResult.OK)
{
int index = parent.DoGridTransferAddItem(string.Format("Download of file '{0}' from asset '{1}'", AF.Name, MyAsset.Name), TransferType.DownloadToLocal, Properties.Settings.Default.useTransferQueue);
int index = MyMainForm.DoGridTransferAddItem(string.Format("Download of file '{0}' from asset '{1}'", AF.Name, MyAsset.Name), TransferType.DownloadToLocal, Properties.Settings.Default.useTransferQueue);

// Start a worker thread that does downloading.
parent.DoDownloadFileFromAsset(MyAsset, AF, folderBrowserDialogDownload.SelectedPath, index);
MyMainForm.DoDownloadFileFromAsset(MyAsset, AF, folderBrowserDialogDownload.SelectedPath, index);
}
}
}
Expand Down Expand Up @@ -1280,7 +1283,6 @@ private void DoRemovePol()
}
catch (Exception e)
{
Mainform parent = (Mainform)this.Owner;
MessageBox.Show("Error when removing this policy." + Constants.endline + Program.GetErrorMessage(e));
ListAssetDeliveryPolicies();
}
Expand All @@ -1304,26 +1306,17 @@ private void listViewAutPol_SelectedIndexChanged(object sender, EventArgs e)

private void DoDisplayAuthorizationPolicyProperties()
{
bool DisplayButGetToken = false;

if (listViewAutPol.SelectedItems.Count > 0)
{
IContentKeyAuthorizationPolicy policy = MyPolicies.Skip(listViewAutPol.SelectedIndices[0]).Take(1).FirstOrDefault();

dataGridViewAutPol.Rows.Clear();
if (policy.Name != null)
{
dataGridViewAutPol.Rows.Add("Name", policy.Name);
}
else
{
dataGridViewAutPol.Rows.Add("Name", "<no name>");
}

dataGridViewAutPol.Rows.Add("Name", policy.Name != null ? policy.Name : "<no name>");
dataGridViewAutPol.Rows.Add("Id", policy.Id);
IList<IContentKeyAuthorizationPolicyOption> objIList_option = policy.Options;



foreach (var option in objIList_option)
{
dataGridViewAutPol.Rows.Add("Option Name", option.Name);
Expand All @@ -1333,11 +1326,13 @@ private void DoDisplayAuthorizationPolicyProperties()
foreach (var restriction in objList_restriction)
{
dataGridViewAutPol.Rows.Add("Option restriction Name", restriction.Name);
dataGridViewAutPol.Rows.Add("Option restriction KeyRestrictionType", restriction.KeyRestrictionType);
dataGridViewAutPol.Rows.Add("Option restriction KeyRestrictionType", (ContentKeyRestrictionType)restriction.KeyRestrictionType);
if ((ContentKeyRestrictionType)restriction.KeyRestrictionType == ContentKeyRestrictionType.TokenRestricted) DisplayButGetToken = true;
dataGridViewAutPol.Rows.Add("Option restriction Requirements", FormatXmlString(restriction.Requirements));
}
}
}
buttonGetTestToken.Enabled = DisplayButGetToken;
}

private void buttonGetTestToken_Click(object sender, EventArgs e)
Expand All @@ -1347,8 +1342,6 @@ private void buttonGetTestToken_Click(object sender, EventArgs e)

private void DoGetTestToken()
{
Mainform parent = (Mainform)this.Owner;

if (listViewKeys.SelectedItems.Count > 0)
{
IContentKey key = MyAsset.ContentKeys.Skip(listViewKeys.SelectedIndices[0]).Take(1).FirstOrDefault();
Expand All @@ -1368,23 +1361,9 @@ private void DoGetTestToken()
TokenRestrictionTemplate tokenTemplate = TokenRestrictionTemplateSerializer.Deserialize(tokenTemplateString);
string testToken = TokenRestrictionTemplateSerializer.GenerateTestToken(tokenTemplate, null, rawkey);

switch (MessageBox.Show("Test token will be copied to log window and clipboard." + Constants.endline + "Do you want the URL encoded version ?", "Test token", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
{
case DialogResult.Yes:
testToken = HttpUtility.UrlEncode(testToken);
parent.TextBoxLogWriteLine("The authorization test token is (URL encoded):\n{0}", testToken);
System.Windows.Forms.Clipboard.SetText(testToken);
break;

case DialogResult.No:
parent.TextBoxLogWriteLine("The authorization test token is (URL encoded):\n{0}", testToken);
System.Windows.Forms.Clipboard.SetText(testToken);
break;

default:
break;

}
MyMainForm.TextBoxLogWriteLine("The authorization test token is :\n{0}", testToken);
System.Windows.Forms.Clipboard.SetText(testToken);
MessageBox.Show(string.Format("The test token below has been be copied to the log window and clipboard.\n\n{0}", testToken), "Test token copied");
}
}
}
Expand Down Expand Up @@ -1530,7 +1509,7 @@ private ILocator GetTemporaryLocator()
return TempLocator;
}


private void contextMenuStripDG_MouseClick_1(object sender, MouseEventArgs e)
{
ContextMenuStrip contextmenu = (ContextMenuStrip)sender;
Expand Down
3 changes: 3 additions & 0 deletions AMSExplorer/AssetInformation.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>551, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>551, 17</value>
</metadata>
</root>
1 change: 0 additions & 1 deletion AMSExplorer/EncodingZenium.Designer.cs

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

33 changes: 3 additions & 30 deletions AMSExplorer/EncodingZenium.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ private void EncodingPremiumWorkflow_Load(object sender, EventArgs e)
}
LoadWorkflows();
UpdateJobSummary();
listViewWorkflows.Tag = -1;
listViewWorkflows.ColumnClick += ListViewItemComparer.ListView_ColumnClick;

}

Expand Down Expand Up @@ -251,9 +253,6 @@ private void LoadWorkflows()
}
listViewWorkflows.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
listViewWorkflows.EndUpdate();



}

private void label1_Click(object sender, EventArgs e)
Expand All @@ -270,33 +269,7 @@ private void outputassetname_TextChanged(object sender, EventArgs e)
{

}

private void listViewInputAssets_ColumnClick(object sender, ColumnClickEventArgs e)
{
// Determine whether the column is the same as the last column clicked.
if (e.Column != sortColumn)
{
// Set the sort column to the new column.
sortColumn = e.Column;
// Set the sort order to ascending by default.
listViewWorkflows.Sorting = SortOrder.Ascending;
}
else
{
// Determine what the last sort order was and change it.
if (listViewWorkflows.Sorting == SortOrder.Ascending)
listViewWorkflows.Sorting = SortOrder.Descending;
else
listViewWorkflows.Sorting = SortOrder.Ascending;
}

// Call the sort method to manually sort.
listViewWorkflows.Sort();
// Set the ListViewItemSorter property to a new ListViewItemComparer
// object.
this.listViewWorkflows.ListViewItemSorter = new ListViewItemComparer(e.Column,
listViewWorkflows.Sorting);
}


private void buttonUpload_Click(object sender, EventArgs e)
{
Expand Down
Loading

0 comments on commit 1207399

Please sign in to comment.