Beispiel #1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "SetupForm" /> class.
        ///   Build some nic tables and initialize the component
        /// </summary>
        public SetupForm()
        {
            // get all the nics
            var networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();

            foreach (var networkInterface in networkInterfaces)
            {
                if (networkInterface == null)
                {
                    continue;
                }

                // if not a tunnel
                if (networkInterface.NetworkInterfaceType != NetworkInterfaceType.Tunnel && networkInterface.NetworkInterfaceType != NetworkInterfaceType.Loopback && networkInterface.SupportsMulticast)
                {
                    // then add it to multicasts table by name
                    this.multicasts.Add(networkInterface.Name, 0);

                    // add it to available nicIDs table
                    this.nicIDs.Add(networkInterface.Id, networkInterface.Name);

                    // add it to available nicNames table
                    this.nicNames.Add(networkInterface.Name, networkInterface.Id);
                }
            }

            // finally initialize the form
            InitializeComponent();
            int iconSize = (int)(16 * ScalingTools.GetScaleFactor());

            lblDestination.Font     = new Font(SystemFonts.MessageBoxFont.FontFamily, 14.25F);
            btnAddUniverse.Text     = "";
            btnAddUniverse.Image    = Tools.GetIcon(Resources.add, iconSize);
            btnDeleteUniverse.Text  = "";
            btnDeleteUniverse.Image = Tools.GetIcon(Resources.delete, iconSize);

            btnAddUnicast.Text     = "";
            btnAddUnicast.Image    = Tools.GetIcon(Resources.add, iconSize);
            btnDeleteUnicast.Text  = "";
            btnDeleteUnicast.Image = Tools.GetIcon(Resources.delete, iconSize);
            SetDestinations();
            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this, new List <Control>(new [] { univDGVN }));
            foreach (Control tab in tabControlEX1.TabPages)
            {
                tab.BackColor = ThemeColorTable.BackgroundColor;
                tab.ForeColor = ThemeColorTable.ForeColor;
            }
            tabControlEX1.SelectedTabColor = ThemeColorTable.BackgroundColor;
            tabControlEX1.TabColor         = ThemeColorTable.BackgroundColor;
            tabControlEX1.SelectedTab      = tabPageEX1;
            tabControlEX1.SizeMode         = TabSizeMode.Fixed;
            SizeF size = ScalingTools.MeasureString(Font, "Advanced Optionsss");

            tabControlEX1.ItemSize             = size.ToSize();
            univDGVN.EnableHeadersVisualStyles = false;
            univDGVN.BackgroundColor           = ThemeColorTable.BackgroundColor;
            univDGVN.ForeColor = ThemeColorTable.ForeColor;
            univDGVN.DefaultCellStyle.BackColor                    = ThemeColorTable.BackgroundColor;
            univDGVN.DefaultCellStyle.ForeColor                    = ThemeColorTable.ForeColor;
            univDGVN.DefaultCellStyle.SelectionBackColor           = ThemeColorTable.ListBoxHighLightColor;
            univDGVN.DefaultCellStyle.SelectionForeColor           = ThemeColorTable.ForeColor;
            univDGVN.RowsDefaultCellStyle.BackColor                = Color.Empty;
            univDGVN.RowsDefaultCellStyle.ForeColor                = Color.Empty;
            univDGVN.ColumnHeadersDefaultCellStyle.BackColor       = ThemeColorTable.BackgroundColor;
            univDGVN.ColumnHeadersDefaultCellStyle.ForeColor       = ThemeColorTable.ForeColor;
            univDGVN.RowHeadersDefaultCellStyle.BackColor          = Color.Empty;
            univDGVN.RowHeadersDefaultCellStyle.ForeColor          = Color.Empty;
            univDGVN.RowHeadersDefaultCellStyle.SelectionForeColor = Color.Empty;
            univDGVN.RowHeadersDefaultCellStyle.SelectionBackColor = Color.Empty;
            univDGVN.ColumnHeadersHeightSizeMode                   = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            autoPopulateStateUpdate();
        }
Beispiel #2
0
        public Form_ToolPalette(TimelineControl timelineControl)
        {
            InitializeComponent();
            TimelineControl = timelineControl;
            Icon            = Resources.Icon_Vixen3;
            ThemeUpdateControls.UpdateControls(this);
            toolStripColors.Renderer    = new ThemeToolStripRenderer();
            toolStripCurves.Renderer    = new ThemeToolStripRenderer();
            toolStripGradients.Renderer = new ThemeToolStripRenderer();
            var t = (int)(48 * ScalingTools.GetScaleFactor());

            _imageSize = new Size(t, t);
            int iconSize = (int)(16 * ScalingTools.GetScaleFactor());

            toolStripCurves.ImageScalingSize      = new Size(iconSize, iconSize);
            toolStripGradients.ImageScalingSize   = new Size(iconSize, iconSize);
            toolStripColors.ImageScalingSize      = new Size(iconSize, iconSize);
            toolStripButtonEditColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditColor.Image        = Tools.GetIcon(Resources.configuration, iconSize);

            toolStripButtonNewColor.DisplayStyle     = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewColor.Image            = Tools.GetIcon(Resources.addItem, iconSize);
            toolStripButtonDeleteColor.DisplayStyle  = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteColor.Image         = Tools.GetIcon(Resources.delete_32, iconSize);
            toolStripButtonExportColors.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportColors.Image        = Tools.GetIcon(Resources.folder_go, iconSize);
            toolStripButtonImportColors.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportColors.Image        = Tools.GetIcon(Resources.folder_open, iconSize);

            toolStripButtonEditCurve.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditCurve.Image           = Tools.GetIcon(Resources.configuration, iconSize);
            toolStripButtonNewCurve.DisplayStyle     = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewCurve.Image            = Tools.GetIcon(Resources.addItem, iconSize);
            toolStripButtonDeleteCurve.DisplayStyle  = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteCurve.Image         = Tools.GetIcon(Resources.delete_32, iconSize);
            toolStripButtonExportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportCurves.Image        = Tools.GetIcon(Resources.folder_go, iconSize);
            toolStripButtonImportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportCurves.Image        = Tools.GetIcon(Resources.folder_open, iconSize);

            toolStripButtonEditGradient.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditGradient.Image           = Tools.GetIcon(Resources.configuration, iconSize);
            toolStripButtonNewGradient.DisplayStyle     = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewGradient.Image            = Tools.GetIcon(Resources.addItem, iconSize);
            toolStripButtonDeleteGradient.DisplayStyle  = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteGradient.Image         = Tools.GetIcon(Resources.delete_32, iconSize);
            toolStripButtonExportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportGradients.Image        = Tools.GetIcon(Resources.folder_go, iconSize);
            toolStripButtonImportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportGradients.Image        = Tools.GetIcon(Resources.folder_open, iconSize);

            short sideGap = (short)(_imageSize.Width + (5 * ScalingTools.GetScaleFactor()));

            short topGap = (short)(_imageSize.Width + ScalingTools.MeasureHeight(Font, "Test") * 2);

            ListViewItem_SetSpacing(listViewColors, sideGap, sideGap);
            ListViewItem_SetSpacing(listViewCurves, sideGap, topGap);
            ListViewItem_SetSpacing(listViewGradients, sideGap, topGap);

            listViewColors.AllowDrop    = true;
            listViewCurves.AllowDrop    = true;
            listViewGradients.AllowDrop = true;

            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this);
            foreach (Control tab in tabControlEX1.TabPages)
            {
                tab.BackColor = ThemeColorTable.BackgroundColor;
                tab.ForeColor = ThemeColorTable.ForeColor;
            }
            tabControlEX1.SelectedTabColor = ThemeColorTable.BackgroundColor;
            tabControlEX1.TabColor         = ThemeColorTable.BackgroundColor;
            tabControlEX1.SelectedTab      = tabPageEX1;
            tabControlEX1.SizeMode         = TabSizeMode.Fixed;
            SizeF size = ScalingTools.MeasureString(Font, "Gradientsss");

            tabControlEX1.ItemSize = size.ToSize();
            //Over-ride the auto theme listview back color
            listViewColors.BackColor    = ThemeColorTable.BackgroundColor;
            listViewCurves.BackColor    = ThemeColorTable.BackgroundColor;
            listViewGradients.BackColor = ThemeColorTable.BackgroundColor;
        }