private void StreamingEndpointInformation_Load(object sender, EventArgs e)
        {
            if (!MultipleSelection) // one SE
            {
                labelSEName.Text = string.Format(labelSEName.Text, MyStreamingEndpoint.Name);
                hostnamelink.Links.Add(new LinkLabel.Link(0, hostnamelink.Text.Length, "http://msdn.microsoft.com/en-us/library/azure/dn783468.aspx"));
                DGOrigin.ColumnCount = 2;

                // asset info
                DGOrigin.Columns[0].DefaultCellStyle.BackColor = Color.Gainsboro;
                DGOrigin.Rows.Add("Name", MyStreamingEndpoint.Name);
                DGOrigin.Rows.Add("Id", MyStreamingEndpoint.Id);
                DGOrigin.Rows.Add("State", (StreamingEndpointState)MyStreamingEndpoint.State);
                DGOrigin.Rows.Add("CDN Enabled", MyStreamingEndpoint.CdnEnabled);
                DGOrigin.Rows.Add("Created", ((DateTime)MyStreamingEndpoint.Created).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("Last Modified", ((DateTime)MyStreamingEndpoint.LastModified).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("Description", MyStreamingEndpoint.Description);
                DGOrigin.Rows.Add("Host name", MyStreamingEndpoint.HostName);
            }
            else
            {
                labelSEName.Text = "(multiple streaming endpoints have been selected)";
                tabControl1.TabPages.Remove(tabPageInfo); // no SE info page
            }


            // Custom Hostnames binding to control
            if (MyStreamingEndpoint.CustomHostNames != null)
            {
                foreach (var hostname in MyStreamingEndpoint.CustomHostNames)
                {
                    CustomHostNamesList.Add(new HostNameClass()
                    {
                        HostName = hostname
                    });
                }
            }
            dataGridViewCustomHostname.DataSource = CustomHostNamesList;

            // AZURE CDN
            panelCustomHostnames.Enabled = panelStreamingAllowedIP.Enabled = panelAkamai.Enabled = !MyStreamingEndpoint.CdnEnabled;
            labelcdn.Visible             = MyStreamingEndpoint.CdnEnabled;
            numericUpDownRU.Minimum      = MyStreamingEndpoint.CdnEnabled ? 1 : 0;

            if (MyStreamingEndpoint.ScaleUnits != null)
            {
                if (!MultipleSelection)
                {
                    DGOrigin.Rows.Add("Scale Units", MyStreamingEndpoint.ScaleUnits);
                }
                if (numericUpDownRU.Maximum < MyStreamingEndpoint.ScaleUnits)
                {
                    numericUpDownRU.Maximum = (int)MyStreamingEndpoint.ScaleUnits * 2;
                }
                numericUpDownRU.Value = (int)MyStreamingEndpoint.ScaleUnits;
            }

            if (MyStreamingEndpoint.CacheControl != null)
            {
                if (MyStreamingEndpoint.CacheControl.MaxAge != null)
                {
                    textBoxMaxCacheAge.Text = ((TimeSpan)MyStreamingEndpoint.CacheControl.MaxAge).TotalSeconds.ToString();
                }
                else
                {
                    textBoxMaxCacheAge.Text = string.Empty;
                }
            }
            else
            {
                textBoxMaxCacheAge.Text = string.Empty;
            }
            MaxCacheAgeInitial = textBoxMaxCacheAge.Text;


            if (MyStreamingEndpoint.AccessControl != null)
            {
                if (MyStreamingEndpoint.AccessControl.IPAllowList != null)
                {
                    checkBoxStreamingIPlistSet.Checked = true;
                    foreach (var endpoint in MyStreamingEndpoint.AccessControl.IPAllowList)
                    {
                        endpointSettingList.Add(endpoint);
                    }
                }
                if (MyStreamingEndpoint.AccessControl.AkamaiSignatureHeaderAuthenticationKeyList != null)
                {
                    checkBoxAkamai.Checked = true;
                    foreach (var setting in MyStreamingEndpoint.AccessControl.AkamaiSignatureHeaderAuthenticationKeyList)
                    {
                        AkamaiSettingList.Add(setting);
                    }
                }
            }
            dataGridViewIP.DataSource     = endpointSettingList;
            dataGridViewAkamai.DataSource = AkamaiSettingList;
            dataGridViewIP.DataError     += new DataGridViewDataErrorEventHandler(dataGridView_DataError);
            dataGridViewAkamai.DataError += new DataGridViewDataErrorEventHandler(dataGridView_DataError);

            if (MyStreamingEndpoint.CrossSiteAccessPolicies != null)
            {
                if (MyStreamingEndpoint.CrossSiteAccessPolicies.ClientAccessPolicy != null)
                {
                    checkBoxclientpolicy.Checked = true;
                    textBoxClientPolicy.Text     = MyStreamingEndpoint.CrossSiteAccessPolicies.ClientAccessPolicy;
                }
                if (MyStreamingEndpoint.CrossSiteAccessPolicies.CrossDomainPolicy != null)
                {
                    checkBoxcrossdomain.Checked = true;
                    textBoxCrossDomPolicy.Text  = MyStreamingEndpoint.CrossSiteAccessPolicies.CrossDomainPolicy;
                }
            }
            textboxorigindesc.Text = MyStreamingEndpoint.Description;

            checkMaxCacheAgeValue();

            // let's track when user edit a setting
            Modifications = new ExplorerSEModifications
            {
                Description        = false,
                ClientAccessPolicy = false,
                CrossDomainPolicy  = false,
                AkamaiSignatureHeaderAuthentication = false,
                CustomHostNames             = false,
                MaxCacheAge                 = false,
                StreamingAllowedIPAddresses = false,
                StreamingUnits              = false
            };
        }
コード例 #2
0
        private void StreamingEndpointInformation_Load(object sender, EventArgs e)
        {
            moreinfoSE.Links.Add(new LinkLabel.Link(0, moreinfoSE.Text.Length, Constants.LinkMoreInfoSE));

            if (!MultipleSelection) // one SE
            {
                labelSEName.Text = string.Format(labelSEName.Text, MySE.Name);
                hostnamelink.Links.Add(new LinkLabel.Link(0, hostnamelink.Text.Length, "http://msdn.microsoft.com/en-us/library/azure/dn783468.aspx"));
                DGOrigin.ColumnCount = 2;

                // se info
                DGOrigin.Columns[0].DefaultCellStyle.BackColor = Color.Gainsboro;
                DGOrigin.Rows.Add("Name", MySE.Name);
                DGOrigin.Rows.Add("ResourceState", MySE.ResourceState);
                DGOrigin.Rows.Add("Description", MySE.Description);
                DGOrigin.Rows.Add("HostName", MySE.HostName);
                DGOrigin.Rows.Add("CDNEnabled", MySE.CdnEnabled);
                DGOrigin.Rows.Add("CDNProfile", MySE.CdnProfile ?? Constants.stringNull);
                DGOrigin.Rows.Add("CDNProvider", MySE.CdnProvider ?? Constants.stringNull);
                DGOrigin.Rows.Add("FreeTrialEndtime", ((DateTime)MySE.FreeTrialEndTime).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("Created", ((DateTime)MySE.Created).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("LastModified", ((DateTime)MySE.LastModified).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("Id", MySE.Id);
                DGOrigin.Rows.Add("Location", MySE.Location);
                DGOrigin.Rows.Add("ProvisioningState", MySE.ProvisioningState);
            }
            else
            {
                labelSEName.Text = "(multiple streaming endpoints have been selected)";
                tabControl1.TabPages.Remove(tabPageInfo); // no SE info page
            }


            // Custom Hostnames binding to control
            if (MySE.CustomHostNames != null)
            {
                foreach (var hostname in MySE.CustomHostNames)
                {
                    CustomHostNamesList.Add(new HostNameClass()
                    {
                        HostName = hostname
                    });
                }
            }
            dataGridViewCustomHostname.DataSource = CustomHostNamesList;

            // AZURE CDN
            panelCustomHostnames.Enabled = panelStreamingAllowedIP.Enabled = panelAkamai.Enabled = !(bool)MySE.CdnEnabled;
            labelcdn.Visible             = (bool)MySE.CdnEnabled;
            // numericUpDownRU.Minimum = (bool)MySE.CdnEnabled ? 1 : 0;

            // Streaming units

            if (!MultipleSelection)
            {
                var type = ReturnTypeSE(MySE);
                DGOrigin.Rows.Add("Type", type);
                DGOrigin.Rows.Add("ScaleUnits", MySE.ScaleUnits);


                if (type == StreamEndpointType.Standard)
                {
                    radioButtonStandard.Checked = true;
                }
                else // Premium
                {
                    radioButtonPremium.Checked = true;
                    numericUpDownRU.Value      = MySE.ScaleUnits;
                }
            }
            else
            {
                groupBoxTypeScale.Enabled = false;
            }
            // if (numericUpDownRU.Maximum < MySE.ScaleUnits) numericUpDownRU.Maximum = (int)MySE.ScaleUnits * 2;


            if (MySE.MaxCacheAge != null)
            {
                textBoxMaxCacheAge.Text = ((long)MySE.MaxCacheAge).ToString();
            }
            else
            {
                textBoxMaxCacheAge.Text = string.Empty;
            }
            MaxCacheAgeInitial = textBoxMaxCacheAge.Text;


            if (MySE.AccessControl != null)
            {
                if (MySE.AccessControl.Ip != null)
                {
                    checkBoxStreamingIPlistSet.Checked = true;
                    foreach (var endpoint in MySE.AccessControl.Ip.Allow)
                    {
                        endpointSettingList.Add(endpoint);
                    }
                }
                if (MySE.AccessControl.Akamai != null)
                {
                    checkBoxAkamai.Checked = true;
                    foreach (var setting in MySE.AccessControl.Akamai.AkamaiSignatureHeaderAuthenticationKeyList)
                    {
                        AkamaiSettingList.Add(setting);
                    }
                }
            }
            dataGridViewIP.DataSource     = endpointSettingList;
            dataGridViewAkamai.DataSource = AkamaiSettingList;
            dataGridViewIP.DataError     += new DataGridViewDataErrorEventHandler(dataGridView_DataError);
            dataGridViewAkamai.DataError += new DataGridViewDataErrorEventHandler(dataGridView_DataError);

            if (MySE.CrossSiteAccessPolicies != null)
            {
                if (MySE.CrossSiteAccessPolicies.ClientAccessPolicy != null)
                {
                    checkBoxclientpolicy.Checked = true;
                    textBoxClientPolicy.Text     = MySE.CrossSiteAccessPolicies.ClientAccessPolicy;
                }
                if (MySE.CrossSiteAccessPolicies.CrossDomainPolicy != null)
                {
                    checkBoxcrossdomain.Checked = true;
                    textBoxCrossDomPolicy.Text  = MySE.CrossSiteAccessPolicies.CrossDomainPolicy;
                }
            }
            textboxorigindesc.Text = MySE.Description;

            checkMaxCacheAgeValue();

            // let's track when user edit a setting
            Modifications = new ExplorerSEModifications
            {
                Description        = false,
                ClientAccessPolicy = false,
                CrossDomainPolicy  = false,
                AkamaiSignatureHeaderAuthentication = false,
                CustomHostNames             = false,
                MaxCacheAge                 = false,
                StreamingAllowedIPAddresses = false,
                StreamingUnits              = false
            };
        }
コード例 #3
0
        private void StreamingEndpointInformation_Load(object sender, EventArgs e)
        {
            if (!MultipleSelection) // one SE
            {
                labelSEName.Text = string.Format(labelSEName.Text, MyStreamingEndpoint.Name);
                hostnamelink.Links.Add(new LinkLabel.Link(0, hostnamelink.Text.Length, "http://msdn.microsoft.com/en-us/library/azure/dn783468.aspx"));
                DGOrigin.ColumnCount = 2;

                // asset info
                DGOrigin.Columns[0].DefaultCellStyle.BackColor = Color.Gainsboro;
                DGOrigin.Rows.Add("Name", MyStreamingEndpoint.Name);
                DGOrigin.Rows.Add("Id", MyStreamingEndpoint.Id);
                DGOrigin.Rows.Add("State", (StreamingEndpointState)MyStreamingEndpoint.State);
                DGOrigin.Rows.Add("CDN Enabled", MyStreamingEndpoint.CdnEnabled);
                DGOrigin.Rows.Add("Created", ((DateTime)MyStreamingEndpoint.Created).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("Last Modified", ((DateTime)MyStreamingEndpoint.LastModified).ToLocalTime().ToString("G"));
                DGOrigin.Rows.Add("Description", MyStreamingEndpoint.Description);
                DGOrigin.Rows.Add("Host name", MyStreamingEndpoint.HostName);
            }
            else
            {
                labelSEName.Text = "(multiple streaming endpoints have been selected)";
                tabControl1.TabPages.Remove(tabPageInfo); // no SE info page
            }

            // Custom Hostnames binding to control
            if (MyStreamingEndpoint.CustomHostNames != null)
            {
                foreach (var hostname in MyStreamingEndpoint.CustomHostNames)
                {
                    CustomHostNamesList.Add(new HostNameClass() { HostName = hostname });
                }
            }
            dataGridViewCustomHostname.DataSource = CustomHostNamesList;

            // AZURE CDN
            panelCustomHostnames.Enabled = panelStreamingAllowedIP.Enabled = panelAkamai.Enabled = !MyStreamingEndpoint.CdnEnabled;
            labelcdn.Visible = MyStreamingEndpoint.CdnEnabled;
            numericUpDownRU.Minimum = MyStreamingEndpoint.CdnEnabled ? 1 : 0;

            if (MyStreamingEndpoint.ScaleUnits != null)
            {
                if (!MultipleSelection) DGOrigin.Rows.Add("Scale Units", MyStreamingEndpoint.ScaleUnits);
                if (numericUpDownRU.Maximum < MyStreamingEndpoint.ScaleUnits) numericUpDownRU.Maximum = (int)MyStreamingEndpoint.ScaleUnits * 2;
                numericUpDownRU.Value = (int)MyStreamingEndpoint.ScaleUnits;
            }

            if (MyStreamingEndpoint.CacheControl != null)
            {
                if (MyStreamingEndpoint.CacheControl.MaxAge != null)
                {
                    textBoxMaxCacheAge.Text = ((TimeSpan)MyStreamingEndpoint.CacheControl.MaxAge).TotalSeconds.ToString();
                }
                else
                {
                    textBoxMaxCacheAge.Text = string.Empty;
                }
            }
            else
            {
                textBoxMaxCacheAge.Text = string.Empty;
            }
            MaxCacheAgeInitial = textBoxMaxCacheAge.Text;

            if (MyStreamingEndpoint.AccessControl != null)
            {
                if (MyStreamingEndpoint.AccessControl.IPAllowList != null)
                {
                    checkBoxStreamingIPlistSet.Checked = true;
                    foreach (var endpoint in MyStreamingEndpoint.AccessControl.IPAllowList)
                    {
                        endpointSettingList.Add(endpoint);
                    }
                }
                if (MyStreamingEndpoint.AccessControl.AkamaiSignatureHeaderAuthenticationKeyList != null)
                {
                    checkBoxAkamai.Checked = true;
                    foreach (var setting in MyStreamingEndpoint.AccessControl.AkamaiSignatureHeaderAuthenticationKeyList)
                    {
                        AkamaiSettingList.Add(setting);
                    }
                }
            }
            dataGridViewIP.DataSource = endpointSettingList;
            dataGridViewAkamai.DataSource = AkamaiSettingList;
            dataGridViewIP.DataError += new DataGridViewDataErrorEventHandler(dataGridView_DataError);
            dataGridViewAkamai.DataError += new DataGridViewDataErrorEventHandler(dataGridView_DataError);

            if (MyStreamingEndpoint.CrossSiteAccessPolicies != null)
            {
                if (MyStreamingEndpoint.CrossSiteAccessPolicies.ClientAccessPolicy != null)
                {
                    checkBoxclientpolicy.Checked = true;
                    textBoxClientPolicy.Text = MyStreamingEndpoint.CrossSiteAccessPolicies.ClientAccessPolicy;
                }
                if (MyStreamingEndpoint.CrossSiteAccessPolicies.CrossDomainPolicy != null)
                {
                    checkBoxcrossdomain.Checked = true;
                    textBoxCrossDomPolicy.Text = MyStreamingEndpoint.CrossSiteAccessPolicies.CrossDomainPolicy;
                }
            }
            textboxorigindesc.Text = MyStreamingEndpoint.Description;

            checkMaxCacheAgeValue();

            // let's track when user edit a setting
            Modifications = new ExplorerSEModifications
            {
                Description = false,
                ClientAccessPolicy = false,
                CrossDomainPolicy = false,
                AkamaiSignatureHeaderAuthentication = false,
                CustomHostNames = false,
                MaxCacheAge = false,
                StreamingAllowedIPAddresses = false,
                StreamingUnits = false
            };
        }