示例#1
0
 /// <summary>
 /// Create a new instance of the GraphicsAPI struct.
 /// </summary>
 /// <param name="api">The context API to use.</param>
 /// <param name="profile">The context profile to use.</param>
 /// <param name="flags">The context flags to use.</param>
 /// <param name="apiVersion">The API version to use.</param>
 public GraphicsAPI(ContextAPI api, ContextProfile profile, ContextFlags flags, APIVersion apiVersion)
 {
     API     = api;
     Profile = profile;
     Flags   = flags;
     Version = apiVersion;
 }
示例#2
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new ContextAPI(
                serviceProvider.GetRequiredService <DbContextOptions <ContextAPI> >()))
     {
         SetPersons(context);
     }
 }
示例#3
0
        /// <summary>
        /// Creates a new instance of <see cref="WindowCreateInfo"/> struct.
        /// </summary>
        /// <param name="position">The window position.</param>
        /// <param name="size">The window size.</param>
        /// <param name="initialState">The window state.</param>
        /// <param name="title">The window title.</param>
        /// <param name="api">The graphics API.</param>
        /// <param name="cursorMode">The cursor mode.</param>
        /// <param name="windowBorder">The window border.</param>
        /// <param name="opacity">The window opacity.</param>
        /// <param name="multisamples">The number of samples in window.</param>
        /// <param name="apiVersion">The version of the graphics API.</param>
        /// <param name="flags">The context flags.</param>
        /// <param name="profile">The context profile.</param>
        public WindowCreateInfo(
            Point position,
            Size size,
            WindowState initialState,
            string title,
            ContextAPI api,
            CursorMode cursorMode     = CursorMode.Visible,
            WindowBorder windowBorder = WindowBorder.Resizable,
            float opacity             = 1f,
            byte multisamples         = 16,
            Version apiVersion        = default,
            ContextFlags flags        = ContextFlags.Default,
            ContextProfile profile    = ContextProfile.Core)
        {
            (Position, Size, WindowState, Title, WindowBorder, Multisamples, API, APIVersion, Flags, Profile, CursorMode, Opacity) =
                (position, size, initialState, title, windowBorder, multisamples, api, apiVersion, flags, profile, cursorMode, opacity);

            if (APIVersion == null)
            {
                APIVersion = new Version(3, 3);
            }
        }
 public SupplierController()
 {
     this.db = new ContextAPI();
 }
示例#5
0
 public UserController()
 {
     this.db = new ContextAPI();
 }
 public ContactRepository(ContextAPI context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
 public PurchaseInformationsController()
 {
     db = new ContextAPI();
 }
示例#8
0
 public TaskRepository(ContextAPI context)
 {
     this.context = context;
 }
示例#9
0
 public static extern void WindowHint(WindowHintContextApi hint, ContextAPI value);
 public ProductController()
 {
     this.db = new ContextAPI();
 }
示例#11
0
        static void SetPersons(ContextAPI context)
        {
            if (context.Person.Any())
            {
                return;   // DB has been seeded
            }

            context.Person.AddRange(
                new Person
            {
                FirstName = "Arturo",
                LastName  = "Navarro",
                Birthdate = DateTime.Parse("1990-5-23"),
                Gender    = "M",
                Phone     = "9982334455",
                Email     = "*****@*****.**",
                Address   = "Arturo's Address",
                City      = "Arturo's City"
            },
                new Person
            {
                FirstName = "Mary",
                LastName  = "Camacho",
                Birthdate = DateTime.Parse("1989-5-31"),
                Gender    = "F",
                Phone     = "9982334456",
                Email     = "*****@*****.**",
                Address   = "Mary's Address",
                City      = "Mary's City"
            },
                new Person
            {
                FirstName = "Person 3",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("1996-1-11"),
                Gender    = "M",
                Phone     = "9982334457",
                Email     = "*****@*****.**",
                Address   = "Person3's Address",
                City      = "Person3's City"
            },
                new Person
            {
                FirstName = "Person 4",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("2013-1-11"),
                Gender    = "M",
                Phone     = "9982334458",
                Email     = "*****@*****.**",
                Address   = "Person4's Address",
                City      = "Person4's City"
            },
                new Person
            {
                FirstName = "Person 5",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("2000-1-11"),
                Gender    = "M",
                Phone     = "9982334459",
                Email     = "*****@*****.**",
                Address   = "Person5's Address",
                City      = "Person5's City"
            },
                new Person
            {
                FirstName = "Person 6",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("1950-1-11"),
                Gender    = "M",
                Phone     = "9982334451",
                Email     = "*****@*****.**",
                Address   = "Person6's Address",
                City      = "Person6's City"
            },
                new Person
            {
                FirstName = "Person 7",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("1970-1-22"),
                Gender    = "M",
                Phone     = "9982334452",
                Email     = "*****@*****.**",
                Address   = "Person7's Address",
                City      = "Person7's City"
            },
                new Person
            {
                FirstName = "Person 8",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("1960-10-11"),
                Gender    = "M",
                Phone     = "9982334453",
                Email     = "*****@*****.**",
                Address   = "Person8's Address",
                City      = "Person8's City"
            },
                new Person
            {
                FirstName = "Person 9",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("1989-12-11"),
                Gender    = "M",
                Phone     = "9982334454",
                Email     = "*****@*****.**",
                Address   = "Person9's Address",
                City      = "Person9's City"
            },
                new Person
            {
                FirstName = "Person 10",
                LastName  = "Last Name",
                Birthdate = DateTime.Parse("1989-1-11"),
                Gender    = "M",
                Phone     = "9982334466",
                Email     = "*****@*****.**",
                Address   = "Person10's Address",
                City      = "Person10's City"
            }
                );

            context.SaveChanges();
        }
示例#12
0
 /// <summary>
 /// Create a new instance of the GraphicsAPI struct, implicitly using the core profile and default context
 /// flags of the given api.
 /// </summary>
 /// <param name="api">The context API to use.</param>
 /// <param name="apiVersion">The API version to use.</param>
 public GraphicsAPI(ContextAPI api, APIVersion apiVersion)
     : this(api, ContextProfile.Core, ContextFlags.Default, apiVersion)
 {
     // do nothing else
 }
示例#13
0
 public UserRepository(ContextAPI context)
 {
     this.context = context;
 }