AGENT-156: The enabled connection should appear as a select box (fixed)

git-svn-id: e50c45cbb4bca95c9efdc2cae91e8560fbd36472@20140 28e8926c-6b08-0410-baaa-805c5e19b8d6

--- AgentForAgent/ConfigEditor.Designer.cs
+++ AgentForAgent/ConfigEditor.Designer.cs
@@ -52,6 +52,11 @@
             this.proactiveDirectory = new System.Windows.Forms.TextBox();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.generalTabPage = new System.Windows.Forms.TabPage();
+            this.runtimeIncomingProtocolGroupBox = new System.Windows.Forms.GroupBox();
+            this.protocolComboBox = new System.Windows.Forms.ComboBox();
+            this.protocolLabel = new System.Windows.Forms.Label();
+            this.portInitialValue = new System.Windows.Forms.Label();
+            this.portInitialValueNumericUpDown = new System.Windows.Forms.NumericUpDown();
             this.onRuntimeExitGroupBox = new System.Windows.Forms.GroupBox();
             this.scriptLocationButton = new System.Windows.Forms.Button();
             this.scriptLocationTextBox = new System.Windows.Forms.TextBox();
@@ -70,7 +75,6 @@
             this.availablePhysicalMemoryValue = new System.Windows.Forms.Label();
             this.availablePhysicalMemoryLabel = new System.Windows.Forms.Label();
             this.connectionTabPage = new System.Windows.Forms.TabPage();
-            this.enabledConnectionGroupBox = new System.Windows.Forms.GroupBox();
             this.resourceManagerRegistrationRadioButton = new System.Windows.Forms.RadioButton();
             this.localRegistrationRadioButton = new System.Windows.Forms.RadioButton();
             this.customRadioButton = new System.Windows.Forms.RadioButton();
@@ -141,7 +145,6 @@
             this.showButton = new System.Windows.Forms.Button();
             this.createEventButton = new System.Windows.Forms.Button();
             this.deleteEventButton = new System.Windows.Forms.Button();
-            this.eventsList = new AgentForAgent.RefreshingListBox();
             this.saveConfig = new System.Windows.Forms.Button();
             this.closeConfig = new System.Windows.Forms.Button();
             this.proActiveLocationBrowser = new System.Windows.Forms.FolderBrowserDialog();
@@ -151,14 +154,12 @@
             this.scriptLocationOpenDialog = new System.Windows.Forms.OpenFileDialog();
             this.toolTip = new System.Windows.Forms.ToolTip(this.components);
             this.credentialLocationOpenDialog = new System.Windows.Forms.OpenFileDialog();
-            this.runtimeIncomingProtocolGroupBox = new System.Windows.Forms.GroupBox();
-            this.protocolComboBox = new System.Windows.Forms.ComboBox();
-            this.protocolLabel = new System.Windows.Forms.Label();
-            this.portInitialValue = new System.Windows.Forms.Label();
-            this.portInitialValueNumericUpDown = new System.Windows.Forms.NumericUpDown();
+            this.eventsList = new AgentForAgent.RefreshingListBox();
             this.groupBox1.SuspendLayout();
             this.tabControl1.SuspendLayout();
             this.generalTabPage.SuspendLayout();
+            this.runtimeIncomingProtocolGroupBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.portInitialValueNumericUpDown)).BeginInit();
             this.onRuntimeExitGroupBox.SuspendLayout();
             this.multiRuntimeGroupBox.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.nbRuntimesNumericUpDown)).BeginInit();
@@ -166,7 +167,6 @@
             this.memoryLimitGroupBox.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.memoryLimitNumericUpDown)).BeginInit();
             this.connectionTabPage.SuspendLayout();
-            this.enabledConnectionGroupBox.SuspendLayout();
             this.connectionTypeTabControl.SuspendLayout();
             this.localRegistrationTabPage.SuspendLayout();
             this.rmiRegistrationAdditionalConfigurationGroupBox.SuspendLayout();
@@ -192,8 +192,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.minutesDuration)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.hoursDuration)).BeginInit();
             this.planningGroupBox.SuspendLayout();
-            this.runtimeIncomingProtocolGroupBox.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.portInitialValueNumericUpDown)).BeginInit();
             this.SuspendLayout();
             //
             // groupBox1
@@ -322,6 +320,80 @@
             this.generalTabPage.Text = "General";
             this.generalTabPage.UseVisualStyleBackColor = true;
             //
+            // runtimeIncomingProtocolGroupBox
+            //
+            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.protocolComboBox);
+            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.protocolLabel);
+            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.portInitialValue);
+            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.portInitialValueNumericUpDown);
+            this.runtimeIncomingProtocolGroupBox.Location = new System.Drawing.Point(3, 318);
+            this.runtimeIncomingProtocolGroupBox.Name = "runtimeIncomingProtocolGroupBox";
+            this.runtimeIncomingProtocolGroupBox.Size = new System.Drawing.Size(385, 50);
+            this.runtimeIncomingProtocolGroupBox.TabIndex = 6;
+            this.runtimeIncomingProtocolGroupBox.TabStop = false;
+            this.runtimeIncomingProtocolGroupBox.Text = "Runtime Incoming Protocol";
+            //
+            // protocolComboBox
+            //
+            this.protocolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.protocolComboBox.FormattingEnabled = true;
+            this.protocolComboBox.Items.AddRange(new object[] {
+            "undefined",
+            "rmi",
+            "http",
+            "pamr",
+            "pnp",
+            "pnps"});
+            this.protocolComboBox.Location = new System.Drawing.Point(145, 19);
+            this.protocolComboBox.Name = "protocolComboBox";
+            this.protocolComboBox.Size = new System.Drawing.Size(74, 21);
+            this.protocolComboBox.TabIndex = 3;
+            this.toolTip.SetToolTip(this.protocolComboBox, "Defines the protocol to be used by the Runtime.");
+            this.protocolComboBox.SelectedIndexChanged += new System.EventHandler(this.protocolComboBox_SelectedIndexChanged);
+            //
+            // protocolLabel
+            //
+            this.protocolLabel.AutoSize = true;
+            this.protocolLabel.Location = new System.Drawing.Point(90, 22);
+            this.protocolLabel.Name = "protocolLabel";
+            this.protocolLabel.Size = new System.Drawing.Size(49, 13);
+            this.protocolLabel.TabIndex = 2;
+            this.protocolLabel.Text = "Protocol:";
+            //
+            // portInitialValue
+            //
+            this.portInitialValue.AutoSize = true;
+            this.portInitialValue.Location = new System.Drawing.Point(230, 22);
+            this.portInitialValue.Name = "portInitialValue";
+            this.portInitialValue.Size = new System.Drawing.Size(86, 13);
+            this.portInitialValue.TabIndex = 1;
+            this.portInitialValue.Text = "Port Initial Value:";
+            //
+            // portInitialValueNumericUpDown
+            //
+            this.portInitialValueNumericUpDown.Location = new System.Drawing.Point(320, 20);
+            this.portInitialValueNumericUpDown.Maximum = new decimal(new int[] {
+            65534,
+            0,
+            0,
+            0});
+            this.portInitialValueNumericUpDown.Minimum = new decimal(new int[] {
+            1099,
+            0,
+            0,
+            0});
+            this.portInitialValueNumericUpDown.Name = "portInitialValueNumericUpDown";
+            this.portInitialValueNumericUpDown.Size = new System.Drawing.Size(57, 20);
+            this.portInitialValueNumericUpDown.TabIndex = 0;
+            this.toolTip.SetToolTip(this.portInitialValueNumericUpDown, "Defines the value of the \"-Dproactive.SELECTED_PROTOCOL.port\" property. This valu" +
+                    "e will always be increased by 1 or more if there is more than one Runtime.");
+            this.portInitialValueNumericUpDown.Value = new decimal(new int[] {
+            1099,
+            0,
+            0,
+            0});
+            this.portInitialValueNumericUpDown.ValueChanged += new System.EventHandler(this.initialValueNumericUpDown_ValueChanged);
+            //
             // onRuntimeExitGroupBox
             //
             this.onRuntimeExitGroupBox.Controls.Add(this.scriptLocationButton);
@@ -481,6 +553,7 @@
             this.memoryLimitNumericUpDown.Name = "memoryLimitNumericUpDown";
             this.memoryLimitNumericUpDown.Size = new System.Drawing.Size(74, 20);
             this.memoryLimitNumericUpDown.TabIndex = 5;
+            this.toolTip.SetToolTip(this.memoryLimitNumericUpDown, "0 means no memory limit and at least 128 is required for a ProActive Runtime.");
             this.memoryLimitNumericUpDown.ValueChanged += new System.EventHandler(this.memoryLimitNumericUpDown_ValueChanged);
             //
             // memoryLimitLabel
@@ -512,7 +585,9 @@
             //
             // connectionTabPage
             //
-            this.connectionTabPage.Controls.Add(this.enabledConnectionGroupBox);
+            this.connectionTabPage.Controls.Add(this.customRadioButton);
+            this.connectionTabPage.Controls.Add(this.resourceManagerRegistrationRadioButton);
+            this.connectionTabPage.Controls.Add(this.localRegistrationRadioButton);
             this.connectionTabPage.Controls.Add(this.connectionTypeTabControl);
             this.connectionTabPage.Location = new System.Drawing.Point(4, 22);
             this.connectionTabPage.Name = "connectionTabPage";
@@ -521,27 +596,14 @@
             this.connectionTabPage.Text = "Connection";
             this.connectionTabPage.UseVisualStyleBackColor = true;
             //
-            // enabledConnectionGroupBox
-            //
-            this.enabledConnectionGroupBox.Controls.Add(this.resourceManagerRegistrationRadioButton);
-            this.enabledConnectionGroupBox.Controls.Add(this.localRegistrationRadioButton);
-            this.enabledConnectionGroupBox.Controls.Add(this.customRadioButton);
-            this.enabledConnectionGroupBox.Location = new System.Drawing.Point(3, 3);
-            this.enabledConnectionGroupBox.Name = "enabledConnectionGroupBox";
-            this.enabledConnectionGroupBox.Size = new System.Drawing.Size(359, 45);
-            this.enabledConnectionGroupBox.TabIndex = 4;
-            this.enabledConnectionGroupBox.TabStop = false;
-            this.enabledConnectionGroupBox.Text = "Enabled Connection";
-            //
             // resourceManagerRegistrationRadioButton
             //
             this.resourceManagerRegistrationRadioButton.AutoSize = true;
-            this.resourceManagerRegistrationRadioButton.Location = new System.Drawing.Point(119, 19);
+            this.resourceManagerRegistrationRadioButton.Location = new System.Drawing.Point(3, 27);
             this.resourceManagerRegistrationRadioButton.Name = "resourceManagerRegistrationRadioButton";
-            this.resourceManagerRegistrationRadioButton.Size = new System.Drawing.Size(175, 17);
+            this.resourceManagerRegistrationRadioButton.Size = new System.Drawing.Size(14, 13);
             this.resourceManagerRegistrationRadioButton.TabIndex = 2;
             this.resourceManagerRegistrationRadioButton.TabStop = true;
-            this.resourceManagerRegistrationRadioButton.Text = "Resource Manager Registration";
             this.toolTip.SetToolTip(this.resourceManagerRegistrationRadioButton, "Enables the Resource Manager Registration. The Runtime will try to registrate to " +
                     "the specified Resource Manager.");
             this.resourceManagerRegistrationRadioButton.UseVisualStyleBackColor = true;
@@ -550,12 +612,11 @@
             // localRegistrationRadioButton
             //
             this.localRegistrationRadioButton.AutoSize = true;
-            this.localRegistrationRadioButton.Location = new System.Drawing.Point(6, 19);
+            this.localRegistrationRadioButton.Location = new System.Drawing.Point(3, 7);
             this.localRegistrationRadioButton.Name = "localRegistrationRadioButton";
-            this.localRegistrationRadioButton.Size = new System.Drawing.Size(110, 17);
+            this.localRegistrationRadioButton.Size = new System.Drawing.Size(14, 13);
             this.localRegistrationRadioButton.TabIndex = 1;
             this.localRegistrationRadioButton.TabStop = true;
-            this.localRegistrationRadioButton.Text = "Local Registration";
             this.toolTip.SetToolTip(this.localRegistrationRadioButton, "Enables the Local Registration.The runtime will be registred locally.");
             this.localRegistrationRadioButton.UseVisualStyleBackColor = true;
             this.localRegistrationRadioButton.CheckedChanged += new System.EventHandler(this.rmiRegistrationRadioButton_CheckedChanged);
@@ -563,12 +624,11 @@
             // customRadioButton
             //
             this.customRadioButton.AutoSize = true;
-            this.customRadioButton.Location = new System.Drawing.Point(297, 19);
+            this.customRadioButton.Location = new System.Drawing.Point(3, 47);
             this.customRadioButton.Name = "customRadioButton";
-            this.customRadioButton.Size = new System.Drawing.Size(60, 17);
+            this.customRadioButton.Size = new System.Drawing.Size(14, 13);
             this.customRadioButton.TabIndex = 3;
             this.customRadioButton.TabStop = true;
-            this.customRadioButton.Text = "Custom";
             this.toolTip.SetToolTip(this.customRadioButton, "Enables a user defined connection. See the \"Custom\" tab below.");
             this.customRadioButton.UseVisualStyleBackColor = true;
             this.customRadioButton.CheckedChanged += new System.EventHandler(this.customRadioButton_CheckedChanged);
@@ -582,11 +642,11 @@
             this.connectionTypeTabControl.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
             this.connectionTypeTabControl.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.connectionTypeTabControl.ItemSize = new System.Drawing.Size(19, 175);
-            this.connectionTypeTabControl.Location = new System.Drawing.Point(3, 57);
+            this.connectionTypeTabControl.Location = new System.Drawing.Point(23, 3);
             this.connectionTypeTabControl.Multiline = true;
             this.connectionTypeTabControl.Name = "connectionTypeTabControl";
             this.connectionTypeTabControl.SelectedIndex = 0;
-            this.connectionTypeTabControl.Size = new System.Drawing.Size(668, 314);
+            this.connectionTypeTabControl.Size = new System.Drawing.Size(648, 368);
             this.connectionTypeTabControl.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
             this.connectionTypeTabControl.TabIndex = 0;
             this.connectionTypeTabControl.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.actionTypeTabControl_DrawItem);
@@ -598,7 +658,7 @@
             this.localRegistrationTabPage.Location = new System.Drawing.Point(179, 4);
             this.localRegistrationTabPage.Name = "localRegistrationTabPage";
             this.localRegistrationTabPage.Padding = new System.Windows.Forms.Padding(3);
-            this.localRegistrationTabPage.Size = new System.Drawing.Size(485, 306);
+            this.localRegistrationTabPage.Size = new System.Drawing.Size(465, 360);
             this.localRegistrationTabPage.TabIndex = 0;
             this.localRegistrationTabPage.Text = "Local Registration";
             this.localRegistrationTabPage.UseVisualStyleBackColor = true;
@@ -607,9 +667,9 @@
             //
             this.rmiRegistrationAdditionalConfigurationGroupBox.Controls.Add(this.rmiRegistrationJavaActionClassTextBox);
             this.rmiRegistrationAdditionalConfigurationGroupBox.Controls.Add(this.label13);
-            this.rmiRegistrationAdditionalConfigurationGroupBox.Location = new System.Drawing.Point(6, 252);
+            this.rmiRegistrationAdditionalConfigurationGroupBox.Location = new System.Drawing.Point(6, 306);
             this.rmiRegistrationAdditionalConfigurationGroupBox.Name = "rmiRegistrationAdditionalConfigurationGroupBox";
-            this.rmiRegistrationAdditionalConfigurationGroupBox.Size = new System.Drawing.Size(473, 48);
+            this.rmiRegistrationAdditionalConfigurationGroupBox.Size = new System.Drawing.Size(453, 48);
             this.rmiRegistrationAdditionalConfigurationGroupBox.TabIndex = 2;
             this.rmiRegistrationAdditionalConfigurationGroupBox.TabStop = false;
             this.rmiRegistrationAdditionalConfigurationGroupBox.Text = "Additional Configuration";
@@ -618,7 +678,7 @@
             //
             this.rmiRegistrationJavaActionClassTextBox.Location = new System.Drawing.Point(106, 19);
             this.rmiRegistrationJavaActionClassTextBox.Name = "rmiRegistrationJavaActionClassTextBox";
-            this.rmiRegistrationJavaActionClassTextBox.Size = new System.Drawing.Size(361, 20);
+            this.rmiRegistrationJavaActionClassTextBox.Size = new System.Drawing.Size(341, 20);
             this.rmiRegistrationJavaActionClassTextBox.TabIndex = 1;
             this.toolTip.SetToolTip(this.rmiRegistrationJavaActionClassTextBox, "Defines the Java class to run.");
             //
@@ -637,7 +697,7 @@
             this.localRegistrationGroupBox.Controls.Add(this.localRegistrationNodeName);
             this.localRegistrationGroupBox.Location = new System.Drawing.Point(6, 6);
             this.localRegistrationGroupBox.Name = "localRegistrationGroupBox";
-            this.localRegistrationGroupBox.Size = new System.Drawing.Size(473, 53);
+            this.localRegistrationGroupBox.Size = new System.Drawing.Size(453, 53);
             this.localRegistrationGroupBox.TabIndex = 1;
             this.localRegistrationGroupBox.TabStop = false;
             this.localRegistrationGroupBox.Text = "Local Registration";
@@ -655,7 +715,7 @@
             //
             this.localRegistrationNodeName.Location = new System.Drawing.Point(79, 19);
             this.localRegistrationNodeName.Name = "localRegistrationNodeName";
-            this.localRegistrationNodeName.Size = new System.Drawing.Size(388, 20);
+            this.localRegistrationNodeName.Size = new System.Drawing.Size(368, 20);
             this.localRegistrationNodeName.TabIndex = 1;
             this.toolTip.SetToolTip(this.localRegistrationNodeName, "Defines the name of the node. The node will be registered under url like URL://IP" +
                     "_OR_HOSTNAME:PORT/NODE_NAME");
@@ -669,7 +729,7 @@
             this.resourceManagerRegistrationTabPage.Location = new System.Drawing.Point(179, 4);
             this.resourceManagerRegistrationTabPage.Name = "resourceManagerRegistrationTabPage";
             this.resourceManagerRegistrationTabPage.Padding = new System.Windows.Forms.Padding(3);
-            this.resourceManagerRegistrationTabPage.Size = new System.Drawing.Size(485, 306);
+            this.resourceManagerRegistrationTabPage.Size = new System.Drawing.Size(465, 360);
             this.resourceManagerRegistrationTabPage.TabIndex = 1;
             this.resourceManagerRegistrationTabPage.Text = "Resource Manager Registration";
             this.resourceManagerRegistrationTabPage.UseVisualStyleBackColor = true;
@@ -678,9 +738,9 @@
             //
             this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Controls.Add(this.resourceManagerRegistrationJavaActionClassTextBox);
             this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Controls.Add(this.label18);
-            this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Location = new System.Drawing.Point(6, 252);
+            this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Location = new System.Drawing.Point(6, 306);
             this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Name = "resourceManagerRegistrationAdditionalConfigurationGroupBox";
-            this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Size = new System.Drawing.Size(473, 48);
+            this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Size = new System.Drawing.Size(453, 48);
             this.resourceManagerRegistrationAdditionalConfigurationGroupBox.TabIndex = 4;
             this.resourceManagerRegistrationAdditionalConfigurationGroupBox.TabStop = false;
             this.resourceManagerRegistrationAdditionalConfigurationGroupBox.Text = "Additional Configuration";
@@ -689,7 +749,7 @@
             //
             this.resourceManagerRegistrationJavaActionClassTextBox.Location = new System.Drawing.Point(106, 19);
             this.resourceManagerRegistrationJavaActionClassTextBox.Name = "resourceManagerRegistrationJavaActionClassTextBox";
-            this.resourceManagerRegistrationJavaActionClassTextBox.Size = new System.Drawing.Size(361, 20);
+            this.resourceManagerRegistrationJavaActionClassTextBox.Size = new System.Drawing.Size(341, 20);
             this.resourceManagerRegistrationJavaActionClassTextBox.TabIndex = 1;
             this.toolTip.SetToolTip(this.resourceManagerRegistrationJavaActionClassTextBox, "Defines the Java class to run.");
             //
@@ -712,7 +772,7 @@
             this.rmActionGroup.Controls.Add(this.resourceManagerUrlLabel);
             this.rmActionGroup.Location = new System.Drawing.Point(6, 6);
             this.rmActionGroup.Name = "rmActionGroup";
-            this.rmActionGroup.Size = new System.Drawing.Size(473, 100);
+            this.rmActionGroup.Size = new System.Drawing.Size(453, 100);
             this.rmActionGroup.TabIndex = 3;
             this.rmActionGroup.TabStop = false;
             this.rmActionGroup.Text = "Resource Manager Registration";
@@ -730,7 +790,7 @@
             //
             this.nodeSourceNameTextBox.Location = new System.Drawing.Point(138, 72);
             this.nodeSourceNameTextBox.Name = "nodeSourceNameTextBox";
-            this.nodeSourceNameTextBox.Size = new System.Drawing.Size(329, 20);
+            this.nodeSourceNameTextBox.Size = new System.Drawing.Size(309, 20);
             this.nodeSourceNameTextBox.TabIndex = 10;
             this.toolTip.SetToolTip(this.nodeSourceNameTextBox, "The name of the node source without whitespaces.");
             this.nodeSourceNameTextBox.TextChanged += new System.EventHandler(this.nodeSourceNameTextBox_TextChanged);
@@ -739,7 +799,7 @@
             //
             this.nodeNameTextBox.Location = new System.Drawing.Point(138, 45);
             this.nodeNameTextBox.Name = "nodeNameTextBox";
-            this.nodeNameTextBox.Size = new System.Drawing.Size(329, 20);
+            this.nodeNameTextBox.Size = new System.Drawing.Size(309, 20);
             this.nodeNameTextBox.TabIndex = 3;
             this.toolTip.SetToolTip(this.nodeNameTextBox, "The name of the node without whitespaces.");
             this.nodeNameTextBox.TextChanged += new System.EventHandler(this.rmNodeName_TextChanged);
@@ -757,7 +817,7 @@
             //
             this.rmUrl.Location = new System.Drawing.Point(138, 19);
             this.rmUrl.Name = "rmUrl";
-            this.rmUrl.Size = new System.Drawing.Size(329, 20);
+            this.rmUrl.Size = new System.Drawing.Size(309, 20);
             this.rmUrl.TabIndex = 1;
             this.toolTip.SetToolTip(this.rmUrl, "Example: PROTOCOL://HOSTNAME_OR_IP_ADDRESS:PORT");
             this.rmUrl.TextChanged += new System.EventHandler(this.rmUrl_TextChanged);
@@ -779,7 +839,7 @@
             this.authenticationCredentialGroupBox.Controls.Add(this.credentialLocationTextBox);
             this.authenticationCredentialGroupBox.Location = new System.Drawing.Point(6, 112);
             this.authenticationCredentialGroupBox.Name = "authenticationCredentialGroupBox";
-            this.authenticationCredentialGroupBox.Size = new System.Drawing.Size(473, 50);
+            this.authenticationCredentialGroupBox.Size = new System.Drawing.Size(453, 50);
             this.authenticationCredentialGroupBox.TabIndex = 9;
             this.authenticationCredentialGroupBox.TabStop = false;
             this.authenticationCredentialGroupBox.Text = "Authentication Credential";
@@ -814,7 +874,7 @@
             //
             this.credentialLocationTextBox.Location = new System.Drawing.Point(138, 20);
             this.credentialLocationTextBox.Name = "credentialLocationTextBox";
-            this.credentialLocationTextBox.Size = new System.Drawing.Size(329, 20);
+            this.credentialLocationTextBox.Size = new System.Drawing.Size(309, 20);
             this.credentialLocationTextBox.TabIndex = 0;
             this.toolTip.SetToolTip(this.credentialLocationTextBox, "Location of the file that contains the credential.");
             this.credentialLocationTextBox.TextChanged += new System.EventHandler(this.credentialLocationTextBox_TextChanged);
@@ -826,7 +886,7 @@
             this.customTabPage.Location = new System.Drawing.Point(179, 4);
             this.customTabPage.Name = "customTabPage";
             this.customTabPage.Padding = new System.Windows.Forms.Padding(3);
-            this.customTabPage.Size = new System.Drawing.Size(485, 306);
+            this.customTabPage.Size = new System.Drawing.Size(465, 360);
             this.customTabPage.TabIndex = 2;
             this.customTabPage.Text = "Custom";
             this.customTabPage.UseVisualStyleBackColor = true;
@@ -835,9 +895,9 @@
             //
             this.customAdditionalConfigurationGroupBox.Controls.Add(this.customJavaActionClassTextBox);
             this.customAdditionalConfigurationGroupBox.Controls.Add(this.label19);
-            this.customAdditionalConfigurationGroupBox.Location = new System.Drawing.Point(6, 252);
+            this.customAdditionalConfigurationGroupBox.Location = new System.Drawing.Point(6, 306);
             this.customAdditionalConfigurationGroupBox.Name = "customAdditionalConfigurationGroupBox";
-            this.customAdditionalConfigurationGroupBox.Size = new System.Drawing.Size(473, 48);
+            this.customAdditionalConfigurationGroupBox.Size = new System.Drawing.Size(453, 48);
             this.customAdditionalConfigurationGroupBox.TabIndex = 5;
             this.customAdditionalConfigurationGroupBox.TabStop = false;
             this.customAdditionalConfigurationGroupBox.Text = "Additional Configuration";
@@ -846,7 +906,7 @@
             //
             this.customJavaActionClassTextBox.Location = new System.Drawing.Point(106, 19);
             this.customJavaActionClassTextBox.Name = "customJavaActionClassTextBox";
-            this.customJavaActionClassTextBox.Size = new System.Drawing.Size(361, 20);
+            this.customJavaActionClassTextBox.Size = new System.Drawing.Size(341, 20);
             this.customJavaActionClassTextBox.TabIndex = 1;
             this.toolTip.SetToolTip(this.customJavaActionClassTextBox, "Defines the Java class to run.");
             //
@@ -870,7 +930,7 @@
             this.customActionGroup.Controls.Add(this.label14);
             this.customActionGroup.Location = new System.Drawing.Point(6, 6);
             this.customActionGroup.Name = "customActionGroup";
-            this.customActionGroup.Size = new System.Drawing.Size(473, 151);
+            this.customActionGroup.Size = new System.Drawing.Size(453, 151);
             this.customActionGroup.TabIndex = 3;
             this.customActionGroup.TabStop = false;
             this.customActionGroup.Text = "Custom";
@@ -878,7 +938,7 @@
             // customSaveArgumentButton
             //
             this.customSaveArgumentButton.Enabled = false;
-            this.customSaveArgumentButton.Location = new System.Drawing.Point(392, 93);
+            this.customSaveArgumentButton.Location = new System.Drawing.Point(372, 93);
             this.customSaveArgumentButton.Name = "customSaveArgumentButton";
             this.customSaveArgumentButton.Size = new System.Drawing.Size(75, 23);
             this.customSaveArgumentButton.TabIndex = 6;
@@ -891,7 +951,7 @@
             //
             this.customArgumentTextBox.Location = new System.Drawing.Point(69, 122);
             this.customArgumentTextBox.Name = "customArgumentTextBox";
-            this.customArgumentTextBox.Size = new System.Drawing.Size(398, 20);
+            this.customArgumentTextBox.Size = new System.Drawing.Size(378, 20);
             this.customArgumentTextBox.TabIndex = 5;
             this.toolTip.SetToolTip(this.customArgumentTextBox, "Enter an argument without whitespaces.");
             //
@@ -906,7 +966,7 @@
             //
             // customDeleteButton
             //
-            this.customDeleteButton.Location = new System.Drawing.Point(392, 63);
+            this.customDeleteButton.Location = new System.Drawing.Point(372, 63);
             this.customDeleteButton.Name = "customDeleteButton";
             this.customDeleteButton.Size = new System.Drawing.Size(75, 23);
             this.customDeleteButton.TabIndex = 3;
@@ -917,7 +977,7 @@
             //
             // customAddButton
             //
-            this.customAddButton.Location = new System.Drawing.Point(392, 34);
+            this.customAddButton.Location = new System.Drawing.Point(372, 34);
             this.customAddButton.Name = "customAddButton";
             this.customAddButton.Size = new System.Drawing.Size(75, 23);
             this.customAddButton.TabIndex = 2;
@@ -931,7 +991,7 @@
             this.customArgumentsListBox.FormattingEnabled = true;
             this.customArgumentsListBox.Location = new System.Drawing.Point(9, 34);
             this.customArgumentsListBox.Name = "customArgumentsListBox";
-            this.customArgumentsListBox.Size = new System.Drawing.Size(377, 82);
+            this.customArgumentsListBox.Size = new System.Drawing.Size(357, 82);
             this.customArgumentsListBox.TabIndex = 1;
             this.toolTip.SetToolTip(this.customArgumentsListBox, "A list of arguments that will be passed as parameters of the Java Starter Class.");
             this.customArgumentsListBox.SelectedIndexChanged += new System.EventHandler(this.customArgumentsListBox_SelectedIndexChanged);
@@ -1331,16 +1391,6 @@
             this.deleteEventButton.UseVisualStyleBackColor = true;
             this.deleteEventButton.Click += new System.EventHandler(this.deleteEventButton_Click);
             //
-            // eventsList
-            //
-            this.eventsList.FormattingEnabled = true;
-            this.eventsList.Location = new System.Drawing.Point(6, 19);
-            this.eventsList.Name = "eventsList";
-            this.eventsList.Size = new System.Drawing.Size(235, 303);
-            this.eventsList.TabIndex = 0;
-            this.toolTip.SetToolTip(this.eventsList, "The list of weekly plans.");
-            this.eventsList.SelectedIndexChanged += new System.EventHandler(this.eventsList_SelectedIndexChanged);
-            //
             // saveConfig
             //
             this.saveConfig.Enabled = false;
@@ -1393,77 +1443,15 @@
             this.credentialLocationOpenDialog.DefaultExt = "cred";
             this.credentialLocationOpenDialog.Filter = "Credentials .cred|*.cred";
             //
-            // runtimeIncomingProtocolGroupBox
-            //
-            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.protocolComboBox);
-            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.protocolLabel);
-            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.portInitialValue);
-            this.runtimeIncomingProtocolGroupBox.Controls.Add(this.portInitialValueNumericUpDown);
-            this.runtimeIncomingProtocolGroupBox.Location = new System.Drawing.Point(3, 318);
-            this.runtimeIncomingProtocolGroupBox.Name = "runtimeIncomingProtocolGroupBox";
-            this.runtimeIncomingProtocolGroupBox.Size = new System.Drawing.Size(385, 50);
-            this.runtimeIncomingProtocolGroupBox.TabIndex = 6;
-            this.runtimeIncomingProtocolGroupBox.TabStop = false;
-            this.runtimeIncomingProtocolGroupBox.Text = "Runtime Incoming Protocol";
-            //
-            // protocolComboBox
-            //
-            this.protocolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.protocolComboBox.FormattingEnabled = true;
-            this.protocolComboBox.Items.AddRange(new object[] {
-            "undefined",
-            "rmi",
-            "http",
-            "pamr",
-            "pnp",
-            "pnps"});
-            this.protocolComboBox.Location = new System.Drawing.Point(145, 19);
-            this.protocolComboBox.Name = "protocolComboBox";
-            this.protocolComboBox.Size = new System.Drawing.Size(74, 21);
-            this.protocolComboBox.TabIndex = 3;
-            this.toolTip.SetToolTip(this.protocolComboBox, "Defines the protocol to be used by the Runtime.");
-            //
-            // protocolLabel
-            //
-            this.protocolLabel.AutoSize = true;
-            this.protocolLabel.Location = new System.Drawing.Point(90, 22);
-            this.protocolLabel.Name = "protocolLabel";
-            this.protocolLabel.Size = new System.Drawing.Size(49, 13);
-            this.protocolLabel.TabIndex = 2;
-            this.protocolLabel.Text = "Protocol:";
-            //
-            // portInitialValue
-            //
-            this.portInitialValue.AutoSize = true;
-            this.portInitialValue.Location = new System.Drawing.Point(230, 22);
-            this.portInitialValue.Name = "portInitialValue";
-            this.portInitialValue.Size = new System.Drawing.Size(86, 13);
-            this.portInitialValue.TabIndex = 1;
-            this.portInitialValue.Text = "Port Initial Value:";
-            //
-            // portInitialValueNumericUpDown
-            //
-            this.portInitialValueNumericUpDown.Location = new System.Drawing.Point(320, 20);
-            this.portInitialValueNumericUpDown.Maximum = new decimal(new int[] {
-            65534,
-            0,
-            0,
-            0});
-            this.portInitialValueNumericUpDown.Minimum = new decimal(new int[] {
-            1099,
-            0,
-            0,
-            0});
-            this.portInitialValueNumericUpDown.Name = "portInitialValueNumericUpDown";
-            this.portInitialValueNumericUpDown.Size = new System.Drawing.Size(57, 20);
-            this.portInitialValueNumericUpDown.TabIndex = 0;
-            this.toolTip.SetToolTip(this.portInitialValueNumericUpDown, "Defines the value of the \"-Dproactive.SELECTED_PROTOCOL.port\" property. This valu" +
-                    "e will always be increased by 1 or more if there is more than one Runtime.");
-            this.portInitialValueNumericUpDown.Value = new decimal(new int[] {
-            1099,
-            0,
-            0,
-            0});
+            // eventsList
+            //
+            this.eventsList.FormattingEnabled = true;
+            this.eventsList.Location = new System.Drawing.Point(6, 19);
+            this.eventsList.Name = "eventsList";
+            this.eventsList.Size = new System.Drawing.Size(235, 303);
+            this.eventsList.TabIndex = 0;
+            this.toolTip.SetToolTip(this.eventsList, "The list of weekly plans.");
+            this.eventsList.SelectedIndexChanged += new System.EventHandler(this.eventsList_SelectedIndexChanged);
             //
             // ConfigurationEditor
             //
@@ -1486,6 +1474,9 @@
             this.groupBox1.PerformLayout();
             this.tabControl1.ResumeLayout(false);
             this.generalTabPage.ResumeLayout(false);
+            this.runtimeIncomingProtocolGroupBox.ResumeLayout(false);
+            this.runtimeIncomingProtocolGroupBox.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.portInitialValueNumericUpDown)).EndInit();
             this.onRuntimeExitGroupBox.ResumeLayout(false);
             this.onRuntimeExitGroupBox.PerformLayout();
             this.multiRuntimeGroupBox.ResumeLayout(false);
@@ -1496,8 +1487,7 @@
             this.memoryLimitGroupBox.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.memoryLimitNumericUpDown)).EndInit();
             this.connectionTabPage.ResumeLayout(false);
-            this.enabledConnectionGroupBox.ResumeLayout(false);
-            this.enabledConnectionGroupBox.PerformLayout();
+            this.connectionTabPage.PerformLayout();
             this.connectionTypeTabControl.ResumeLayout(false);
             this.localRegistrationTabPage.ResumeLayout(false);
             this.rmiRegistrationAdditionalConfigurationGroupBox.ResumeLayout(false);
@@ -1534,9 +1524,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.minutesDuration)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.hoursDuration)).EndInit();
             this.planningGroupBox.ResumeLayout(false);
-            this.runtimeIncomingProtocolGroupBox.ResumeLayout(false);
-            this.runtimeIncomingProtocolGroupBox.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.portInitialValueNumericUpDown)).EndInit();
             this.ResumeLayout(false);

         }
@@ -1626,7 +1613,6 @@
         private System.Windows.Forms.GroupBox customAdditionalConfigurationGroupBox;
         private System.Windows.Forms.TextBox customJavaActionClassTextBox;
         private System.Windows.Forms.Label label19;
-        private System.Windows.Forms.GroupBox enabledConnectionGroupBox;
         private System.Windows.Forms.Label maxCpuUsageLabel;
         private System.Windows.Forms.Label label20;
         private System.Windows.Forms.NumericUpDown maxCpuUsageNumericUpDown;


Fixing userinfo bug

Fixing userinfo bug

--- src/Commands/UserInfoCommand.cs
+++ src/Commands/UserInfoCommand.cs
@@ -101,12 +101,15 @@
                     }
                 }

-                embedBuilder.AddField((field) =>
+                if (roles.Count > 0)
                 {
-                    field.IsInline = false;
-                    field.Name = "roles";
-                    field.Value = string.Join(", ", roles);
-                });
+                    embedBuilder.AddField((field) =>
+                    {
+                        field.IsInline = false;
+                        field.Name = "roles";
+                        field.Value = string.Join(", ", roles);
+                    });
+                }

                 embedBuilder.AddField((field) =>
                 {
@@ -120,7 +123,7 @@
                 text = $"{userInfo.Title}{userInfo.NicknameInfo}: ID: {userInfo.Id} | Created: {userInfo.Created} | Joined: {userInfo.Joined} | word on the street: {userInfo.Footnote}";
             }

-            return Task.FromResult(new CommandResponse { Text = text, Embed = embedBuilder.Build() });
+            return Task.FromResult(new CommandResponse { Text = text, Embed = embedBuilder?.Build() });
         }
     }
 }


add to CA dictionary

add to CA dictionary

--- Analyzers/analyzers/SuppressBecause.cs
+++ Analyzers/analyzers/SuppressBecause.cs
@@ -135,6 +135,11 @@
         public const string CA1726_UsePreferredTerms_FlagsAddedForTestsWhereEnumKindIsPrimaryConcern = "The identifier includes 'Flags' to improve readability and comprehension of unit tests where the kind of Enum is a primary concern of those tests.";

         /// <summary>
+        /// The name of the Type of the identifier uses the term 'Flags' and so it's appropriate to use that term in the the name of the identifier.
+        /// </summary>
+        public const string CA1726_UsePreferredTerms_NameOfTypeOfIdentifierUsesTheTermFlags = "The name of the Type of the identifier uses the term 'Flags' and so it's appropriate to use that term in the the name of the identifier.";
+
+        /// <summary>
         /// The static field(s) are declared in a code generated partial test class that should not be alterated.
         /// </summary>
         public const string CA1810_InitializeReferenceTypeStaticFieldsInline_FieldsDeclaredInCodeGeneratedPartialTestClass = "The static field(s) are declared in a code generated partial test class that should not be alterated.";


ObservableFromFile: open file streams in FileShare.Read mode, otherwise it will crash with an already-open IOException when the server is under high load

--- Anna/Observables/ObservableFromFile.cs
+++ Anna/Observables/ObservableFromFile.cs
@@ -18,7 +18,7 @@
             buffer = new byte[chunkSize];
             subject = Observable.Create<byte[]>(obs =>
                                                     {
-                                                        fileStream = new FileStream(fileName, FileMode.Open);
+                                                        fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                                                         fileStream.BeginRead(buffer, 0, chunkSize,
                                                                              ar => EndReadCallback(ar, obs), null);
                                                         return () => fileStream.Close();


#42 added INFO level logging of loading actions

--- src/ConfigR/FileConfigurator.cs
+++ src/ConfigR/FileConfigurator.cs
@@ -44,6 +44,8 @@
         {
             var fileSystem = new ConfigRFileSystem(new FileSystem());
             log.DebugFormat(CultureInfo.InvariantCulture, "Initialized file system with current directory {0}", fileSystem.CurrentDirectory);
+
+            log.InfoFormat(CultureInfo.InvariantCulture, "Loading '{0}'", fileSystem.GetFullPath(this.path));

             var scriptCsLog = LogManager.GetLogger("ScriptCs");
             var engine = new RoslynScriptEngine(new ScriptHostFactory(), scriptCsLog);


Empty strings handling added where was missing

--- Assets/Adjust/Android/AdjustAndroid.cs
+++ Assets/Adjust/Android/AdjustAndroid.cs
@@ -266,14 +266,22 @@
                 }

                 AdjustAttribution adjustAttribution = new AdjustAttribution();
-                adjustAttribution.trackerName = ajoAttribution.Get<string>(AdjustUtils.KeyTrackerName);
-                adjustAttribution.trackerToken = ajoAttribution.Get<string>(AdjustUtils.KeyTrackerToken);
-                adjustAttribution.network = ajoAttribution.Get<string>(AdjustUtils.KeyNetwork);
-                adjustAttribution.campaign = ajoAttribution.Get<string>(AdjustUtils.KeyCampaign);
-                adjustAttribution.adgroup = ajoAttribution.Get<string>(AdjustUtils.KeyAdgroup);
-                adjustAttribution.creative = ajoAttribution.Get<string>(AdjustUtils.KeyCreative);
-                adjustAttribution.clickLabel = ajoAttribution.Get<string>(AdjustUtils.KeyClickLabel);
-                adjustAttribution.adid = ajoAttribution.Get<string>(AdjustUtils.KeyAdid);
+                adjustAttribution.trackerName = ajoAttribution.Get<string>(AdjustUtils.KeyTrackerName) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyTrackerName);
+                adjustAttribution.trackerToken = ajoAttribution.Get<string>(AdjustUtils.KeyTrackerToken) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyTrackerToken);
+                adjustAttribution.network = ajoAttribution.Get<string>(AdjustUtils.KeyNetwork) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyNetwork);
+                adjustAttribution.campaign = ajoAttribution.Get<string>(AdjustUtils.KeyCampaign) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyCampaign);
+                adjustAttribution.adgroup = ajoAttribution.Get<string>(AdjustUtils.KeyAdgroup) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyAdgroup);
+                adjustAttribution.creative = ajoAttribution.Get<string>(AdjustUtils.KeyCreative) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyCreative);
+                adjustAttribution.clickLabel = ajoAttribution.Get<string>(AdjustUtils.KeyClickLabel) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyClickLabel);
+                adjustAttribution.adid = ajoAttribution.Get<string>(AdjustUtils.KeyAdid) == "" ?
+                    null : ajoAttribution.Get<string>(AdjustUtils.KeyAdid);
                 return adjustAttribution;
             }
             catch (Exception) {}
@@ -395,14 +403,22 @@
                 }

                 AdjustAttribution adjustAttribution = new AdjustAttribution();
-                adjustAttribution.trackerName = attribution.Get<string>(AdjustUtils.KeyTrackerName);
-                adjustAttribution.trackerToken = attribution.Get<string>(AdjustUtils.KeyTrackerToken);
-                adjustAttribution.network = attribution.Get<string>(AdjustUtils.KeyNetwork);
-                adjustAttribution.campaign = attribution.Get<string>(AdjustUtils.KeyCampaign);
-                adjustAttribution.adgroup = attribution.Get<string>(AdjustUtils.KeyAdgroup);
-                adjustAttribution.creative = attribution.Get<string>(AdjustUtils.KeyCreative);
-                adjustAttribution.clickLabel = attribution.Get<string>(AdjustUtils.KeyClickLabel);
-                adjustAttribution.adid = attribution.Get<string>(AdjustUtils.KeyAdid);
+                adjustAttribution.trackerName = attribution.Get<string>(AdjustUtils.KeyTrackerName) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyTrackerName);
+                adjustAttribution.trackerToken = attribution.Get<string>(AdjustUtils.KeyTrackerToken) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyTrackerToken);
+                adjustAttribution.network = attribution.Get<string>(AdjustUtils.KeyNetwork) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyNetwork);
+                adjustAttribution.campaign = attribution.Get<string>(AdjustUtils.KeyCampaign) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyCampaign);
+                adjustAttribution.adgroup = attribution.Get<string>(AdjustUtils.KeyAdgroup) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyAdgroup);
+                adjustAttribution.creative = attribution.Get<string>(AdjustUtils.KeyCreative) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyCreative);
+                adjustAttribution.clickLabel = attribution.Get<string>(AdjustUtils.KeyClickLabel) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyClickLabel);
+                adjustAttribution.adid = attribution.Get<string>(AdjustUtils.KeyAdid) == "" ?
+                    null : attribution.Get<string>(AdjustUtils.KeyAdid);
                 callback(adjustAttribution);
             }
         }
@@ -452,11 +468,16 @@
                 }

                 AdjustEventSuccess adjustEventSuccess = new AdjustEventSuccess();
-                adjustEventSuccess.Adid = eventSuccessData.Get<string>(AdjustUtils.KeyAdid);
-                adjustEventSuccess.Message = eventSuccessData.Get<string>(AdjustUtils.KeyMessage);
-                adjustEventSuccess.Timestamp = eventSuccessData.Get<string>(AdjustUtils.KeyTimestamp);
-                adjustEventSuccess.EventToken = eventSuccessData.Get<string>(AdjustUtils.KeyEventToken);
-                adjustEventSuccess.CallbackId = eventSuccessData.Get<string>(AdjustUtils.KeyCallbackId);
+                adjustEventSuccess.Adid = eventSuccessData.Get<string>(AdjustUtils.KeyAdid) == "" ?
+                    null : eventSuccessData.Get<string>(AdjustUtils.KeyAdid);
+                adjustEventSuccess.Message = eventSuccessData.Get<string>(AdjustUtils.KeyMessage) == "" ?
+                    null : eventSuccessData.Get<string>(AdjustUtils.KeyMessage);
+                adjustEventSuccess.Timestamp = eventSuccessData.Get<string>(AdjustUtils.KeyTimestamp) == "" ?
+                    null : eventSuccessData.Get<string>(AdjustUtils.KeyTimestamp);
+                adjustEventSuccess.EventToken = eventSuccessData.Get<string>(AdjustUtils.KeyEventToken) == "" ?
+                    null : eventSuccessData.Get<string>(AdjustUtils.KeyEventToken);
+                adjustEventSuccess.CallbackId = eventSuccessData.Get<string>(AdjustUtils.KeyCallbackId) == "" ?
+                    null : eventSuccessData.Get<string>(AdjustUtils.KeyCallbackId);

                 try
                 {
@@ -497,12 +518,17 @@
                 }

                 AdjustEventFailure adjustEventFailure = new AdjustEventFailure();
-                adjustEventFailure.Adid = eventFailureData.Get<string>(AdjustUtils.KeyAdid);
-                adjustEventFailure.Message = eventFailureData.Get<string>(AdjustUtils.KeyMessage);
+                adjustEventFailure.Adid = eventFailureData.Get<string>(AdjustUtils.KeyAdid) == "" ?
+                    null : eventFailureData.Get<string>(AdjustUtils.KeyAdid);
+                adjustEventFailure.Message = eventFailureData.Get<string>(AdjustUtils.KeyMessage) == "" ?
+                    null : eventFailureData.Get<string>(AdjustUtils.KeyMessage);
                 adjustEventFailure.WillRetry = eventFailureData.Get<bool>(AdjustUtils.KeyWillRetry);
-                adjustEventFailure.Timestamp = eventFailureData.Get<string>(AdjustUtils.KeyTimestamp);
-                adjustEventFailure.EventToken = eventFailureData.Get<string>(AdjustUtils.KeyEventToken);
-                adjustEventFailure.CallbackId = eventFailureData.Get<string>(AdjustUtils.KeyCallbackId);
+                adjustEventFailure.Timestamp = eventFailureData.Get<string>(AdjustUtils.KeyTimestamp) == "" ?
+                    null : eventFailureData.Get<string>(AdjustUtils.KeyTimestamp);
+                adjustEventFailure.EventToken = eventFailureData.Get<string>(AdjustUtils.KeyEventToken) == "" ?
+                    null : eventFailureData.Get<string>(AdjustUtils.KeyEventToken);
+                adjustEventFailure.CallbackId = eventFailureData.Get<string>(AdjustUtils.KeyCallbackId) == "" ?
+                    null : eventFailureData.Get<string>(AdjustUtils.KeyCallbackId);

                 try
                 {
@@ -543,9 +569,12 @@
                 }

                 AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess();
-                adjustSessionSuccess.Adid = sessionSuccessData.Get<string>(AdjustUtils.KeyAdid);
-                adjustSessionSuccess.Message = sessionSuccessData.Get<string>(AdjustUtils.KeyMessage);
-                adjustSessionSuccess.Timestamp = sessionSuccessData.Get<string>(AdjustUtils.KeyTimestamp);
+                adjustSessionSuccess.Adid = sessionSuccessData.Get<string>(AdjustUtils.KeyAdid) == "" ?
+                    null : sessionSuccessData.Get<string>(AdjustUtils.KeyAdid);
+                adjustSessionSuccess.Message = sessionSuccessData.Get<string>(AdjustUtils.KeyMessage) == "" ?
+                    null : sessionSuccessData.Get<string>(AdjustUtils.KeyMessage);
+                adjustSessionSuccess.Timestamp = sessionSuccessData.Get<string>(AdjustUtils.KeyTimestamp) == "" ?
+                    null : sessionSuccessData.Get<string>(AdjustUtils.KeyTimestamp);

                 try
                 {
@@ -586,10 +615,13 @@
                 }

                 AdjustSessionFailure adjustSessionFailure = new AdjustSessionFailure();
-                adjustSessionFailure.Adid = sessionFailureData.Get<string>(AdjustUtils.KeyAdid);
-                adjustSessionFailure.Message = sessionFailureData.Get<string>(AdjustUtils.KeyMessage);
+                adjustSessionFailure.Adid = sessionFailureData.Get<string>(AdjustUtils.KeyAdid) == "" ?
+                    null : sessionFailureData.Get<string>(AdjustUtils.KeyAdid);
+                adjustSessionFailure.Message = sessionFailureData.Get<string>(AdjustUtils.KeyMessage) == "" ?
+                    null : sessionFailureData.Get<string>(AdjustUtils.KeyMessage);
                 adjustSessionFailure.WillRetry = sessionFailureData.Get<bool>(AdjustUtils.KeyWillRetry);
-                adjustSessionFailure.Timestamp = sessionFailureData.Get<string>(AdjustUtils.KeyTimestamp);
+                adjustSessionFailure.Timestamp = sessionFailureData.Get<string>(AdjustUtils.KeyTimestamp) == "" ?
+                    null : sessionFailureData.Get<string>(AdjustUtils.KeyTimestamp);

                 try
                 {


fixed deprecated calls on particle emitters

--- Assets/Scripts/FX/ForceFlowParticle.cs
+++ Assets/Scripts/FX/ForceFlowParticle.cs
@@ -1,5 +1,4 @@
 using UnityEngine;
-using System.Collections;

 public class ForceFlowParticle : MonoBehaviour {

@@ -7,9 +6,8 @@
   public float period;
   public float startPhase;
   public ParticleSystem system;
-
-
-  private float _emissionRate;
+
+  private ParticleSystem.EmissionModule _em;
   private float _timeDelta;
   private float _timeAtLastFrame = 0f;
   private float _timeAtCurrentFrame = 0f;
@@ -32,11 +30,11 @@
     _isOn = !_isOn;
     if(_isOn)
     {
-      system.emissionRate = _emissionRate;
+      _em.enabled = true;
     }
     else
     {
-      system.emissionRate = 0;
+      _em.enabled = false;
     }
   }

@@ -52,9 +50,9 @@

   void Start()
   {
-    _emissionRate = system.emissionRate;
     _timeDelta = period;
     _timeAtLastFrame = - startPhase * period;
+    _em = system.emission;
   }

 }


issue #75 _mediumId is know private

issue #75 _mediumId is know private

--- Assets/Scripts/Phenotypes/Phenotype.cs
+++ Assets/Scripts/Phenotypes/Phenotype.cs
@@ -23,7 +23,7 @@
 public abstract class Phenotype : MonoBehaviour
 {
   protected ReactionEngine _reactionEngine;                    //!< The ReactionEngine (ReactionEngine)
-  public int               _mediumId;              //!< The medium id
+  private int               _mediumId;              //!< The medium id

   protected static ArrayList             _molecules;
   protected Medium                _mediumRef;
@@ -57,12 +57,16 @@
    */
   public void initMolecules()
   {
+		//Set the medium ID
+    if(_mediumId == 0)
+	  if(gameObject.name == "Perso")
+	    setMediumId(1);
+
     LinkedList<Medium>    mediums = _reactionEngine.getMediumList();
     _mediumRef = ReactionEngine.getMediumFromId(_mediumId, mediums);

     if(_mediumRef != null && _molecules == null)
     {
-			Logger.Log("INITMOLECULES",Logger.Level.WARN);
       _molecules = _mediumRef.getMolecules();
     }
   }


Removed unused unit test

Removed unused unit test

--- BahnEditor/BahnEditor.Test/UnitTest.cs
+++ BahnEditor/BahnEditor.Test/UnitTest.cs
@@ -7,12 +7,6 @@
 	[TestClass]
 	public class UnitTest
 	{
-
-		[TestMethod]
-		public void TestMethod()
-		{
-			Assert.IsTrue(true);
-		}

 		[TestMethod]
 		public void TestColorDecompress()


memory fix

memory fix

--- src/AngleSharp/Parser/Css/CssParser.cs
+++ src/AngleSharp/Parser/Css/CssParser.cs
@@ -155,6 +155,9 @@
                 creator.Apply(token);
                 token = tokenizer.Get();
             }
+
+            // tokenizer should be disposed
+            tokenizer.Dispose();

             var valid = creator.IsValid;
             var result = creator.ToPool();


FileStream.Unix: open with CLOEXEC unless FileShare.Inheritable set (#10251)

* FileStream.Unix: open with CLOEXEC unless FileShare.Inheritable set

* PR feedback

Signed-off-by: dotnet-bot-corefx-mirror <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

--- src/Common/src/CoreLib/System/IO/FileStream.Unix.cs
+++ src/Common/src/CoreLib/System/IO/FileStream.Unix.cs
@@ -45,7 +45,7 @@
                 _asyncState = new AsyncState();

             // Translate the arguments into arguments for an open call.
-            Interop.Sys.OpenFlags openFlags = PreOpenConfigurationFromOptions(mode, _access, options); // FileShare currently ignored
+            Interop.Sys.OpenFlags openFlags = PreOpenConfigurationFromOptions(mode, _access, share, options);

             // If the file gets created a new, we'll select the permissions for it.  Most Unix utilities by default use 666 (read and
             // write for all), so we do the same (even though this doesn't match Windows, where by default it's possible to write out
@@ -120,9 +120,10 @@
         /// <summary>Translates the FileMode, FileAccess, and FileOptions values into flags to be passed when opening the file.</summary>
         /// <param name="mode">The FileMode provided to the stream's constructor.</param>
         /// <param name="access">The FileAccess provided to the stream's constructor</param>
+        /// <param name="share">The FileShare provided to the stream's constructor</param>
         /// <param name="options">The FileOptions provided to the stream's constructor</param>
         /// <returns>The flags value to be passed to the open system call.</returns>
-        private static Interop.Sys.OpenFlags PreOpenConfigurationFromOptions(FileMode mode, FileAccess access, FileOptions options)
+        private static Interop.Sys.OpenFlags PreOpenConfigurationFromOptions(FileMode mode, FileAccess access, FileShare share, FileOptions options)
         {
             // Translate FileMode.  Most of the values map cleanly to one or more options for open.
             Interop.Sys.OpenFlags flags = default(Interop.Sys.OpenFlags);
@@ -164,6 +165,12 @@
                 case FileAccess.Write:
                     flags |= Interop.Sys.OpenFlags.O_WRONLY;
                     break;
+            }
+
+            // Handle Inheritable, other FileShare flags are handled by Init
+            if ((share & FileShare.Inheritable) == 0)
+            {
+                flags |= Interop.Sys.OpenFlags.O_CLOEXEC;
             }

             // Translate some FileOptions; some just aren't supported, and others will be handled after calling open.


reflection cache

reflection cache

--- src/Compiler/PhpCodeAnalysis/Symbols/CoreMembers.cs
+++ src/Compiler/PhpCodeAnalysis/Symbols/CoreMembers.cs
@@ -560,11 +560,15 @@
                 CreateConsole = ct.Context.Method("CreateConsole");
                 Dispose = ct.Context.Method("Dispose");

+                DeclareFunction_intRef_string_method = ct.Context.Method("DeclareFunction", ct.Int32, ct.String, ct.RuntimeMethodHandle);
+                DeclareType_T_string = ct.Context.Method("DeclareType", ct.String);
+
                 get_Globals = ct.Context.Method("get_Globals");   // TODO: special name, property
             }

             public readonly CoreMethod
                 CreateConsole,
+                DeclareFunction_intRef_string_method, DeclareType_T_string,
                 Dispose;

             public readonly CoreMethod


Don't dispose previous texture atlas when we fill up.

--- osu.Framework/Graphics/Textures/TextureAtlas.cs
+++ osu.Framework/Graphics/Textures/TextureAtlas.cs
@@ -34,7 +34,7 @@
             subTextureBounds.Clear();
             currentY = 0;

-            atlasTexture?.Dispose();
+            //atlasTexture?.Dispose();
             atlasTexture = new TextureGLSingle(atlasWidth, atlasHeight);
         }


Don't use var

Don't use var

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -958,16 +958,16 @@
                 //in the case of backspacing (or a NOP), we can exit early here.
                 return;

-            var insertedValue = s.Substring(matchCount);
-
-            insertString(insertedValue, d =>
+            string insertedText = s.Substring(matchCount);
+
+            insertString(insertedText, d =>
             {
                 d.Colour = Color4.Aqua;
                 d.Alpha = 0.6f;
                 imeDrawables.Add(d);
             });

-            OnUserTextAdded(insertedValue);
+            OnUserTextAdded(insertedText);
         }

         #endregion


Tidy up code

Tidy up code

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -690,6 +690,8 @@
                 Schedule(consumePendingText);
         }

+        #region Input event handling
+
         protected override bool OnKeyDown(KeyDownEvent e)
         {
             if (textInput?.ImeActive == true || ReadOnly) return true;
@@ -892,7 +894,9 @@
             cursorAndLayout.Invalidate();
         }

-        #region Native TextBox handling (winform specific)
+        #endregion
+
+        #region Native TextBox handling (platform-specific)

         private void unbindInput()
         {


Fix powershell (#201)

Fix powershell (#201)

* Fix bits missed during merge

* added gatewayx/poa/FederatedPegTest folders

--- Utils/PowerShellScriptGeneratorAsTests.cs
+++ Utils/PowerShellScriptGeneratorAsTests.cs
@@ -127,6 +127,9 @@
             this.newLine(@"New-Item -ItemType directory -Force -Path $root_datadir\gateway2\stratis\StratisTest");
             this.newLine(@"New-Item -ItemType directory -Force -Path $root_datadir\gateway3\stratis\StratisTest");
             this.newLine(@"New-Item -ItemType directory -Force -Path $root_datadir\MainchainUser\stratis\StratisTest");
+            this.newLine(@"New-Item -ItemType directory -Force -Path $root_datadir\gateway1\poa\FederatedPegTest");
+            this.newLine(@"New-Item -ItemType directory -Force -Path $root_datadir\gateway2\poa\FederatedPegTest");
+            this.newLine(@"New-Item -ItemType directory -Force -Path $root_datadir\gateway3\poa\FederatedPegTest");
             this.newLine(Environment.NewLine);

             // Copy the blockchain data from a current, ideally up-to-date, Stratis Testnet folder.
@@ -150,15 +153,14 @@
         {
             var appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
             var rootDataDir = Path.Combine(appDataDir, "StratisNode", "federation");
-            var repoRoot = Path.Combine(
-                Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),"source","repos");
-            var fedGatewayDDir = Path.Combine(repoRoot, "FederatedSidechains","src","Stratis.FederationGatewayD");
-            var sidechainDDir = Path.Combine(repoRoot, "FederatedSidechains", "src", "Stratis.SidechainD");
-            var stratisDDir = Path.Combine(repoRoot, @"StratisBitcoinFullNode","src","Stratis.StratisD");
+            var fedGatewayDDir = Path.Combine("$git_repos_path", "FederatedSidechains","src","Stratis.FederationGatewayD");
+            var sidechainDDir = Path.Combine("$git_repos_path", "FederatedSidechains", "src", "Stratis.SidechainD");
+            var stratisDDir = Path.Combine("$git_repos_path", "StratisBitcoinFullNode","src","Stratis.StratisD");
             var walletFile = Path.Combine(appDataDir, "StratisNode","stratis", this.mainchainNetwork.Name,"walletTest1.wallet.json");
             this.newLine("###############################");
             this.newLine("#    UPDATE THESE 5 VALUES    #");
             this.newLine("###############################");
+            this.newLine($"$git_repos_path = \"{Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), "source", "repos")}\"");
             this.newLine($"$root_datadir = \"{rootDataDir}\"");
             this.newLine($"$path_to_federationgatewayd = \"{fedGatewayDDir}\"");
             this.newLine($"$path_to_sidechaind = \"{sidechainDDir}\"");
@@ -223,7 +225,7 @@
                 i =>
                     {
                         this.newLine($"# Member{i + 1} mnemonic: {this.mnemonics[i]}");
-                        this.newLine($"# Member{i + 1} public key: {this.pubKeysByMnemonic[this.mnemonics[0]]}");
+                        this.newLine($"# Member{i + 1} public key: {this.pubKeysByMnemonic[this.mnemonics[i]]}");
                     });

             this.newLine($"# Redeem script: {this.scriptAndAddresses.payToMultiSig}");


Make sure external processes always are terminated when running GUI

ARKADE-517

--- src/Arkivverket.Arkade.GUI/App.xaml.cs
+++ src/Arkivverket.Arkade.GUI/App.xaml.cs
@@ -123,13 +123,13 @@
         {
             _log.Information("Arkade " + ArkadeVersion.Current + " stopping");

+            ExternalProcessManager.TerminateAll();
+
             if (!ArkadeProcessingAreaLocationSetting.IsApplied())
                 ArkadeProcessingArea.Destroy();

             else if (ArkadeInstance.IsOnlyInstance)
                 ArkadeProcessingArea.CleanUp();
-
-            ExternalProcessManager.TerminateAll();

             base.OnExit(e);
         }


Layout fix

Layout fix

--- src/DefaultSiteTemplate/Views/Shared/_Layout.cshtml
+++ src/DefaultSiteTemplate/Views/Shared/_Layout.cshtml
@@ -27,7 +27,7 @@

-                        API Reference
+                        API Reference

                         Developer Guide


Fix textbox leaking input when multiple keys are pressed at the same time.

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -529,11 +529,9 @@
                 else
                     game.Audio.Sample.Get($@"Keyboard/key-press-{RNG.Next(1, 5)}")?.Play();
                 insertString(str);
-
-                return true;
-            }
-
-            return false;
+            }
+
+            return true;
         }

         protected override bool OnDrag(InputState state)


Updated program name in AssemblyInfo

Updated program name in AssemblyInfo

--- VolumeScroller/Properties/AssemblyInfo.cs
+++ VolumeScroller/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("VolumeIconV2")]
+[assembly: AssemblyTitle("VolumeScroller")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("VolumeIconV2")]
-[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyProduct("VolumeScroller")]
+[assembly: AssemblyCopyright("Copyright © 2017 Mark Brents")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -33,4 +33,4 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.1.0")]


Fix unsafe file writes in `RawCachingGlyphStore`

As noticed in https://github.com/ppy/osu-framework/issues/5177, writes
of these files have been unsafe until now if the file write is
interrupted partway. The length of the written file could be shorter
than expected.

This uses a newly added method to write to a temporary file before
moving to the final location.

--- osu.Framework/IO/Stores/RawCachingGlyphStore.cs
+++ osu.Framework/IO/Stores/RawCachingGlyphStore.cs
@@ -105,7 +105,7 @@

                     accessFilename += $"#{convert.Width}#{convert.Height}";

-                    using (var outStream = CacheStorage.GetStream(accessFilename, FileAccess.Write, FileMode.Create))
+                    using (var outStream = CacheStorage.CreateFileSafely(accessFilename))
                         outStream.Write(buffer.Memory.Span);

                     return pageLookup[page] = new PageInfo


Remove code duplication

Remove code duplication

--- WalletWasabi/TorSocks5/TorSocks5Client.cs
+++ WalletWasabi/TorSocks5/TorSocks5Client.cs
@@ -88,37 +88,15 @@

 			using (await AsyncLock.LockAsync())
 			{
-				Exception error = null;
 				try
 				{
 					await TcpClient.ConnectAsync(TorSocks5EndPoint.Address, TorSocks5EndPoint.Port);
 				}
-				// ex.Message must be checked, because I'm having difficulty catching SocketExceptionFactory+ExtendedSocketException
-				// Only works on English Os-es.
-				catch (Exception ex) when (ex.Message.StartsWith(
-											   "No connection could be made because the target machine actively refused it") // Windows
-										   || ex.Message.StartsWith("Connection refused")) // Linux && OSX
-				{
-					error = ex;
-				}
-				// "No connection could be made because the target machine actively refused it" for non-English Windows.
-				catch (SocketException ex) when (ex.ErrorCode == 10061)
-				{
-					error = ex;
-				}
-				// "Connection refused" for non-English Linux.
-				catch (SocketException ex) when (ex.ErrorCode == 111)
-				{
-					error = ex;
-				}
-				// "Connection refused" for non-English OSX.
-				catch (SocketException ex) when (ex.ErrorCode == 61)
-				{
-					error = ex;
-				}
-				if (error != null)
+				catch (Exception ex) when (IsConnectionRefused(ex))
+				{
 					throw new ConnectionException(
-						$"Couldn't connect to Tor SOCKSPort at {TorSocks5EndPoint.Address}:{TorSocks5EndPoint.Port}. Is Tor running?", error);
+						$"Couldn't connect to Tor SOCKSPort at {TorSocks5EndPoint.Address}:{TorSocks5EndPoint.Port}. Is Tor running?", ex);
+				}

 				Stream = TcpClient.GetStream();
 				RemoteEndPoint = TcpClient.Client.RemoteEndPoint as IPEndPoint;
@@ -300,8 +278,7 @@
 				{
 					await ConnectToDestinationAsync(RemoteEndPoint);
 				}
-				// It throws SocketExceptionFactory+ExtendedSocketException, which I am unable to catch
-				catch (Exception ex) when (ex.Message.StartsWith("No connection could be made because the target machine actively refused it"))
+				catch (Exception ex) when (IsConnectionRefused(ex))
 				{
 					throw new ConnectionException($"{nameof(TorSocks5Client)} is not connected to {RemoteEndPoint}.", ex);
 				}
@@ -315,6 +292,44 @@
 		#endregion ConstructorsAndInitializers

 		#region Methods
+
+		private bool IsConnectionRefused(Exception exc)
+		{
+			Exception error = null;
+			try
+			{
+				throw exc;
+			}
+			// ex.Message must be checked, because I'm having difficulty catching SocketExceptionFactory+ExtendedSocketException
+			// Only works on English Os-es.
+			catch (Exception ex) when (ex.Message.StartsWith(
+										   "No connection could be made because the target machine actively refused it") // Windows
+									   || ex.Message.StartsWith("Connection refused")) // Linux && OSX
+			{
+				error = ex;
+			}
+			// "No connection could be made because the target machine actively refused it" for non-English Windows.
+			catch (SocketException ex) when (ex.ErrorCode == 10061)
+			{
+				error = ex;
+			}
+			// "Connection refused" for non-English Linux.
+			catch (SocketException ex) when (ex.ErrorCode == 111)
+			{
+				error = ex;
+			}
+			// "Connection refused" for non-English OSX.
+			catch (SocketException ex) when (ex.ErrorCode == 61)
+			{
+				error = ex;
+			}
+			catch
+			{
+				// Ignored, since error is null.
+			}
+
+			return error != null;
+		}

 		/// <summary>
 		/// Sends bytes to the Tor Socks5 connection
@@ -392,8 +407,7 @@
 					{
 						await ConnectToDestinationAsync(RemoteEndPoint);
 					}
-					// It throws SocketExceptionFactory+ExtendedSocketException, which I am unable to catch
-					catch (Exception ex2) when (ex2.Message.StartsWith("No connection could be made because the target machine actively refused it"))
+					catch (Exception ex2) when (IsConnectionRefused(ex2))
 					{
 						throw new ConnectionException($"{nameof(TorSocks5Client)} is not connected to {RemoteEndPoint}.", ex2);
 					}


Fix compilation issues due to misnamed fild

--- osu.Game.Tests/Database/BeatmapImporterTests.cs
+++ osu.Game.Tests/Database/BeatmapImporterTests.cs
@@ -608,9 +608,9 @@
                 using var importer = new BeatmapModelManager(realmFactory, storage);
                 using var store = new RulesetStore(realmFactory, storage);

-                var imported = await LoadOszIntoStore(importer, realmFactory.Context);
-
-                deleteBeatmapSet(imported, realmFactory.Context);
+                var imported = await LoadOszIntoStore(importer, realmFactory.Realm);
+
+                deleteBeatmapSet(imported, realmFactory.Realm);

                 Assert.IsTrue(imported.DeletePending);

@@ -619,7 +619,7 @@

                 Assert.That(imported.Files.All(f => !storage.GetStorageForDirectory("files").Exists(f.File.GetStoragePath())));

-                var importedSecondTime = await LoadOszIntoStore(importer, realmFactory.Context);
+                var importedSecondTime = await LoadOszIntoStore(importer, realmFactory.Realm);

                 // check the newly "imported" beatmap is actually just the restored previous import. since it matches hash.
                 Assert.IsTrue(imported.ID == importedSecondTime.ID);


all tests pass

all tests pass

--- CFGLib/Parsers/Earley/EarleyParser2.cs
+++ CFGLib/Parsers/Earley/EarleyParser2.cs
@@ -73,9 +73,11 @@
 				// if α = a_0 α′, add (S ::= · α, 0, null) to Q′
 				// TODO: not sure how to handle this when a is ε
 				else {
-					var a1 = a.First();
-					if (alpha.First() == a1) {
-						QPrime.Add(potentialItem);
+					if (a.Count > 0) {
+						var a1 = a.First();
+						if (alpha.First() == a1) {
+							QPrime.Add(potentialItem);
+						}
 					}
 				}
 			}
@@ -138,9 +140,11 @@
 								}
 							} else {
 								// if β = a_i β′ { add (B ::= αC · β, h, y) to Q } } }
-								var aCurr = a[i];
-								if (β.First() == aCurr) {
-									Q.Add(newItem);
+								if (i < a.Count) {
+									var aCurr = a[i];
+									if (β.First() == aCurr) {
+										Q.Add(newItem);
+									}
 								}
 							}
 						}


Implement a single PageItem component

Implement a single PageItem component

--- osu.Game/Graphics/UserInterface/PageSelector.cs
+++ osu.Game/Graphics/UserInterface/PageSelector.cs
@@ -7,12 +7,12 @@
 using osu.Framework.Allocation;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.Sprites;
-using osu.Framework.Input.Events;
 using osu.Framework.Extensions.Color4Extensions;
 using System;
 using osuTK;
 using osu.Game.Graphics.Containers;
 using System.Collections.Generic;
+using osu.Framework.Extensions.IEnumerableExtensions;

 namespace osu.Game.Graphics.UserInterface
 {
@@ -21,7 +21,7 @@
         public readonly BindableInt CurrentPage = new BindableInt(1);

         private readonly int maxPages;
-        private readonly FillFlowContainer pillsFlow;
+        private readonly FillFlowContainer itemsFlow;

         private readonly Button previousPageButton;
         private readonly Button nextPageButton;
@@ -41,7 +41,7 @@
                     {
                         Action = () => CurrentPage.Value -= 1,
                     },
-                    pillsFlow = new FillFlowContainer
+                    itemsFlow = new FillFlowContainer
                     {
                         AutoSizeAxes = Axes.Both,
                         Direction = FillDirection.Horizontal,
@@ -66,7 +66,7 @@
             previousPageButton.Enabled.Value = newPage != 1;
             nextPageButton.Enabled.Value = newPage != maxPages;

-            pillsFlow.Clear();
+            itemsFlow.Clear();

             if (newPage > 3)
                 addDrawablePage(1);
@@ -77,7 +77,7 @@
             for (int i = Math.Max(newPage - 2, 1); i <= Math.Min(newPage + 2, maxPages); i++)
             {
                 if (i == newPage)
-                    addCurrentPagePill();
+                    addDrawableCurrentPage();
                 else
                     addDrawablePage(i);
             }
@@ -89,226 +89,161 @@
                 addDrawablePage(maxPages);
         }

-        private void addDrawablePage(int page)
-        {
-            pillsFlow.Add(new Page(page.ToString(), () => CurrentPage.Value = page));
-        }
-
-        private void addPlaceholder()
-        {
-            pillsFlow.Add(new Placeholder());
-        }
-
-        private void addCurrentPagePill()
-        {
-            pillsFlow.Add(new SelectedPage(CurrentPage.Value.ToString()));
-        }
-
-        private abstract class DrawablePage : CompositeDrawable
-        {
+        private void addDrawablePage(int page) => itemsFlow.Add(new DrawablePage(page.ToString())
+        {
+            Action = () => CurrentPage.Value = page,
+        });
+
+        private void addPlaceholder() => itemsFlow.Add(new Placeholder());
+
+        private void addDrawableCurrentPage() => itemsFlow.Add(new SelectedPage(CurrentPage.Value.ToString()));
+
+        private abstract class PageItem : OsuHoverContainer
+        {
+            private const int margin = 8;
             private const int height = 20;
-            private const int margin = 8;
-
-            protected readonly string Text;
-            protected readonly Drawable Content;
-
-            protected DrawablePage(string text)
-            {
-                Text = text;
-
+
+            protected PageItem(string text)
+            {
                 AutoSizeAxes = Axes.X;
                 Height = height;

-                var background = CreateBackground();
-
-                if (background != null)
-                    AddInternal(background);
-
-                Content = CreateContent();
-                Content.Margin = new MarginPadding { Horizontal = margin };
-
-                AddInternal(Content);
-            }
-
-            protected abstract Drawable CreateContent();
-
-            protected virtual Drawable CreateBackground() => null;
-        }
-
-        private abstract class ActivatedDrawablePage : DrawablePage
-        {
-            protected readonly Action Action;
-
-            public ActivatedDrawablePage(string text, Action action = null)
-                : base(text)
-            {
-                Action = action;
-            }
-
-            protected override bool OnClick(ClickEvent e)
-            {
-                Action?.Invoke();
-                return base.OnClick(e);
-            }
-        }
-
-        private class Page : ActivatedDrawablePage
-        {
-            private OsuColour colours;
-
-            public Page(string text, Action action)
-                : base(text, action)
-            {
-            }
-
-            [BackgroundDependencyLoader]
-            private void load(OsuColour colours)
-            {
-                this.colours = colours;
-                Content.Colour = colours.Seafoam;
-            }
-
-            protected override bool OnHover(HoverEvent e)
-            {
-                Content.Colour = colours.Seafoam.Lighten(30f);
-                return base.OnHover(e);
-            }
-
-            protected override void OnHoverLost(HoverLostEvent e)
-            {
-                Content.Colour = colours.Seafoam;
-                base.OnHoverLost(e);
-            }
-
-            protected override Drawable CreateContent() => new SpriteText
-            {
-                Anchor = Anchor.Centre,
-                Origin = Anchor.Centre,
-                Text = Text
-            };
-        }
-
-        private class SelectedPage : DrawablePage
-        {
-            private Box background;
-
-            public SelectedPage(string text)
-                : base(text)
-            {
-            }
-
-            [BackgroundDependencyLoader]
-            private void load(OsuColour colours)
-            {
-                Content.Colour = colours.GreySeafoam;
-                background.Colour = colours.Seafoam;
-            }
-
-            protected override Drawable CreateContent() => new SpriteText
-            {
-                Anchor = Anchor.Centre,
-                Origin = Anchor.Centre,
-                Text = Text
-            };
-
-            protected override Drawable CreateBackground() => new CircularContainer
-            {
-                RelativeSizeAxes = Axes.Both,
-                Masking = true,
-                Child = background = new Box
-                {
-                    RelativeSizeAxes = Axes.Both,
-                }
-            };
-        }
-
-        private class Placeholder : DrawablePage
-        {
-            public Placeholder()
-                : base("...")
-            {
-            }
-
-            [BackgroundDependencyLoader]
-            private void load(OsuColour colours)
-            {
-                Content.Colour = colours.Seafoam;
-            }
-
-            protected override Drawable CreateContent() => new SpriteText
-            {
-                Anchor = Anchor.Centre,
-                Origin = Anchor.Centre,
-                Text = Text
-            };
-        }
-
-        private class Button : OsuHoverContainer
-        {
-            private const int height = 20;
-            private const int margin = 8;
-
-            private readonly Anchor alignment;
-            private readonly Box background;
-
-            protected override IEnumerable<Drawable> EffectTargets => new[] { background };
-
-            public Button(bool rightAligned, string text)
-            {
-                alignment = rightAligned ? Anchor.x0 : Anchor.x2;
-
-                AutoSizeAxes = Axes.X;
-                Height = height;
-
-                Child = new CircularContainer
+                var contentContainer = new CircularContainer
                 {
                     AutoSizeAxes = Axes.X,
                     RelativeSizeAxes = Axes.Y,
                     Masking = true,
-                    Children = new Drawable[]
-                    {
-                        background = new Box
-                        {
-                            RelativeSizeAxes = Axes.Both,
-                        },
-                        new Container
-                        {
-                            AutoSizeAxes = Axes.Both,
-                            Anchor = Anchor.Centre,
-                            Origin = Anchor.Centre,
-                            Child = new FillFlowContainer
-                            {
-                                AutoSizeAxes = Axes.Both,
-                                Margin = new MarginPadding { Horizontal = margin },
-                                Direction = FillDirection.Horizontal,
-                                Children = new Drawable[]
-                                {
-                                    new SpriteText
-                                    {
-                                        Anchor = Anchor.y1 | alignment,
-                                        Origin = Anchor.y1 | alignment,
-                                        Text = text.ToUpper(),
-                                    },
-                                    new SpriteIcon
-                                    {
-                                        Anchor = Anchor.y1 | alignment,
-                                        Origin = Anchor.y1 | alignment,
-                                        Icon = alignment == Anchor.x2 ? FontAwesome.Solid.ChevronLeft : FontAwesome.Solid.ChevronRight,
-                                        Size = new Vector2(10),
-                                    },
-                                }
-                            }
-                        }
-                    }
                 };
-            }
+
+                var background = CreateBackground();
+                if (background != null)
+                    contentContainer.Add(background);
+
+                var drawableText = CreateText(text);
+                if (drawableText != null)
+                {
+                    drawableText.Margin = new MarginPadding { Horizontal = margin };
+                    contentContainer.Add(drawableText);
+                }
+
+                Add(contentContainer);
+            }
+
+            protected abstract Drawable CreateText(string text);
+
+            protected abstract Drawable CreateBackground();
+        }
+
+        private class DrawablePage : PageItem
+        {
+            protected SpriteText SpriteText;
+
+            protected override IEnumerable<Drawable> EffectTargets => new[] { SpriteText };
+
+            public DrawablePage(string text)
+                : base(text)
+            {
+            }
+
+            protected override Drawable CreateBackground() => null;
+
+            protected override Drawable CreateText(string text) => SpriteText = new SpriteText
+            {
+                Anchor = Anchor.Centre,
+                Origin = Anchor.Centre,
+                Text = text,
+            };

             [BackgroundDependencyLoader]
             private void load(OsuColour colours)
             {
+                IdleColour = colours.Seafoam;
+                HoverColour = colours.Seafoam.Lighten(30f);
+            }
+        }
+
+        private class SelectedPage : DrawablePage
+        {
+            private Box background;
+
+            protected override IEnumerable<Drawable> EffectTargets => null;
+
+            public SelectedPage(string text)
+                : base(text)
+            {
+            }
+
+            protected override Drawable CreateBackground() => background = new Box
+            {
+                RelativeSizeAxes = Axes.Both,
+            };
+
+            [BackgroundDependencyLoader]
+            private void load(OsuColour colours)
+            {
+                background.Colour = colours.Seafoam;
+                SpriteText.Colour = colours.GreySeafoamDark;
+            }
+        }
+
+        private class Placeholder : DrawablePage
+        {
+            public Placeholder()
+                : base("...")
+            {
+            }
+        }
+
+        private class Button : PageItem
+        {
+            private Box background;
+            private FillFlowContainer textContainer;
+            private SpriteIcon icon;
+
+            protected override IEnumerable<Drawable> EffectTargets => new[] { background };
+
+            public Button(bool rightAligned, string text)
+                : base(text)
+            {
+                var alignment = rightAligned ? Anchor.x0 : Anchor.x2;
+
+                textContainer.ForEach(drawable =>
+                {
+                    drawable.Anchor = Anchor.y1 | alignment;
+                    drawable.Origin = Anchor.y1 | alignment;
+                });
+
+                icon.Icon = alignment == Anchor.x2 ? FontAwesome.Solid.ChevronLeft : FontAwesome.Solid.ChevronRight;
+            }
+
+            [BackgroundDependencyLoader]
+            private void load(OsuColour colours)
+            {
                 IdleColour = colours.GreySeafoamDark;
                 HoverColour = colours.GrayA;
             }
+
+            protected override Drawable CreateBackground() => background = new Box
+            {
+                RelativeSizeAxes = Axes.Both,
+            };
+
+            protected override Drawable CreateText(string text) => textContainer = new FillFlowContainer
+            {
+                AutoSizeAxes = Axes.Both,
+                Direction = FillDirection.Horizontal,
+                Children = new Drawable[]
+                {
+                    new SpriteText
+                    {
+                        Text = text.ToUpper(),
+                    },
+                    icon = new SpriteIcon
+                    {
+                        Size = new Vector2(10),
+                    },
+                }
+            };
         }
     }
 }


Add star rating display underneath the beatmap metadata

--- osu.Game/Screens/Play/BeatmapMetadataDisplay.cs
+++ osu.Game/Screens/Play/BeatmapMetadataDisplay.cs
@@ -12,8 +12,10 @@
 using osu.Game.Graphics;
 using osu.Game.Graphics.Sprites;
 using osu.Game.Graphics.UserInterface;
+using osu.Game.Rulesets;
 using osu.Game.Rulesets.Mods;
 using osu.Game.Screens.Play.HUD;
+using osu.Game.Screens.Ranking.Expanded;
 using osuTK;

 namespace osu.Game.Screens.Play
@@ -30,6 +32,9 @@

         public IBindable<IReadOnlyList<Mod>> Mods => mods;

+        [Resolved]
+        private IBindable<RulesetInfo> ruleset { get; set; }
+
         public bool Loading
         {
             set
@@ -51,9 +56,11 @@
         }

         [BackgroundDependencyLoader]
-        private void load()
+        private void load(BeatmapDifficultyCache difficultyCache)
         {
             var metadata = beatmap.BeatmapInfo?.Metadata ?? new BeatmapMetadata();
+
+            var starDifficulty = difficultyCache.GetDifficultyAsync(beatmap.BeatmapInfo, ruleset.Value, mods.Value).Result;

             AutoSizeAxes = Axes.Both;
             Children = new Drawable[]
@@ -107,16 +114,29 @@
                                 loading = new LoadingLayer(true)
                             }
                         },
-                        new OsuSpriteText
-                        {
-                            Text = beatmap?.BeatmapInfo?.Version,
-                            Font = OsuFont.GetFont(size: 26, italics: true),
-                            Origin = Anchor.TopCentre,
-                            Anchor = Anchor.TopCentre,
-                            Margin = new MarginPadding
-                            {
-                                Bottom = 40
-                            },
+                        new FillFlowContainer
+                        {
+                            AutoSizeAxes = Axes.Both,
+                            Anchor = Anchor.TopCentre,
+                            Origin = Anchor.TopCentre,
+                            Direction = FillDirection.Vertical,
+                            Spacing = new Vector2(5f),
+                            Margin = new MarginPadding { Bottom = 40 },
+                            Children = new Drawable[]
+                            {
+                                new OsuSpriteText
+                                {
+                                    Text = beatmap?.BeatmapInfo?.Version,
+                                    Font = OsuFont.GetFont(size: 26, italics: true),
+                                    Anchor = Anchor.TopCentre,
+                                    Origin = Anchor.TopCentre,
+                                },
+                                new StarRatingDisplay(starDifficulty)
+                                {
+                                    Anchor = Anchor.TopCentre,
+                                    Origin = Anchor.TopCentre,
+                                }
+                            }
                         },
                         new GridContainer
                         {


整理PyramidVAOElement

整理PyramidVAOElement

--- CSharpGL.Winforms/PyramidVAOElement.cs
+++ CSharpGL.Winforms/PyramidVAOElement.cs
@@ -16,8 +16,11 @@
         /// shader program
         /// </summary>
         protected ShaderProgram shaderProgram;
-        uint positionLocation;
-        uint colorLocation;
+        const string strin_Position = "in_Position";
+        const string strin_Color = "in_Color";
+        const string strprojectionMatrix = "projectionMatrix";
+        const string strviewMatrix = "viewMatrix";
+        const string strmodelMatrix = "modelMatrix";
         mat4 projectionMatrix;
         mat4 viewMatrix;
         mat4 modelMatrix;
@@ -86,10 +89,6 @@
             shaderProgram = new ShaderProgram();
             shaderProgram.Create(vertexShaderSource, fragmentShaderSource, null);

-            positionLocation = shaderProgram.GetAttributeLocation("in_Position");
-
-            colorLocation = shaderProgram.GetAttributeLocation("in_Color");
-
             shaderProgram.AssertValid();
         }

@@ -106,30 +105,40 @@
             {
                 uint[] ids = new uint[1];
                 GL.GenBuffers(1, ids);
-                GL.BindBuffer(GL.GL_ARRAY_BUFFER, ids[0]);
+                GL.BindBuffer(BufferTarget.ArrayBuffer, ids[0]);
                 UnmanagedArray<vec3> positionArray = new UnmanagedArray<vec3>(positions.Length);
                 for (int i = 0; i < positions.Length; i++)
                 {
                     positionArray[i] = positions[i];
                 }
+
+                uint positionLocation = shaderProgram.GetAttributeLocation(strin_Position);
+
                 GL.BufferData(BufferTarget.ArrayBuffer, positionArray, BufferUsage.StaticDraw);
                 GL.VertexAttribPointer(positionLocation, 3, GL.GL_FLOAT, false, 0, IntPtr.Zero);
                 GL.EnableVertexAttribArray(positionLocation);
+
+                positionArray.Dispose();
             }

             //  Now do the same for the colour data.
             {
                 uint[] ids = new uint[1];
                 GL.GenBuffers(1, ids);
-                GL.BindBuffer(GL.GL_ARRAY_BUFFER, ids[0]);
+                GL.BindBuffer(BufferTarget.ArrayBuffer, ids[0]);
                 UnmanagedArray<vec3> colorArray = new UnmanagedArray<vec3>(positions.Length);
                 for (int i = 0; i < colors.Length; i++)
                 {
                     colorArray[i] = colors[i];
                 }
+
+                uint colorLocation = shaderProgram.GetAttributeLocation(strin_Color);
+
                 GL.BufferData(BufferTarget.ArrayBuffer, colorArray, BufferUsage.StaticDraw);
                 GL.VertexAttribPointer(colorLocation, 3, GL.GL_FLOAT, false, 0, IntPtr.Zero);
                 GL.EnableVertexAttribArray(colorLocation);
+
+                colorArray.Dispose();
             }

             //  Unbind the vertex array, we've finished specifying data for it.
@@ -174,9 +183,9 @@
             GL.GetInteger(GetTarget.Viewport, viewport);
             projectionMatrix = glm.perspective(60.0f, (float)viewport[2] / (float)viewport[3], 0.01f, 100.0f);

-            shaderProgram.SetUniformMatrix4("projectionMatrix", projectionMatrix.to_array());
-            shaderProgram.SetUniformMatrix4("viewMatrix", viewMatrix.to_array());
-            shaderProgram.SetUniformMatrix4("modelMatrix", modelMatrix.to_array());
+            shaderProgram.SetUniformMatrix4(strprojectionMatrix, projectionMatrix.to_array());
+            shaderProgram.SetUniformMatrix4(strviewMatrix, viewMatrix.to_array());
+            shaderProgram.SetUniformMatrix4(strmodelMatrix, modelMatrix.to_array());
         }

         protected void AfterRendering(Objects.RenderModes renderMode)


UIRenderer

UIRenderer

--- CSharpGL/UILayout/GLControls/GLAxis.cs
+++ CSharpGL/UILayout/GLControls/GLAxis.cs
@@ -12,8 +12,6 @@
     /// </summary>
     public class GLAxis : UIRenderer
     {
-        private ViewportSwitch viewportSwitch;
-        private ScissorTestSwitch scissorTestSwitch;

         /// <summary>
         /// opengl UI for Axis
@@ -38,7 +36,7 @@
             map.Add("in_Position", "position");
             map.Add("in_Color", "color");
             PickableRenderer renderer = (new Axis()).GetRenderer(shaderCodes, map, "position");
-
+
             this.Renderer = renderer;
         }

@@ -46,39 +44,12 @@
         {
             base.DoInitialize();

+            if (this.Renderer is OneIndexRenderer)
             {
-                this.viewportSwitch = new ViewportSwitch();
-                this.scissorTestSwitch = new ScissorTestSwitch();
-
-                if (this.Renderer is OneIndexRenderer)
-                {
-                    GLSwitch primitiveRestartSwitch = new PrimitiveRestartSwitch((this.Renderer as OneIndexRenderer).IndexBufferPtr);
-                    this.Renderer.SwitchList.Add(primitiveRestartSwitch);
-                }
+                GLSwitch primitiveRestartSwitch = new PrimitiveRestartSwitch((this.Renderer as OneIndexRenderer).IndexBufferPtr);
+                this.Renderer.SwitchList.Add(primitiveRestartSwitch);
             }
         }

-        protected override void DoRender(RenderEventArgs arg)
-        {
-            this.viewportSwitch.X = this.Location.X;
-            this.viewportSwitch.Y = this.Location.Y;
-            this.viewportSwitch.Width = this.Size.Width;
-            this.viewportSwitch.Height = this.Size.Height;
-            this.scissorTestSwitch.X = this.Location.X;
-            this.scissorTestSwitch.Y = this.Location.Y;
-            this.scissorTestSwitch.Width = this.Size.Width;
-            this.scissorTestSwitch.Height = this.Size.Height;
-
-            this.scissorTestSwitch.On();
-            this.viewportSwitch.On();
-
-            // 把所有在此之前渲染的内容都推到最远。
-            OpenGL.Clear(OpenGL.GL_DEPTH_BUFFER_BIT);
-
-            base.DoRender(arg);
-
-            this.viewportSwitch.Off();
-            this.scissorTestSwitch.Off();
-        }
     }
 }


HowTransformFeedbackWorks

HowTransformFeedbackWorks

--- CSharpGL4/HowTransformFeedbackWorks.cs
+++ CSharpGL4/HowTransformFeedbackWorks.cs
@@ -68,17 +68,19 @@

             GL.Instance.Enable(GL.GL_RASTERIZER_DISCARD);

-            program.Bind();

             TransformFeedbackObject.glBindBufferBase(GL.GL_TRANSFORM_FEEDBACK_BUFFER, 0, tbo.BufferId);

+            program.Bind();
+
             TransformFeedbackObject.glBeginTransformFeedback(GL.GL_POINTS);
-

             //GL.Instance.DrawArrays(GL.GL_POINTS, 0, data.Length);
             vao.Render();

             TransformFeedbackObject.glEndTransformFeedback();
+
+            program.Unbind();

             GL.Instance.Disable(GL.GL_RASTERIZER_DISCARD);


Update SocketHandler.cs

Update SocketHandler.cs

--- src/Hprose.RPC/SocketHandler.cs
+++ src/Hprose.RPC/SocketHandler.cs
@@ -8,7 +8,7 @@
 |                                                          |
 |  SocketHandler class for C#.                             |
 |                                                          |
-|  LastModified: Jun 5, 2019                               |
+|  LastModified: Mar 8, 2020                               |
 |  Author: Ma Bingyao <andot@hprose.com>                   |
 |                                                          |
 \*________________________________________________________*/
@@ -30,21 +30,23 @@
         public SocketHandler(Service service) {
             Service = service;
         }
-        public async Task Bind(Socket server) {
-            while (true) {
-                try {
-                    Handler(await server.AcceptAsync().ConfigureAwait(false));
+        public Task Bind(Socket server) {
+            return Task.Factory.StartNew(async () => {
+                while (true) {
+                    try {
+                        Handler(await server.AcceptAsync().ConfigureAwait(false));
+                    }
+                    catch (InvalidOperationException) {
+                        return;
+                    }
+                    catch (SocketException) {
+                        return;
+                    }
+                    catch (Exception error) {
+                        OnError?.Invoke(error);
+                    }
                 }
-                catch (InvalidOperationException) {
-                    return;
-                }
-                catch (SocketException) {
-                    return;
-                }
-                catch (Exception error) {
-                    OnError?.Invoke(error);
-                }
-            }
+            }, TaskCreationOptions.LongRunning);
         }
         private static async Task<byte[]> ReadAsync(Socket socket, byte[] bytes, int offset, int length) {
             while (length > 0) {