コード例 #1
0
        public IDataParser Create(DataFormats outputFormat)
        {
            switch (outputFormat)
            {
            case DataFormats.CIFAR10:
                return(new CIFAR10Parser());

            case DataFormats.MNIST:
                throw new NotImplementedException("MNIST Parser not implemented");

            default:
                throw new Exception("Unrecognized data format " + outputFormat.ToString());
            }
        }
コード例 #2
0
 /// <summary>
 /// Copies an object in the specified format to the windows Clipboard.
 /// </summary>
 /// <param name="format">The <see cref="System.Windows.Forms.DataFormats"/></param>
 /// <param name="item">The object to place on the Clipboard buffer.</param>
 /// <exception cref="ProdOperationException">Examine inner exception</exception>
 public static void CopyToClipboard(DataFormats format, object item)
 {
     try
     {
         Clipboard.SetData(format.ToString(), item);
     }
     catch (InvalidOperationException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
     catch (ElementNotAvailableException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
     catch (ArgumentException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
 }