Esempio n. 1
0
        private void InitializePanels()
        {
            WaitPopup.UpdateProgress(0, 10);

            NavigationPanel = new NavigationPanel(ProjectManager);
            WaitPopup.UpdateProgress(1, 10);

            ViewportPanel = new ViewportPanel(ProjectManager);
            WaitPopup.UpdateProgress(2, 10);

            ValidationPanel = new ValidationPanel(ProjectManager);
            WaitPopup.UpdateProgress(3, 10);

            PropertiesPanel = new PartPropertiesPanel(ProjectManager);
            WaitPopup.UpdateProgress(4, 10);

            DetailPanel = new ElementDetailPanel(ProjectManager);
            WaitPopup.UpdateProgress(5, 10);

            StudConnectionPanel = new StudConnectionPanel(ProjectManager);
            WaitPopup.UpdateProgress(6, 10);

            ConnectionPanel = new ConnectionEditorPanel(ProjectManager);
            WaitPopup.UpdateProgress(7, 10);

            InfoPanel = new ProjectInfoPanel(ProjectManager);
            WaitPopup.UpdateProgress(8, 10);
        }
Esempio n. 2
0
        /// <summary>
        /// Fecha a mídia aberta anteriormente ( renderiza os elementos pendentes )
        /// </summary>
        public void CloseMedia()
        {
            if (reportTable != null)
            {
                reportTable.FinishDrawing();
                AddLineBreak();
            }

            // Acrescenta os links para imprimir e exportar
            String query = "?report=" + reportClass;

            foreach (KeyValuePair <String, Object> param in reportFilter)
            {
                if (param.Value != null)
                {
                    query += "&" + param.Key + "=" + param.Value;
                }
            }
            String printUrl  = "Print.aspx" + query;
            String exportUrl = "Export.aspx" + query;

            // A mídia de relatório é navegável então após fechar a tabela de dados, acrescenta
            // um painel para que o usuário possa navegar pelo relatório
            NavigationPanel navigationPanel = new NavigationPanel(media, printUrl, exportUrl, openNewWindow);

            navigationPanel.Show(currentPage, pageControl.GetPageCount());
            AddLineBreak();
            AddLineBreak();
        }
Esempio n. 3
0
        private void InitializePanels()
        {
            NavigationPanel     = new NavigationPanel(ProjectManager);
            ViewportPanel       = new ViewportPanel(ProjectManager);
            ValidationPanel     = new ValidationPanel(ProjectManager);
            PropertiesPanel     = new PartPropertiesPanel(ProjectManager);
            DetailPanel         = new ElementDetailPanel(ProjectManager);
            StudConnectionPanel = new StudConnectionPanel(ProjectManager);

            ViewportPanel.Show(DockPanelControl, DockState.Document);
            StudConnectionPanel.Show(DockPanelControl, DockState.Document);
            ViewportPanel.Activate();

            DockPanelControl.DockLeftPortion = 250;
            NavigationPanel.Show(DockPanelControl, DockState.DockLeft);

            DockPanelControl.DockWindows[DockState.DockBottom].BringToFront();
            DockPanelControl.DockBottomPortion = 230;

            PropertiesPanel.Show(DockPanelControl, DockState.DockBottom);
            DetailPanel.Show(PropertiesPanel.Pane, null);
            ValidationPanel.Show(PropertiesPanel.Pane, null);

            PropertiesPanel.Activate();
        }
Esempio n. 4
0
        public bool AddLaptopsToWishList()
        {
            _navPanel = new NavigationPanel(driver);
            _navPanel.OpenCatalogPage(wait).SelectCategory(LaptopsCategoryTitle, wait);
            LaptopsCategory  lapCat       = new LaptopsCategory(driver);
            ProductsListPage productsList = lapCat.OpenAllLaptopsProductsList(wait);

            productsList.OpenSortPanel(wait).
            RbtnExpensiveCheap.Click();

            foreach (var item in _laptopsModels)
            {
                AndroidElement currentProduct = productsList.GetProduct(item, wait);
                //if (currentProduct != null) new ProductCompactView(driver, currentProduct).AddToWishList(wait);
                //else continue;
                new ProductCompactView(driver, currentProduct).AddToWishList(wait);
            }
            driver.PressKeyCode(AndroidKeyCode.Back);
            var prodElemsInWishList = _navPanel.
                                      OpenWishLists(wait).
                                      OpenGuestWishList(wait).
                                      WishedProductsList;
            // _laptopsModels.Reverse();

            var matchNames = new bool[3];
            var count      = 0;

            foreach (var item in prodElemsInWishList)
            {
                matchNames[count] = new ProductCompactView(driver, item).ProductName.Text.Contains(_laptopsModels[count]);
                count++;
            }
            return(matchNames[0] && matchNames[1] && matchNames[2]);
        }
Esempio n. 5
0
 public static void Register(NavigationPanel navigationPanel, INavigationManager manager)
 {
     if (_panels.ContainsKey(navigationPanel))
     {
         _panels.Remove(navigationPanel);
     }
     _panels.Add(navigationPanel, manager);
 }
Esempio n. 6
0
        public void Test_ClickNotVisibleButt()
        {
            navPan = new NavigationPanel(driver);
            navPan.Open(wait);
            //TouchActions touchActions = new TouchActions(driver);
            //touchActions.LongPress(recViewInstance.BtnCart).Move(recViewInstance.BtnMain.Location.X, recViewInstance.BtnMain.Location.Y).Release().Perform();

            ElemHelper.ScrollToElement(driver, "Просмотренные");
            navPan.BtnWatched.Click();
            Thread.Sleep(5000);
        }
Esempio n. 7
0
        public void SearchTest()
        {
            navPan = new NavigationPanel(driver);
            Thread.Sleep(5000);
            navPan.Close();
            SearchPage searchPage = new SearchPage(driver);

            searchPage.Open(wait)
            .EnterSearchQuery("notebook", wait);
            Thread.Sleep(3000);
            Thread.Sleep(5000);
        }
Esempio n. 8
0
        public void Test_CategoryClick()
        {
            navPan = new NavigationPanel(driver);
            navPan.Open(wait);

            navPan.BtnCatalog.Click();
            CatalogPage catPage = new CatalogPage(driver);

            //ElemHelper.ScrollToElement(driver, catPage._childProducts);
            //catPage.ChildProducts.Click();

            Thread.Sleep(5000);
        }
Esempio n. 9
0
        public void Test_AccountCartOpen()
        {
            _navPanel = new NavigationPanel(driver);
            wait.Until(d => _navPanel.IsNavigationPanelOpened());
            _navPanel.OpenMore(wait)
            .OpenLoginPage(wait)
            .LogIn(TestEmail, TestPassword, wait);

            var cartPage = _navPanel
                           .OpenCart(wait);

            var actualTitle = cartPage.GetTitle(wait);

            StringAssert.AreEqualIgnoringCase(ExpectedEmptyCartTitle, actualTitle);
        }
Esempio n. 10
0
        public void Test_AccountCartOpen()
        {
            navPanel = new NavigationPanel(driver);
            wait.Until((d) => navPanel.IsNavigationPanelOpened());
            navPanel.OpenLoginPage(wait)
            .LogIn("*****@*****.**", "Testpassword1", wait);

            CartPage cartPage = navPanel
                                .Open(wait)
                                .OpenCart(wait);

            String actualTitle   = cartPage.GetTitle(wait);
            String expectedTitle = "Корзина пуста";

            StringAssert.AreEqualIgnoringCase(expectedTitle, actualTitle);
        }
Esempio n. 11
0
        public void Test_AccountWishListOpen()
        {
            _navPanel = new NavigationPanel(driver);
            wait.Until(d => _navPanel.IsNavigationPanelOpened());
            _navPanel.OpenMore(wait)
            .OpenLoginPage(wait)
            .LogIn(TestEmail, TestPassword, wait);

            var localWishList = _navPanel
                                .OpenWishLists(wait)
                                .OpenGuestWishList(wait);

            var actualTitle = localWishList.EmptyTitle.Text;

            StringAssert.AreEqualIgnoringCase(ExpectedEmptyWishListTitle, actualTitle);
        }
Esempio n. 12
0
        public void Test_AccountWishListOpen()
        {
            navPanel = new NavigationPanel(driver);
            wait.Until((d) => navPanel.IsNavigationPanelOpened());
            navPanel.OpenLoginPage(wait)
            .LogIn("*****@*****.**", "Testpassword1", wait);

            WishList localWishList = navPanel
                                     .Open(wait)
                                     .OpenWishLists(wait)
                                     .OpenGuestWishList(wait);

            String actualTitle   = localWishList.EmptyTitle.Text;
            String expectedTitle = "Этот список пуст";

            StringAssert.AreEqualIgnoringCase(expectedTitle, actualTitle);
        }
Esempio n. 13
0
        private void LoadDefaultLayout()
        {
            foreach (var content in DockPanelControl.Contents.ToArray())
            {
                content.DockHandler.DockPanel = null;
            }

            try
            {
                var layoutStream = ResourceHelper.GetResourceStream("DefaultLayout.xml");
                if (layoutStream != null)
                {
                    DockPanelControl.LoadFromXml(layoutStream, DockContentLoadingHandler);
                }
                return;
            }
            catch { }

            ViewportPanel.Show(DockPanelControl, DockState.Document);

            StudConnectionPanel.Show(DockPanelControl, DockState.Document);

            ViewportPanel.Activate();

            DockPanelControl.DockLeftPortion = 250;

            NavigationPanel.Show(DockPanelControl, DockState.DockLeft);

            DockPanelControl.DockWindows[DockState.DockBottom].BringToFront();
            DockPanelControl.DockBottomPortion = 250;

            PropertiesPanel.Show(DockPanelControl, DockState.DockBottom);

            DetailPanel.Show(PropertiesPanel.Pane, null);

            ConnectionPanel.Show(PropertiesPanel.Pane, null);

            ValidationPanel.Show(PropertiesPanel.Pane, null);

            InfoPanel.Show(PropertiesPanel.Pane, null);
        }
Esempio n. 14
0
        public bool AddLaptopsToCart()
        {
            navPanel = new NavigationPanel(driver);
            navPanel.OpenCatalogPage(wait).SelectCategory("Ноутбуки и компьютеры", wait);
            LaptopsCategory  lapCat       = new LaptopsCategory(driver);
            ProductsListPage productsList = lapCat.OpenAllLaptopsProductsList(wait);

            productsList.OpenSortPanel(wait).
            RbtnExpensiveCheap.Click();

            List <String> laptopsModels = new List <String> {
                "GT75VR7RE-230UA", "GT758RF-239UA", "MPTU35/Z0UE"
            };

            foreach (var item in laptopsModels)
            {
                AndroidElement currentProduct = productsList.GetProduct(item, wait);
                new ProductCompactView(driver, currentProduct).AddToCart(wait);
            }

            IList <AndroidElement> cartItems = navPanel.
                                               Open(wait).
                                               OpenCart(wait).
                                               GetCartItems(wait);

            laptopsModels.Reverse();

            bool[] matchNames = new bool[3];
            int    count      = 0;

            foreach (var item in cartItems)
            {
                var currText = new CartItemView(driver, item).GetTitle(wait);
                matchNames[count] = currText.Contains(laptopsModels[count]);
                Console.WriteLine(currText + " = " + laptopsModels[count]);
                count++;
            }
            return(matchNames[0] & matchNames[1] & matchNames[2]);
        }
Esempio n. 15
0
        public bool AddLaptopsToWishList()
        {
            navPanel = new NavigationPanel(driver);
            navPanel.OpenCatalogPage(wait).SelectCategory("Ноутбуки и компьютеры", wait);
            LaptopsCategory  lapCat       = new LaptopsCategory(driver);
            ProductsListPage productsList = lapCat.OpenAllLaptopsProductsList(wait);

            productsList.OpenSortPanel(wait).
            RbtnExpensiveCheap.Click();

            List <String> laptopsModels = new List <String> {
                "GT75VR7RE-230UA", "GT758RF-239UA", "MPTU35/Z0UE"
            };

            foreach (var item in laptopsModels)
            {
                AndroidElement currentProduct = productsList.GetProduct(item, wait);
                //if (currentProduct != null) new ProductCompactView(driver, currentProduct).AddToWishList(wait);
                //else continue;
                new ProductCompactView(driver, currentProduct).AddToWishList(wait);
            }

            IList <AndroidElement> prodElemsInWishList = navPanel.
                                                         Open(wait).
                                                         OpenWishLists(wait).
                                                         OpenGuestWishList(wait).
                                                         WishedProductsList;

            bool[] matchNames = new bool[3];
            int    count      = 0;

            foreach (var item in prodElemsInWishList)
            {
                matchNames[count] = new ProductCompactView(driver, item).ProductName.Text.Contains(laptopsModels[count]);
                count++;
            }
            return(matchNames[0] & matchNames[1] & matchNames[2]);
        }
Esempio n. 16
0
        public void ChooseSomeNotebooks()
        {
            navPan = new NavigationPanel(driver);
            navPan.OpenCatalogPage(wait).SelectCategory("Ноутбуки и компьютеры", wait);
            LaptopsCategory  lapCat       = new LaptopsCategory(driver);
            ProductsListPage productsList = lapCat.OpenAllLaptopsProductsList(wait);

            List <String> laptopsToAddNames = new List <String> {
                "90NB0HS1-M00450", "90NR0GN1-M03880", "80XL03UJRA"
            };

            foreach (var item in laptopsToAddNames)
            {
                AndroidElement currentProduct = productsList.GetProduct(item, wait);
                new ProductCompactView(driver, currentProduct).BtnAddToWishList.Click();
            }

            IList <AndroidElement> prodElemsInWishList = navPan.
                                                         Open(wait).
                                                         OpenWishLists(wait).
                                                         OpenGuestWishList(wait).
                                                         WishedProductsList;

            //List<String> wishListProductsNames = new List<String>();

            bool[] result = new bool[3];
            int    count  = 0;

            foreach (var item in prodElemsInWishList)
            {
                //wishListProductsNames.Add(new ProductCompactView(driver, item).ProductName.Text);
                result[count] = new ProductCompactView(driver, item).ProductName.Text.Contains(laptopsToAddNames[count]);
                count++;
            }

            //CollectionAssert.AreEquivalent(wishListProductsNames, laptopsToAddNames);
            Assert.IsTrue(result[0] & result[1] & result[2]);
        }
        private void SecondInterfaceSetup_Domination()
        {
            Task1Panel.Hide();
            Task2Panel.Show();
            NavigationPanel.Hide();
            StrategiesPanel.Hide();
            B.Show();
            CreateArrays(0, 1);

            UI.ControlsAligner gpanel = new UI.ControlsAligner(MatrixesPanel);
            gpanel.AddElement(A);
            gpanel.AddElement(B, false);
            gpanel.Align();

            UI.ControlsAligner form = new UI.ControlsAligner(this);
            form.AddElement(Task2Panel);
            form.AddElement(MatrixesPanel);
            form.AddElement(SkipBTN, true, "Left");
            form.AddElement(FinishBTN, false, "Right");
            form.Align();

            this.Location = new Point((Screen.PrimaryScreen.Bounds.Width - this.Width) / 2, 50);
            this.Text     = "Сократите матрицы используя отношение доминирования";
        }
Esempio n. 18
0
        private bool AddLaptopsToCart()
        {
            _navPanel = new NavigationPanel(driver);
            _navPanel
            .OpenCatalogPage(wait)
            .SelectCategory(LaptopsCategoryTitle, wait);
            var lapCat       = new LaptopsCategory(driver);
            var productsList = lapCat.OpenAllLaptopsProductsList(wait);

            productsList.OpenSortPanel(wait).RbtnExpensiveCheap.Click();

            foreach (var item in _laptopsModels)
            {
                var currentProduct = productsList.GetProduct(item, wait);
                new ProductCompactView(driver, currentProduct).AddToCart(wait);
            }

            driver.PressKeyCode(AndroidKeyCode.Back);
            var cartItems = _navPanel
                            .OpenCart(wait)
                            .GetCartItems(wait);
            // _laptopsModels.Reverse();

            var matchNames = new bool[3];
            var count      = 0;

            foreach (var item in cartItems)
            {
                var currText = new CartItemView(driver, item).GetTitle(wait);
                matchNames[count] = currText.Contains(_laptopsModels[count]);
                Console.WriteLine(currText + " = " + _laptopsModels[count]);
                count++;
            }

            return(matchNames[0] && matchNames[1] && matchNames[2]);
        }
Esempio n. 19
0
 public void Test_OpenNavPane()
 {
     navPan = new NavigationPanel(driver);
     navPan.Open(wait);
     Assert.IsTrue(navPan.IsNavigationPanelOpened());
 }
Esempio n. 20
0
 public PageCollection(NavigationPanel tabPanel)
     : base()
 {
     this.tabPanel = tabPanel;
 }
Esempio n. 21
0
        private void InitializePanel(NavigationPanel panel)
        {
            if (panel != null)
            {
                Binding busyBinding = new Binding("DataContext.IsBusy");
                busyBinding.Source = panel;
                SetBinding(IsBusyProperty, busyBinding);

                panel.Load();
            }
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ((CommunityMasterPage)this.Master).DisabledSidePanel = true;

            this.Title = Resources.CommunityResource.MainPageTitle;

            if (ShowEmptyScreen())
            {
                var dashboardEmptyScreen = (DashboardEmptyScreen)Page.LoadControl(DashboardEmptyScreen.Location);

                AddContent.Controls.Add(dashboardEmptyScreen);

                return;
            }


            _widgetTabControl = new WidgetTab(new Guid("{57DAD9FA-BBB8-4a3a-B208-D3CD58691D35}"),
                                              ColumnSchemaType.Schema_25_50_25,
                                              "communityDashboard"
                                              );

            var modules = new List <ASC.Web.Core.ModuleManagement.Module>();

            foreach (var item in WebItemManager.Instance.GetSubItems(CommunityProduct.ID))
            {
                if ((item is ASC.Web.Core.ModuleManagement.Module) == false)
                {
                    continue;
                }

                var module = item as ASC.Web.Core.ModuleManagement.Module;
                modules.Add(module);


                foreach (var widget in module.Widgets)
                {
                    try
                    {
                        _widgetTabControl.WidgetCollection.Add(GetWidgetControl(module, widget));
                    }
                    catch (Exception ex)
                    {
                        //TODO: draw error control or something
                        _widgetTabControl.WidgetCollection.Add(GetBrokenWidgetControl(ex));
                    }
                }
            }

            _widgetTabControl.WidgetCollection.Add(new Widget(BirthdayReminderWidget.WidgetID,
                                                              new BirthdayReminderWidget()
            {
                ProductID = CommunityProduct.ID
            },
                                                              Resources.CommunityResource.BirthdayReminderWidgetName,
                                                              Resources.CommunityResource.BirthdayReminderWidgetDescription)
            {
                ImageURL             = WebImageSupplier.GetAbsoluteWebPath("birthday_widget.png"),
                SettingsProviderType = typeof(StudioWidgetSettingsProvider),
                UsePositionAttribute = true
            });

            _widgetTabControl.WidgetCollection.Add(new Widget(NewEmployeeWidget.WidgetID,
                                                              new NewEmployeeWidget()
            {
                ProductID = CommunityProduct.ID
            },
                                                              CustomNamingPeople.Substitute <Resources.CommunityResource>("NewEmployeeWidgetName"),
                                                              Resources.CommunityResource.NewEmployeeWidgetDescription)
            {
                ImageURL             = WebImageSupplier.GetAbsoluteWebPath("newemp_widget.png"),
                SettingsProviderType = typeof(StudioWidgetSettingsProvider),
                UsePositionAttribute = true
            });

            var widgetSettings = SettingsManager.Instance.LoadSettingsFor <ProductActivityWidgetSettings>(SecurityContext.CurrentAccount.ID);

            ProductActivity productActivityControl = (ProductActivity)LoadControl(ProductActivity.Location);

            productActivityControl.ProductId  = CommunityProduct.ID;
            productActivityControl.Activities = UserActivityManager.GetUserActivities(
                TenantProvider.CurrentTenantID, null, CommunityProduct.ID, null, UserActivityConstants.ContentActionType, null, 0, widgetSettings.CountActivities)
                                                .ConvertAll(a => new UserContentActivity(a));


            _widgetTabControl.WidgetCollection.Add(new Widget(ProductActivity.WidgetID,
                                                              productActivityControl,
                                                              Resources.CommunityResource.CommunityActivityWidgetName,
                                                              Resources.CommunityResource.CommunityActivityWidgetDescription)
            {
                ImageURL             = WebImageSupplier.GetAbsoluteWebPath("lastadded_widget.png"),
                SettingsProviderType = typeof(StudioWidgetSettingsProvider),
                Position             = new Point(0, 2),
                WidgetURL            = WhatsNew.GetUrlForModule(Product.CommunityProduct.ID, null)
            });


            WidgetsContent.Controls.Add(_widgetTabControl);

            NavigationPanel NavigationPanel = (NavigationPanel)this.LoadControl(NavigationPanel.Location);

            NavigationPanelContent.Controls.Add(NavigationPanel);

            if (SecurityContext.CurrentAccount.IsAuthenticated)
            {
                NavigationPanel.addButton(Resources.CommunityResource.BtnCustomizeWidgets, WebImageSupplier.GetAbsoluteWebPath("btn_managewidgets.png"), "javascript:communityDashboard.ShowSettings()", 3);
                if (modules.Count > 0)
                {
                    NavigationPanel.addButton(Resources.CommunityResource.BtnAddContent, WebImageSupplier.GetAbsoluteWebPath("btn_addcontent.png"), "javascript:StudioManager.ShowAddContentDialog()", 2);
                    AddContentControl AddCntnt = (AddContentControl)this.LoadControl(AddContentControl.Location);

                    foreach (var module in modules)
                    {
                        try
                        {
                            AddCntnt.Types.Add(new AddContentControl.ContentTypes {
                                Link = module.Context.GetCreateContentPageAbsoluteUrl(), Icon = (module as IWebItem).GetIconAbsoluteURL(), Label = module.Name
                            });
                        }
                        catch (Exception)
                        {
                            AddCntnt.Types.Add(new AddContentControl.ContentTypes {
                                Link = "#", Icon = string.Empty, Label = "Error loading " + module.Name
                            });
                        }
                    }


                    AddContent.Controls.Add(AddCntnt);
                }
            }
        }
Esempio n. 23
0
 private void Awake()
 {
     Instance = this;
 }
Esempio n. 24
0
 public static INavigationManager GetNavigationManager(NavigationPanel navigationPanel)
 {
     _panels.TryGetValue(navigationPanel, out INavigationManager result);
     return(result);
 }