コード例 #1
0
 private bool IsModified(SERVTYPE record)
 {
     //Type-specific routine that takes into account relationships that should also be considered
     //when deciding if there are unsaved changes.  The entity properties also return true if the
     //record is new or deleted.
     if (record == null)
     {
         return(false);
     }
     return(record.IsModified(_context) ||
            record.SupplierServiceType.IsModified(_context));
 }
コード例 #2
0
 void ClearBindings()
 {
     _ignoreLeaveRow       = true;
     _ignorePositionChange = true;
     _selectedRecord       = null;
     BindingSourceSupplierServType.Clear();
     SetReadOnly(true);
     BarButtonItemDelete.Enabled = false;
     BarButtonItemSave.Enabled   = false;
     BindingSource.DataSource    = typeof(SERVTYPE);
     _ignoreLeaveRow             = false;
     _ignorePositionChange       = false;
 }
コード例 #3
0
        private void BindFocusedRow(GridView view, int focusedRowHandle)
        {
            object row = view.GetRow(focusedRowHandle);

            if (row != null && row.GetType() != typeof(DevExpress.Data.NotLoadedObject))
            {
                ReadonlyThreadSafeProxyForObjectFromAnotherThread proxy = (ReadonlyThreadSafeProxyForObjectFromAnotherThread)view.GetRow(focusedRowHandle);
                SERVTYPE record = (SERVTYPE)proxy.OriginalRow;
                BindingSource.DataSource = _context.SERVTYPE.Where(c => c.TYPE == record.TYPE);
            }
            else
            {
                ClearBindings();
            }
        }
コード例 #4
0
 void SetBindings()
 {
     //If the route list is filtered, there will be rows in the binding source
     if (BindingSource.Current == null)
     {
         ClearBindings();
     }
     else
     {
         _selectedRecord = ((SERVTYPE)BindingSource.Current);
         LoadAndBindSupplierServType();
         SetReadOnly(false);
         SetReadOnlyKeyFields(true);
         BarButtonItemDelete.Enabled = true;
         BarButtonItemSave.Enabled   = true;
     }
     ErrorProvider.Clear();
 }
コード例 #5
0
    /**
     * ParseArgs
     * Read the program options from the command line
     *
     * @param args - string[] - Same as main
     * @return - bool - true if there is an error that requires help
     */
    bool ParseArgs(string[] args)
    {
        bool isError = false;
        if (args.Length > 0)
        {

            for (int argc = 0; argc < args.Length; argc++)
            {
                try
                {
                    if (args[argc][0] == '-') // Options require '-'
                    {
                        switch (args[argc][1])
                        {
                            case 'm':
                            case 'M':
                                msg = args[++argc];
                                break;
                            case 'h':
                            case 'H':
                                urlHost = args[++argc];
                                break;
                            case 'p':
                            case 'P':
                                urlPort = args[++argc];
                                break;
                            case 'f':
                            case 'F':
                                urlSuffix = args[++argc];
                                break;
                            case 's':
                            case 'S':
                                if (args[++argc].Equals("ping"))
                                {
                                    servtype = SERVTYPE.PING;
                                }
                                else if (args[argc].Equals("echo"))
                                {
                                    servtype = SERVTYPE.ECHO;
                                }
                                else if (args[argc].Equals("async"))
                                {
                                    servtype = SERVTYPE.ASYNC;
                                }
                                else
                                {
                                    isError = true;
                                    Console.WriteLine("Unknown Service: " + args[argc]);
                                }
                                break;
                            case 't':
                            case 'T':
                                timeout = int.Parse(args[++argc]);
                                break;
                            case '?':
                                isError = true;
                                break;
                            default:
                                isError = true;
                                Console.WriteLine("Unknown Option: " + args[argc]);
                                break;
                        }
                    }
                    else
                    { // No '-'.
                        isError = true;
                        Console.WriteLine("Unrecognized Parameter: " + args[argc]);
                    }
                }
                catch
                {  // Could be a missing option value
                    isError = true;
                    Console.WriteLine("Incorrect Parameter Format");
                    break; // the For loop
                }

            }
            uriString = "http://" + urlHost + ":" + urlPort;
        }
        return (isError);
    }