Exemple #1
0
        ///////////////////////////////////////////////////////////////////////

        public StringPairList ToList()
        {
            CheckDisposed();

            StringPairList list = new StringPairList();

            list.Add("name", (name != null) ? name : _String.Null);

            list.Add("interpreter", (interpreter != null) ?
                     interpreter.InternalToString() : _String.Null);

            if (!id.Equals(Guid.Empty))
            {
                list.Add("id", id.ToString());
            }

            list.Add("type", type.ToString());
            list.Add("flags", flags.ToString());
            list.Add("priority", priority.ToString());
            list.Add("dateTime", dateTime.ToString());

            list.Add("callback", (callback != null) ?
                     callback.ToString() : _String.Null);

            list.Add("clientData",
                     ((clientData != null) && (clientData.Data != null)) ?
                     StringList.MakeList(clientData.Data.GetType().Name,
                                         clientData.Data) :
                     _String.Null);

            return(list);
        }
Exemple #2
0
            ///////////////////////////////////////////////////////////////////

            private static EventFlags GetEventFlags(
                NameValueCollection appSettings,
                EventFlags @default
                )
            {
                try
                {
                    string value = Utility.GetEnvironmentVariable(
                        EventFlags, true, true);

                    if (String.IsNullOrEmpty(value) && (appSettings != null))
                    {
                        value = appSettings[EventFlags];
                    }

                    //
                    // NOTE: Were we able to get the value from somewhere?
                    //
                    if (!String.IsNullOrEmpty(value))
                    {
                        Result error = null;

                        object enumValue = Utility.TryParseFlagsEnum(
                            null, typeof(EventFlags), @default.ToString(),
                            value, null, true, true, true, ref error);

                        if (enumValue is EventFlags)
                        {
                            return((EventFlags)enumValue);
                        }
                    }
                }
                catch
                {
                    // do nothing.
                }

                return(@default);
            }
Exemple #3
0
        void SmartAIEventFlagsButton_Click(object sender, EventArgs e)
        {
            if (SmartAIDataGrid.SelectedCells.Count == 0)
            {
                MessageBox.Show("Error: Row is not selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int current_flags = 0;

                if (SmartAIDataGrid.Rows[SmartAIDataGrid.CurrentCell.RowIndex].Cells[7].Value != null)
                {
                    current_flags = Convert.ToInt32(SmartAIDataGrid.Rows[SmartAIDataGrid.CurrentCell.RowIndex].Cells[7].Value.ToString());
                }

                EventFlags eventFlags = new EventFlags(current_flags);

                if (eventFlags.ShowDialog() == DialogResult.Retry)
                {
                    SmartAIDataGrid.Rows[SmartAIDataGrid.CurrentCell.RowIndex].Cells[7].Value = eventFlags.ToString();
                }
            }
        }