// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { #if DEBUG services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; }); #endif services.AddRazorPages(); services.AddServerSideBlazor(); services.AddScoped <WeatherForecastService>(); services.AddDbContext <FMRDemoContext>(options => options.UseSqlServer(Configuration.GetConnectionString("GridLargeDataConnectionString"), opt => opt.UseRowNumberForPaging())); services.AddDbContext <ContosoRetailContext>(options => options.UseSqlServer(Configuration.GetConnectionString("PivotGridLargeDataConnectionString"))); services.Configure <DemoConfiguration>(Configuration.GetSection("DemoConfiguration")); services.AddTransient <ProductService>(); services.AddSingleton <FlatProductService>(); services.AddSingleton <CountryNamesService>(); services.AddSalesViewerService(); services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); services.AddHttpClient(); services.AddScoped <HttpClient>((sp) => { var httpClient = sp.GetService <IHttpClientFactory>().CreateClient(); httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); return(httpClient); }); services.AddDevExpressBlazor(); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { #if DEBUG services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; }); #endif services.AddRazorPages(); services.AddServerSideBlazor(); services.AddScoped <WeatherForecastService>(); services.AddDbContext <FMRDemoContext>(options => options.UseSqlServer(Configuration.GetConnectionString("GridLargeDataConnectionString"), opt => opt.UseRowNumberForPaging())); services.AddDbContext <ContosoRetailContext>(options => options.UseSqlServer(Configuration.GetConnectionString("PivotGridLargeDataConnectionString"))); services.Configure <DemoConfiguration>(Configuration.GetSection("DemoConfiguration")); services.AddTransient <ProductService>(); services.AddSingleton <FlatProductService>(); services.AddSingleton <CountryNamesService>(); services.AddSalesViewerService(); services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); // Initialize the Font FontDescription fontDescription = new FontDescription() { Height = 72, Italic = false, CharacterSet = FontCharacterSet.Ansi, FaceName = "Arial", MipLevels = 0, OutputPrecision = FontPrecision.TrueType, PitchAndFamily = FontPitchAndFamily.Default, Quality = FontQuality.ClearType, Weight = FontWeight.Bold }; font = new Font(Device, fontDescription); // Measure the text to display fontDimension = font.Measure(null, DisplayText, new Rectangle(0, 0, 800, 600), FontDrawFlags.Center | FontDrawFlags.VerticalCenter); xDir = 1; yDir = 1; }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { #if DEBUG services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; }); #endif services.AddMvc(options => options.EnableEndpointRouting = false) .SetCompatibilityVersion(CompatibilityVersion.Version_3_0); services.AddRazorPages(); services.AddServerSideBlazor(); services.Configure <DemoConfiguration>(Configuration.GetSection("DemoConfiguration")); services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); services.AddHttpClient(); services.AddScoped <HttpClient>((sp) => { var httpClient = sp.GetService <IHttpClientFactory>().CreateClient(); httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); return(httpClient); }); services.AddDevExpressBlazor(); }
public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.Services.AddDevExpressBlazor(); builder.Services.AddScoped <WeatherForecastService>(); builder.Services.AddSingleton <IOptions <DemoConfiguration>, ClientSideDemoConfiguration>(); builder.Services.AddDbContext <FMRDemoContext>(options => options.UseSqlServer("YOUR CONNECTION STRING HERE", opt => opt.UseRowNumberForPaging())); builder.Services.AddDbContext <ContosoRetailContext>(options => options.UseSqlServer("YOUR CONNECTION STRING HERE")); builder.Services.AddTransient <ProductService>(); builder.Services.AddSingleton <FlatProductService>(); builder.Services.AddTransient <EmployeeService>(); builder.Services.AddSingleton <CountryNamesService>(); builder.Services.AddSalesViewerService(); builder.Services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); builder.RootComponents.Add <App>("app"); builder.RootComponents.Add <DocumentMetadataComponent>("head"); await builder.Build().RunAsync(); }
/// <summary> /// Create Form for this demo. /// </summary> /// <param name="config"></param> /// <returns></returns> protected override Form CreateForm(DemoConfiguration config) { var f = new RenderForm(config.Title) { FormBorderStyle = FormBorderStyle.None, ShowIcon = false, ShowInTaskbar = false, WindowState = FormWindowState.Maximized, BackColor = System.Drawing.Color.Black, ClientSize = new Size(config.Width, config.Height) }; f.KeyDown += F_KeyDown; f.MouseDown += F_MouseDown; if (_PreviewWndHandle != IntPtr.Zero) { // Set the preview window as the parent of this window NativeMethods.SetParent(f.Handle, _PreviewWndHandle); // Make this a child window so it will close when the parent dialog closes NativeMethods.SetWindowLong(f.Handle, -16, new IntPtr(NativeMethods.GetWindowLong(f.Handle, -16) | 0x40000000)); // Place our window inside the parent System.Drawing.Rectangle ParentRect; NativeMethods.GetClientRect(_PreviewWndHandle, out ParentRect); f.ClientSize = new Size(ParentRect.Size.Width + 1, ParentRect.Size.Height + 1); f.Location = new System.Drawing.Point(-1, -1); } return(f); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddResponseCompression(opts => { opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat( new[] { "application/octet-stream" }); }); services.AddScoped <WeatherForecastService>(); services.AddDbContext <FMRDemoContext>(options => options.UseSqlServer("YOUR CONNECTION STRING HERE", opt => opt.UseRowNumberForPaging())); services.AddDbContext <ContosoRetailContext>(options => options.UseSqlServer("YOUR CONNECTION STRING HERE")); services.AddSingleton <IOptions <DemoConfiguration>, ClientSideDemoConfiguration>(); services.AddTransient <ProductService>(); services.AddSingleton <CountryNamesService>(); services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); }
/// <summary> /// Method to verify the common parameters that are sent with every request to the service. This method also double checks to make sure that the LEADTOOLS license is set appropriately. /// </summary> internal bool VerifyCommonParameters(LeadWebRequest request) { try { if (request == null) { throw new Exception(); } //Passing a last page value of -1 indicates that we want to process every page in the file. if ((request.FirstPage > request.LastPage && request.LastPage != -1) || request.FirstPage < 1) { throw new Exception(); } if (!DemoConfiguration.UnlockSupport()) { throw new RasterException("Your license file is missing, invalid or expired. LEADTOOLS will not function. Please contact LEAD Sales for information on obtaining a valid license"); } return(true); } catch (RasterException) { throw; } catch { return(false); } }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddDbContext <ApplicationDbContext>(options => options.UseSqlServer( Configuration["DBConnectionString"])); services.AddDefaultIdentity <IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true) .AddEntityFrameworkStores <ApplicationDbContext>(); services.AddRazorPages(); services.AddServerSideBlazor(); services.AddScoped <AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider <IdentityUser> >(); services.AddSingleton <WeatherForecastService>(); services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); services.AddHttpClient(); services.AddScoped <HttpClient>((sp) => { var httpClient = sp.GetService <IHttpClientFactory>().CreateClient(); httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); return(httpClient); }); /* 3-1 */ services.AddDevExpressBlazor(); }
protected override Form CreateForm(DemoConfiguration config) { var form = base.CreateForm(config); form.MouseDown += MouseDown; form.MouseDown += MouseUp; return(form); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); this.form.Closing += (s, e) => this.Close?.Invoke(); this.form.ClientSizeChanged += this.FormSizeChangedHandler; this.form.MouseMove += this.FormMouseMoveHandler; this.form.MouseDown += this.FormMouseDownHandler; this.form.MouseUp += this.FormMouseUpHandler; this.form.KeyPress += this.FormKeyPressHandler; }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); Directory.SetCurrentDirectory(@".\GameData"); //_bitmap = LoadFromFile(RenderTarget2D, "sharpdx.png"); G.D2D = RenderTarget2D; G.Factory = Factory2D; G.FactoryDW = FactoryDWrite; RenderTarget2D.AntialiasMode = D2D.AntialiasMode.Aliased; // F51.run(); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); // Initialize a TextFormat TextFormat = new TextFormat(FactoryDWrite, "Calibri", 128); TextFormat.TextAlignment = TextAlignment.Center; TextFormat.ParagraphAlignment = ParagraphAlignment.Center; RenderTarget2D.TextAntialiasMode = TextAntialiasMode.Cleartype; // Initialize a TextLayout TextLayout = new TextLayout(FactoryDWrite, "SharpDX D2D1 - DWrite", TextFormat, demoConfiguration.Width, demoConfiguration.Height); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); // Initialize a TextFormat TextFormat = new TextFormat(FactoryDWrite, "Gabriola", 96); TextFormat.TextAlignment = TextAlignment.Center; TextFormat.ParagraphAlignment = ParagraphAlignment.Center; RenderTarget2D.TextAntialiasMode = TextAntialiasMode.Cleartype; ClientRectangle = new RectangleF(0, 0, demoConfiguration.Width, demoConfiguration.Height); SceneColorBrush.Color = Color.Black; }
public MeetingPreloader(GoogleConfiguration configuration, DemoConfiguration demoConfiguration, INotify notifications, GoogleService googleService, RoomSubscriptionService roomSubscriptionService, IHubContext <RoomHub> roomHubContext) { _google = googleService; _roomSubscription = roomSubscriptionService; _notifications = notifications; _demo = demoConfiguration; _roomHubContext = roomHubContext; _maxEvents = configuration.MaxCalendarEvents; }
/// <summary> /// Initializes the node manager. /// </summary> public MethodsNodeManager(IServerInternal server, ApplicationConfiguration configuration) : base(server, configuration, Namespaces.Methods) { SystemContext.NodeIdFactory = this; // get the configuration for the node manager. m_configuration = configuration.ParseExtension <DemoConfiguration>(); // use suitable defaults if no configuration exists. if (m_configuration == null) { m_configuration = new DemoConfiguration(); } }
private static void Run() { // Prepare and run D3D11 wrapper var configuration = new DemoConfiguration("NoesisGUI Integration Sample", 800, 600); dxWrapper = new D3D11AppWrapper(); dxWrapper.Run( configuration, contentLoadCallback: () => { // Callback for initialization GUI.Init(); GUI.SetResourceProvider("Data"); // Global theme { var theme = (Noesis.ResourceDictionary)Noesis.GUI.LoadXaml("NoesisStyle.xaml"); Noesis.GUI.SetTheme(theme); } // Data loading { var content = (Noesis.Grid)Noesis.GUI.LoadXaml("TextBox.xaml"); view = Noesis.GUI.CreateView(content); var immediateContext = dxWrapper.Device.ImmediateContext; renderer = view.Renderer; renderer.InitD3D11(immediateContext.NativePointer, new Noesis.VGOptions()); } // Attach to Application events dxWrapper.Close += OnClose; dxWrapper.Tick += OnTick; dxWrapper.PreRender += OnPreRender; dxWrapper.PostRender += OnPostRender; dxWrapper.Resize += OnResize; dxWrapper.MouseMove += OnMouseMove; dxWrapper.MouseDown += OnMouseDown; dxWrapper.MouseUp += OnMouseUp; dxWrapper.KeyDownEvent += OnKeyDown; dxWrapper.KeyUpEvent += OnKeyUp; dxWrapper.KeyPressEvent += OnKeyPress; OnResize(dxWrapper.Size.Width, dxWrapper.Size.Height); isRunning = true; }); }
/// <summary> /// Method to create and initialize the LEAD OCR engine. /// </summary> static internal IOcrEngine InitEngine() { DemoConfiguration.UnlockSupport(); IOcrEngine engine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false); if (string.IsNullOrWhiteSpace(DemoConfiguration.OCREnginePath)) { engine.Startup(null, null, null, null); } else { engine.Startup(null, null, null, DemoConfiguration.OCREnginePath); } return(engine); }
/// <summary> /// Retrieves a simple version of the JSON string for configuring the container /// </summary> /// <returns>The JSON string</returns> private string GetSimpleJson() { var jsonValues = new DemoConfiguration() { BooleanValue = true, DateTimeValue = DateTime.Parse("2020-09-01 12:00:00.0000"), EnumerationValue = DemoType.Complex, IntegerValue = 23, ObjectValue = new SubConfiguration { StringValue = "SubstringJson" }, StringValue = "StringValueJson", TimeSpanValue = TimeSpan.FromMinutes(123) }; return(JsonConvert.SerializeObject(jsonValues)); }
public void ConfigureServices(IServiceCollection services) { services.AddScoped <WeatherForecastService>(); services.AddSingleton <IOptions <DemoConfiguration>, ClientSideDemoConfiguration>(); services.AddDbContext <FMRDemoContext>(options => options.UseSqlServer("YOUR CONNECTION STRING HERE", opt => opt.UseRowNumberForPaging())); services.AddDbContext <ContosoRetailContext>(options => options.UseSqlServer("YOUR CONNECTION STRING HERE")); services.AddTransient <ProductService>(); services.AddSingleton <FlatProductService>(); services.AddSingleton <CountryNamesService>(); services.AddDocumentMetadata((serviceProvider, registrator) => { DemoConfiguration config = serviceProvider.GetService <IOptions <DemoConfiguration> >().Value; config.RegisterPagesMetadata(registrator); }); }
private DemoConfiguration ConstructOptions() { var baseDirectory = Prompt.GetString($"Set the base project directory (specify using {Path.DirectorySeparatorChar} )"); while (!Directory.Exists(baseDirectory)) { ConsoleHelper.WriteInfo($"Specified directory {baseDirectory}"); baseDirectory = Prompt.GetString("Specified directory is invalid, try again"); } var config = new DemoConfiguration { BaseDir = baseDirectory, }; CreateSettingsFile(config); return(config); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); // Create an ellipse Ellipse = new EllipseGeometry(Factory2D, new Ellipse(new Vector2(demoConfiguration.Width / 2, demoConfiguration.Height / 2), demoConfiguration.Width / 2 - 100, demoConfiguration.Height / 2 - 100)); // Populate a PathGeometry from Ellipse tessellation TesselatedGeometry = new PathGeometry(Factory2D); GeometrySink = TesselatedGeometry.Open(); // Force RoundLineJoin otherwise the tesselated looks buggy at line joins GeometrySink.SetSegmentFlags(PathSegment.ForceRoundLineJoin); // Tesselate the ellipse to our TessellationSink Ellipse.Tessellate(1, this); // Close the GeometrySink GeometrySink.Close(); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); _infoGamePanel = Helpers.LoadFromFile(RenderTarget2D, "gameInfo.png"); GameInterface = new GameInterface(RenderTarget2D, RESOLUTION, FactoryDWrite); BuildingsFactory = new BuildingsFactory(RenderTarget2D, GameInterface); _myCharacter = new Character(RenderTarget2D, BuildingsFactory, "Серафим"); PlayersFactory = new PlayersFactory(RenderTarget2D, GameInterface, _myCharacter); MobsFactory = new MobsFactory(RenderTarget2D, GameInterface); GameStats = new GameStats(PlayersFactory, BuildingsFactory, null); GameStats.Money = 100; GameStats.Woods = 100; _myCharacter.eventCreateTower += (CommonTower tower) => { GameStats.Money -= (int)tower.Id; GameStats.Woods -= (int)tower.Id; }; GameInterface.SetGameStats(GameStats); _timeLastDraw = 0; _timeLastUpdate = 0; gameState = new GameState(); mainMenu = new MainMenu(RenderTarget2D, RESOLUTION); SoundsManager.init(); AudioPlayer sound = new AudioPlayer("goobye.mp3"); sound.Volume = 0.04f; sound.Play(); Connector.ConnectWithServer(); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); var config = File.ReadAllLines("config.txt").Select(l => l.Split('=')).ToDictionary(k => k[0], v => string.Join("=", v.Skip(1))); Instruments.localBaro = int.Parse(config["localBaro"]); instruments.UpdateBaro(); comPort = config["comPort"]; baudRate = int.Parse(config["baudRate"]); Instruments.mbOffset = float.Parse(config["mbOffset"]); // Zero, Zero _form.Top = _form.Left = 0; adhrs = xPlaneMode ? (IADHRS) new ADHRSXPlane(comPort, baudRate) : (IADHRS) new ADHRS(comPort, baudRate); Task.Run(DataAquasition); // set it free! // Initialize a TextFormat Stock.TextFormatCenter = new TextFormat(FactoryDWrite, "Calibri", 64) { TextAlignment = TextAlignment.Center, ParagraphAlignment = ParagraphAlignment.Center }; Stock.TextFormatLeft = new TextFormat(FactoryDWrite, "Calibri", 64) { TextAlignment = TextAlignment.Leading, ParagraphAlignment = ParagraphAlignment.Center }; Stock.TextFormatRight = new TextFormat(FactoryDWrite, "Calibri", 64) { TextAlignment = TextAlignment.Trailing, ParagraphAlignment = ParagraphAlignment.Center }; Stock.TextFormatRightSmall = new TextFormat(FactoryDWrite, "Calibri", 48) { TextAlignment = TextAlignment.Trailing, ParagraphAlignment = ParagraphAlignment.Center }; RenderTarget2D.TextAntialiasMode = TextAntialiasMode.Cleartype; Stock.ClientRectangle = new RectangleF(0, 0, demoConfiguration.Width, demoConfiguration.Height); baroColorBrush = new SolidColorBrush(RenderTarget2D, Color.DarkGray); instrumentColorBrush = new SolidColorBrush(RenderTarget2D, Color.LightGray); errorBrush = new SolidColorBrush(RenderTarget2D, Color.Red); // Initialize Chevrons // Compile Vertex and Pixel shaders var vertexShaderByteCode = ShaderBytecode.CompileFromFile("BackFlip.fx", "VS", "vs_4_0"); var vertexShader = new VertexShader(Device, vertexShaderByteCode); var pixelShaderByteCode = ShaderBytecode.CompileFromFile("BackFlip.fx", "PS", "ps_4_0"); var pixelShader = new PixelShader(Device, pixelShaderByteCode); var signature = ShaderSignature.GetInputSignature(vertexShaderByteCode); // Layout from VertexShader input signature var layout = new InputLayout(Device, signature, new[] { new SharpDX.Direct3D11.InputElement("POSITION", 0, Format.R32G32B32A32_Float, 0, 0), new SharpDX.Direct3D11.InputElement("COLOR", 0, Format.R32G32B32A32_Float, 16, 0) }); // Instantiate Vertex buiffer from vertex data var verticesChevron = SharpDX.Direct3D11.Buffer.Create(Device, BindFlags.VertexBuffer, attitudeIndicator.Chevrons()); //var verticesTarget = SharpDX.Direct3D11.Buffer.Create(Device, BindFlags.VertexBuffer, attitudeIndicator.TargetBar(instruments.alpha)); //var verticesDoF = SharpDX.Direct3D11.Buffer.Create(Device, BindFlags.VertexBuffer, attitudeIndicator.DirectionOfFlight(instruments.pitch)); // Create Constant Buffer contantBuffer = new SharpDX.Direct3D11.Buffer(Device, Utilities.SizeOf <Matrix>(), ResourceUsage.Default, BindFlags.ConstantBuffer, CpuAccessFlags.None, ResourceOptionFlags.None, 0); context = Device.ImmediateContext; // Prepare All the stages context.InputAssembler.InputLayout = layout; context.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList; context.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(verticesChevron, Utilities.SizeOf <Vector4>() * 2, 0)); context.VertexShader.SetConstantBuffer(0, contantBuffer); context.VertexShader.Set(vertexShader); context.PixelShader.Set(pixelShader); // Prepare matrices view = Matrix.LookAtLH(new Vector3(0, 0, -5), new Vector3(0, 0, 0), Vector3.UnitY); proj = Matrix.PerspectiveFovLH((float)Math.PI / 4.0f, demoConfiguration.Width / (float)demoConfiguration.Height, 0.1f, 100.0f); varioBeeper.Start(); }
public void Run(DemoConfiguration appConfiguration, Action contentLoadCallback) { this.contentLoadCallback = contentLoadCallback; this.Run(appConfiguration); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); RenderTarget2D.TextAntialiasMode = TextAntialiasMode.Cleartype; }
public RoomController(GoogleService googleService, DemoConfiguration demoConfiguration) { _googleService = googleService; _demo = demoConfiguration; }
/*EndHide*/ public UploadController(IWebHostEnvironment hostingEnvironment /*BeginHide*/, DemoConfiguration configuration /*EndHide*/) { ContentRootPath = hostingEnvironment.ContentRootPath; /*BeginHide*/ SiteMode = configuration.GetConfigurationValue <bool>("SiteMode"); /*EndHide*/ }
protected override void ConfigureServices(IServiceCollection services) { base.ConfigureServices(services); DemoConfiguration.RegisterServices(services); }
protected override void Initialize(DemoConfiguration demoConfiguration) { base.Initialize(demoConfiguration); _bitmap = LoadFromFile(RenderTarget2D, "sharpdx.png"); }