public void Resolve_DbContext_for_API()
        {
            IEndPointConfiguration storeFrontep     = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName && x.API_Name == API_Name.StoreFront);
            IEndPointConfiguration backOfficeep     = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName && x.API_Name == API_Name.BackOffice);
            ResolutionHelper       resolutionHelper = Container.Resolve <ResolutionHelper>();
            DbContext storeFrontContext             = resolutionHelper.ResolveDbContext(storeFrontep);
            DbContext backOfficeContext             = resolutionHelper.ResolveDbContext(backOfficeep);

            Assert.IsNotNull(storeFrontContext);
            Assert.IsNotNull(backOfficeContext);
            Assert.IsTrue(storeFrontContext is Artifacts.StoreFront.Db);
            Assert.IsTrue(backOfficeContext is Artifacts.BackOffice.Db);

            if (CurrentDatabaseProviderName == DataBaseProviderName.MSSQL)
            {
                Assert.IsTrue(storeFrontContext.Database.GetDbConnection().ConnectionString == storeFrontep.ConnectionString);
                Assert.IsTrue(backOfficeContext.Database.GetDbConnection().ConnectionString == backOfficeep.ConnectionString);
            }
            else if (CurrentDatabaseProviderName == DataBaseProviderName.MySQL)
            {
                // MySql database connector changes the connection string.
                Assert.IsTrue(storeFrontContext.Database.GetDbConnection().ConnectionString.ToLower().Contains("database=adaptiveclientef_storefront"));
                Assert.IsTrue(backOfficeContext.Database.GetDbConnection().ConnectionString.ToLower().Contains("database=adaptiveclientef_backoffice"));
            }
        }
Esempio n. 2
0
 void OnResolution540p()
 {
     ResolutionHelper.resolution_index = 4;
     ResolutionHelper.Apply();
     HideResolutionIcon();
     resolution_540p_icon.SetActive(true);
 }
Esempio n. 3
0
 /// <summary>
 /// The main Game camera.  This is used to move around the current map.
 /// </summary>
 /// <param name="resolutionHelper">The resolution help that it works with</param>
 /// <param name="graphicsDevice">The graphics device that is used for calculations</param>
 public Camera(ResolutionHelper resolutionHelper, GraphicsDevice graphicsDevice)
 {
     _resolutionHelper  = resolutionHelper;
     _graphicsDevice    = graphicsDevice;
     _location          = Vector3.Zero;
     _currentController = GameWorld.GetPlayerController(0);
 }
        private static bool IsResolutionChangeNeeded(Screen screen, ResolutionModeWrapper resolutionSettings)
        {
            Devmode mode;

            if (resolutionSettings != null && ResolutionHelper.GetCurrentResolutionSettings(out mode, screen.DeviceName) && !resolutionSettings.Equals(mode))
            {
                return(true);
            }
            return(false);
        }
        public void Resolve_DatabaseInitalizer_for_API()
        {
            IEndPointConfiguration storeFrontep     = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName && x.API_Name == API_Name.StoreFront);
            IEndPointConfiguration backOfficeep     = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName && x.API_Name == API_Name.BackOffice);
            ResolutionHelper       resolutionHelper = Container.Resolve <ResolutionHelper>();

            IDatabaseInitializer storeFrontInitalizer = resolutionHelper.ResolveDatabaseInitializer(storeFrontep);
            IDatabaseInitializer backOfficeInitalizer = resolutionHelper.ResolveDatabaseInitializer(backOfficeep);

            Assert.IsTrue(storeFrontInitalizer is Artifacts.StoreFront.SFDatabaseInitializer);
            Assert.IsTrue(backOfficeInitalizer is Artifacts.BackOffice.BODatabaseInitializer);
        }
Esempio n. 6
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DEVMODE1 selectedMode;

            if (DisplayModes.SupportedDisplayModes.TryGetValue(listBox1.SelectedItem.ToString(), out selectedMode))
            {
                ResolutionHelper.ChangeResolution(selectedMode.dmPelsWidth, selectedMode.dmPelsHeight);

                var screenSize = DisplayModes.CurrentResolution;
                label2.Text = $"{screenSize.Width}x{screenSize.Height}";
            }
        }
Esempio n. 7
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }
            int index = (int)value;

            using (var stream = Application.GetResourceStream(new Uri(String.Format("Assets/CalendarTemplate/{0}.jpg", index), UriKind.Relative)).Stream)
            {
                return(PictureDecoder.DecodeJpeg(stream, ResolutionHelper.GetScreenWidth() / 2, ResolutionHelper.GetScreenHeight() / 2));
            }
        }
Esempio n. 8
0
        public override void ViewDidLoad()
        {
            View = new UIView
            {
                BackgroundColor      = UIColor.White,
                MultipleTouchEnabled = false
            };

            ResolutionHelper.InitStaticVariable();
            DimensionHelper.InitStaticVariable();

            base.ViewDidLoad();

            InitView();
            CreateBinding();
        }
        public void Resolve_DbContextOptions_for_provider()
        {
            IEndPointConfiguration ep = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName);
            ResolutionHelper       resolutionHelper = Container.Resolve <ResolutionHelper>();
            IDbContextOptions      options          = resolutionHelper.ResolveDbContextOptions(ep);

            Assert.IsNotNull(options);

            if (CurrentDatabaseProviderName == DataBaseProviderName.MSSQL)
            {
                Assert.IsTrue(options is Artifacts.DbContextOptions_MSSQL);
            }
            else if (CurrentDatabaseProviderName == DataBaseProviderName.MySQL)
            {
                Assert.IsTrue(options is Artifacts.DbContextOptions_MySQL);
            }
        }
        public void Resolve_MigrationHelper_for_API()
        {
            IEndPointConfiguration storeFrontep     = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName && x.API_Name == API_Name.StoreFront);
            IEndPointConfiguration backOfficeep     = EndPoints.First(x => x.ProviderName == CurrentDatabaseProviderName && x.API_Name == API_Name.BackOffice);
            ResolutionHelper       resolutionHelper = Container.Resolve <ResolutionHelper>();
            DbContext storeFrontContext             = resolutionHelper.ResolveMigrationContext(storeFrontep);
            DbContext backOfficeContext             = resolutionHelper.ResolveMigrationContext(backOfficeep);

            Assert.IsNotNull(storeFrontContext);
            Assert.IsNotNull(backOfficeContext);

            if (CurrentDatabaseProviderName == DataBaseProviderName.MSSQL)
            {
                Assert.IsTrue(storeFrontContext is Artifacts.StoreFront.Db_MSSQL);
                Assert.IsTrue(backOfficeContext is Artifacts.BackOffice.Db_MSSQL);
            }
            else if (CurrentDatabaseProviderName == DataBaseProviderName.MySQL)
            {
                Assert.IsTrue(storeFrontContext is Artifacts.StoreFront.Db_MySQL);
                Assert.IsTrue(backOfficeContext is Artifacts.BackOffice.Db_MySQL);
            }
        }
Esempio n. 11
0
    void Awake()
    {
        float scale = ResolutionHelper.GetScale();

        _cellSize  *= scale;
        _lineThick *= scale;

        // Set step
        _step = _cellSize + _lineThick;

        // Set board width
        _width = _column * _step + _lineThick;

        // Set board height
        _height = _row * _step + _lineThick;

        // Set square minimum delta movement
        _squareMinDeltaMove = _minDeltaMove * _minDeltaMove;

        // Set square minimum delta dragging
        _squareMinDeltaDrag = _minDeltaDrag * _minDeltaDrag;
    }
 public DatabaseUtilities(ResolutionHelper resolver)
 {
     this.resolver = resolver;
 }
Esempio n. 13
0
    void OnDrawGizmos()
    {
        float scale     = Application.isPlaying ? 1.0f : ResolutionHelper.GetScale();
        float cellSize  = _cellSize * scale;
        float lineThick = _lineThick * scale;

        // Set color
        Gizmos.color = Color.blue;

        float step = cellSize + lineThick;

        // Bottom-left position
        float bottom = -(_row * step + lineThick) * 0.5f;
        float left   = -(_column * step + lineThick) * 0.5f;

        // Top-right position
        float top   = -bottom;
        float right = -left;

        Vector3 from = Vector3.zero;
        Vector3 to   = Vector3.zero;

        // Border
        {
            // Vertical
            from.y = bottom;
            to.y   = top;

            from.x = to.x = left;
            Gizmos.DrawLine(from, to);

            from.x = to.x = right;
            Gizmos.DrawLine(from, to);

            // Horizontal
            from.x = left;
            to.x   = right;

            from.y = to.y = bottom;
            Gizmos.DrawLine(from, to);

            from.y = to.y = top;
            Gizmos.DrawLine(from, to);
        }

        //
        float x;
        float y = bottom + lineThick;

        // Draw vertical lines
        for (int i = 0; i < _row; i++)
        {
            x = left + lineThick;

            from.y = y;
            to.y   = from.y + cellSize;

            for (int j = 0; j < _column; j++)
            {
                from.x = to.x = x;
                Gizmos.DrawLine(from, to);

                from.x = to.x = x + cellSize;
                Gizmos.DrawLine(from, to);

                x += step;
            }

            y += step;
        }

        x = left + lineThick;

        // Draw horizontal lines
        for (int j = 0; j < _column; j++)
        {
            y = bottom + lineThick;

            from.x = x;
            to.x   = from.x + cellSize;

            for (int i = 0; i < _row; i++)
            {
                from.y = to.y = y;
                Gizmos.DrawLine(from, to);

                from.y = to.y = y + cellSize;
                Gizmos.DrawLine(from, to);

                y += step;
            }

            x += step;
        }
    }
 private static void PerformResolutionChange(Screen screen, ResolutionModeWrapper resolutionSettings)
 {
     ResolutionHelper.ChangeResolutionEx(resolutionSettings, screen.DeviceName);
 }
Esempio n. 15
0
 void Awake()
 {
     Application.targetFrameRate = 24;
     ResolutionHelper.Apply();
 }
Esempio n. 16
0
        override protected void CreateChildren()
        {
            base.CreateChildren();

            #region List 1

            List list1 = new List
            {
                PercentWidth  = 100,
                PercentHeight = 100,
                MinWidth      = 200,
                MinHeight     = 100,
                Height        = 200,
                DataProvider  = new ArrayList(EasingHelper.GetEasingList()),
                SelectedItem  = "Bounce"
            };
            AddContentChild(list1);

            #endregion

            #region List 2

            List list2 = new List
            {
                PercentWidth  = 100,
                PercentHeight = 100,
                MinHeight     = 100,
                Height        = 200,
                DataProvider  = new ArrayList(
                    Application.isWebPlayer
                                         ? ResolutionHelper.GetResolutionList()
                                         : ResolutionHelper.GetDummyResolutionList())
            };
            AddContentChild(list2);

            #endregion

            #region Drow down list

            DropDownList dropDownList = new DropDownList
            {
                PercentWidth = 100,
                MinWidth     = 200,
                DataProvider = new ArrayList(
                    Application.isWebPlayer
                                         ? ResolutionHelper.GetResolutionList()
                                         : ResolutionHelper.GetDummyResolutionList())
            };
            AddContentChild(dropDownList);

            dropDownList = new DropDownList
            {
                PercentWidth = 100,
                MinWidth     = 200,
                DataProvider = new ArrayList(new System.Collections.Generic.List <object>
                {
                    new ListItem(1, "Zagreb"),
                    new ListItem(2, "Osijek"),
                    new ListItem(3, "Rijeka"),
                    new ListItem(4, "Split"),
                    new ListItem(5, "Ljubljana"),
                    new ListItem(6, "Wiena"),
                    new ListItem(7, "Munich"),
                    new ListItem(8, "Berlin")
                })
            };
            AddContentChild(dropDownList);

            List list3 = new List
            {
                PercentWidth = 100,
                MinHeight    = 100,
                Height       = 200,
                DataProvider = new ArrayList(EasingHelper.GetEasingInOutList()),
                SelectedItem = "EaseIn"
            };
            AddContentChild(list3);

            #endregion

            #region Button

            Button btn = new Button
            {
                Text      = "Show alert",
                SkinClass = typeof(ImageButtonSkin),
                Icon      = Resources.Load <Texture>("Icons/tab-comment")
                            //StyleDeclaration = new StyleDeclaration(RectButtonSkin.Instance, "button"),
            };

            btn.Click += delegate
            {
                Alert.Show("Hi!", "This is the alert", AlertButtonFlag.Ok);
            };
            ControlBarGroup.AddChild(btn);

            #endregion
        }
        /// <summary>
        /// Internal shared implementation of the Resolve method. Retrieves the values configured by
        /// the developer (usually in the itinerary designer) for the BTDF-SSO resolver. Each value
        /// is used as a key to search the name-value dictionary stored in SSO (originating from the
        /// settings spreadsheet). The values matching each key are assigned into the ResolverMgr's
        /// endpoint properties collection.
        /// </summary>
        /// <param name="config">Resolver configuration string</param>
        /// <param name="resolver">Resolver name</param>
        /// <param name="resolution"></param>
        /// <returns></returns>
        private Dictionary <string, string> ResolveHelper(string config, string resolver, Resolution resolution)
        {
            if (!resolver.Contains(ResolutionHelper.MonikerSeparator))
            {
                resolver = resolver + ResolutionHelper.MonikerSeparator;
            }

            Dictionary <string, string> resolverDictionary = new Dictionary <string, string>();

            try
            {
                Dictionary <string, string> facts = ResolutionHelper.GetFacts(config, resolver);

                Sso expr = new Sso();

                expr.AffiliateAppName = ResolverMgr.GetConfigValue(facts, false, "AffiliateAppName");

                expr.Action                 = ResolverMgr.GetConfigValue(facts, false, "Action");
                expr.EndpointConfig         = ResolverMgr.GetConfigValue(facts, false, "EndpointConfig");
                expr.JaxRpcResponse         = ResolverMgr.GetConfigValue(facts, false, "JaxRpcResponse");
                expr.MessageExchangePattern = ResolverMgr.GetConfigValue(facts, false, "MessageExchangePattern");
                expr.TargetNamespace        = ResolverMgr.GetConfigValue(facts, false, "TargetNamespace");
                expr.TransformType          = ResolverMgr.GetConfigValue(facts, false, "TransformType");
                expr.TransportLocation      = ResolverMgr.GetConfigValue(facts, false, "TransportLocation");
                expr.TransportType          = ResolverMgr.GetConfigValue(facts, false, "TransportType");

                string rowValue = null;

                if (!string.IsNullOrEmpty(expr.Action))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.Action);
                    ResolverMgr.SetEndpointProperties("Action", rowValue, resolution);
                }

                if (!string.IsNullOrEmpty(expr.EndpointConfig))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.EndpointConfig);
                    ResolverMgr.SetEndpointProperties("EndpointConfig", rowValue, resolution);
                }

                if (!string.IsNullOrEmpty(expr.JaxRpcResponse))
                {
                    // This one is just True/False, enforced by the itinerary designer.
                    //rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.JaxRpcResponse);
                    ResolverMgr.SetEndpointProperties("JaxRpcResponse", expr.JaxRpcResponse, resolution);
                }

                if (!string.IsNullOrEmpty(expr.MessageExchangePattern))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.MessageExchangePattern);
                    ResolverMgr.SetEndpointProperties("MessageExchangePattern", rowValue, resolution);
                }

                if (!string.IsNullOrEmpty(expr.TargetNamespace))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.TargetNamespace);
                    ResolverMgr.SetEndpointProperties("TargetNamespace", rowValue, resolution);
                }

                if (!string.IsNullOrEmpty(expr.TransformType))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.TransformType);
                    ResolverMgr.SetEndpointProperties("TransformType", rowValue, resolution);
                }

                if (!string.IsNullOrEmpty(expr.TransportLocation))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.TransportLocation);
                    ResolverMgr.SetEndpointProperties("TransportLocation", rowValue, resolution);
                }

                if (!string.IsNullOrEmpty(expr.TransportType))
                {
                    rowValue = ReadValueFromSso(expr.AffiliateAppName, expr.TransportType);
                    ResolverMgr.SetEndpointProperties("TransportType", rowValue, resolution);
                }

                ResolverMgr.SetResolverDictionary(resolution, resolverDictionary);
            }
            catch (Exception exception)
            {
                EventLog.WriteEntry("BizTalk Server", exception.ToString(), EventLogEntryType.Error);
                throw;
            }

            return(resolverDictionary);
        }
Esempio n. 18
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     ResolutionHelper.ChangeResolution(oldScreenWidth, oldScreenHeight);
 }
Esempio n. 19
0
        override protected void CreateChildren()
        {
            base.CreateChildren();

            Form form = new Form {
                PercentWidth = 100                  /*, Padding = 0*/
            };

            AddContentChild(form);

            // full screen checkbox
            _chkFullScreen = new CheckBox
            {
                Text      = "Full screen",
                StyleName = "checkbox",
                Right     = 10,
                Top       = 10,
                //Padding = 0,
                ResizeWithContent = true,
                ToggleMode        = true,
                FocusEnabled      = false,
                Selected          = OptionsModel.Instance.FullScreen
            };
            _chkFullScreen.Change += delegate
            {
                _list.Enabled = _chkFullScreen.Selected;
                HandleSubmitButton();
            };
            form.AddField("fullScreen", "Full screen:", _chkFullScreen);

            // resolution list
            _list = new List
            {
                //PercentWidth = 100,
                RequireSelection = true,
                SelectedItem     = OptionsModel.Instance.Resolution,
                Enabled          = OptionsModel.Instance.FullScreen,
                DataProvider     = new ArrayList(Application.isEditor
                                               ? ResolutionHelper.GetDummyResolutionList()
                                               : ResolutionHelper.GetResolutionList())
            };

            /*_list.SelectedIndexChanged += delegate
             *                                {
             *                                    HandleSubmitButton();
             *                                };*/
            form.AddField("list", "Resolution:", _list);

            #region Buttons

            _btnSubmit = new Button
            {
                Text    = "Set resolution",
                Icon    = ImageLoader.Instance.Load("Icons/accept"),
                Enabled = false
            };
            _btnSubmit.Press += SetResolution;
            ControlBarGroup.AddChild(_btnSubmit);

            _btnCancel = new Button
            {
                Text = "Cancel",
                Icon = ImageLoader.Instance.Load("Icons/cancel")
            };
            _btnCancel.Press += delegate
            {
                ExecCallback(CANCEL);
            };
            ControlBarGroup.AddChild(_btnCancel);

            #endregion

            Plugins.Add(new TabManager());
        }
Esempio n. 20
0
 private void button2_Click(object sender, System.EventArgs e)
 {
     ResolutionHelper.ChangeResolution(oldScreenWidth, oldScreenHeight);
 }
Esempio n. 21
0
 private void CountZoomLevel()
 {
     ZoomLevel = ResolutionHelper.CountZoomLevel();
 }