Beispiel #1
0
        public void ChangePage(PageTypes pageType)
        {
            if (GetPage(pageType) == null)
            {
                Debug.LogError(GetType().Name + ".cs  method id : ChangePage() " + pageType);
                return;
            }

            var previousPage = currentPage;

            currentPage = GetPage(pageType);

            if (previousPage == currentPage)
            {
                return;
            }

            previousPage.Hide();
            currentPage.Show();

            if (previousPages.Count > bufferSize)   // if out buffer is more than bufferSize dump the latest one
            {
                previousPages.Pop();
            }

            previousPages.Push(previousPage);
        }
        private void SetToolBarVisible(PageTypes p_pageTypes)
        {
            //文件上传 干扰任务
            xDisturbAttachBtn.Visibility = p_pageTypes == PageTypes.Modify ? Visibility.Visible : Visibility.Collapsed;
            //删除附件 干扰任务
            //_delAttachBtn.Visibility = p_pageTypes == PageTypes.Modify ? Visibility.Visible : Visibility.Collapsed;
            //文件上传 一般任务
            xGeneralAttachBtn.Visibility = p_pageTypes == PageTypes.Modify ? Visibility.Visible : Visibility.Collapsed;
            //删除附件 一般任务
            //deletesamefile.Visibility = p_pageTypes == PageTypes.Modify ? Visibility.Visible : Visibility.Collapsed;

            if (p_pageTypes == PageTypes.Modify || p_pageTypes == PageTypes.Create)
            {
                xDisturbAttachBtn.Visibility = Visibility.Visible;
                //_delAttachBtn.Visibility = Visibility.Visible;
                xGeneralAttachBtn.Visibility = Visibility.Visible;
                //deletesamefile.Visibility = Visibility.Visible;
                _saveSp.Visibility = Visibility.Visible;
            }
            else
            {
                xDisturbAttachBtn.Visibility = Visibility.Collapsed;
                //_delAttachBtn.Visibility = Visibility.Collapsed;
                xGeneralAttachBtn.Visibility = Visibility.Collapsed;
                //deletesamefile.Visibility = Visibility.Collapsed;
                _saveSp.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #3
0
        public static void NavigateTo(PageTypes pageType, object viewmodel = null)
        {
            Page newPage = null;

            switch (pageType)
            {
            case PageTypes.Search:
                newPage = _searchPage = _searchPage ?? new SearchPage();
                break;

            case PageTypes.Favorite:
                newPage = new FavoritePage();
                break;

            case PageTypes.Checker:
                newPage = _checkerPage = _checkerPage ?? new CheckerPage();
                break;

            default:
                break;
            }
            if (newPage == null)
            {
                return;
            }

            if (viewmodel != null)
            {
                newPage.DataContext = viewmodel;
            }

            RootFrame.Navigate(newPage);
        }
Beispiel #4
0
        /// <summary>
        /// Go to the requested page type and then wait for that page to load
        /// </summary>
        /// <param name="pageType">The page to go to</param>
        public static void GoTo(PageTypes pageType)
        {
            // Uses reflection to keep generic and avoid a switch statement
            Type page = Type.GetType(PageNamespace + pageType.ToString() + "Page");

            Instance.Visit(BaseUrl + page.GetField("Url").GetValue(null));
            WaitFor(pageType);
        }
Beispiel #5
0
 public Pages()
 {
     pageNames   = new string[] { };
     excludePage = false;
     pageScale   = 99999;
     PageTypes   = new PageTypes();
     PageTypes.PropertyChanged += PageTypes_PropertyChanged;
 }
Beispiel #6
0
 private void IndexScrape(HtmlDocument doc, PageTypes webType)
 {
     this.bookList = new Dictionary <string, string>();
     Websites.HtmlIndexScraper Index = this.websites[webType] as Websites.HtmlIndexScraper;
     Index.OriginalDoc = doc;
     Index.ParseHtml();
     this.bookList = Index.Books;
 }
Beispiel #7
0
        public static string GetTitile(PageTypes pageType)
        {
            var page       = NavigationItems[pageType];
            var title      = page.Titile;
            var displayTxt = page.DisplayText;

            return((string.IsNullOrEmpty(title) ? displayTxt : title) + " | RH");
        }
Beispiel #8
0
 private void SetPage(PageTypes pageType, int unit = -1, int screen = -1)
 {
     PageFrame.LoadCompleted += this.PageFrameLoaded;
     PageToSet        = pageType;
     UnitToSet        = unit;
     ScreenToSet      = screen;
     ChangingPages    = true;
     PageFrame.Source = new Uri("Pages/BlankPage.xaml", UriKind.Relative);
 }
Beispiel #9
0
 public TabPage(string caption, PageTypes pageType, string pageUrl, string icon, bool active, string initializeFunction)
 {
     this._caption            = caption;
     this._pageUrl            = pageUrl;
     this._pageType           = pageType;
     this._icon               = icon;
     this._active             = active;
     this._initializeFunction = initializeFunction;
 }
Beispiel #10
0
        public bool DeletePageType(PageTypes pageTypeData)
        {
            ListDictionary param = new ListDictionary();

            param.Add("PageId", pageTypeData.PageId);
            int Id = DataAccess.ExecuteSPNonQuery(DataAccess.ConnectionStrings.Ansira, "DeletePageType", param);

            return(Convert.ToBoolean(Id));
        }
 public void ActivateAllPages(bool val, PageTypes exception = PageTypes.Default)
 {
     for (int i = 0; i < pageBehaviours.Count; i++)
     {
         if (pageBehaviours[i].page != null)
         {
             pageBehaviours[i].page.gameObject.SetActive(pageBehaviours[i].pageType != exception ? val : !val);
         }
     }
 }
Beispiel #12
0
 private void BookScrape(HtmlDocument doc, PageTypes webType)
 {
     Websites.HtmlBookScraper Book = this.websites[webType] as Websites.HtmlBookScraper;
     Book.OriginalDoc = doc;
     this.NextChapter = Book.GetNextChapter();
     Book.ParseHtml();
     this.BookContent        = Book.Contents;
     this.HTML               = Book.HTML;
     this.CurrentChapterName = Book.GetCurrentChapterName();
 }
Beispiel #13
0
        bool IsFeatureSupported(IGame plugin, PageTypes feature)
        {
            bool result = false;

            if ((plugin.Supports & feature) == feature)
            {
                result = true;
            }
            return(result);
        }
 public TaskDetailInfoDialog(TaskListInfo taskListInfo, PageTypes p_pageType)
 {
     InitializeComponent();
     this._currentTask = taskListInfo;
     this._pageType    = p_pageType;
     SetToolBarVisible(p_pageType);
     LoadStyleTest();
     InitData();
     LoadViewDisplay();
 }
 public PageBehaviour GetPageByType(PageTypes pageType)
 {
     for (int i = 0; i < pageBehaviours.Count; i++)
     {
         if (pageBehaviours[i].pageType == pageType)
         {
             return(pageBehaviours[i].page);
         }
     }
     return(null);
 }
Beispiel #16
0
        public static void CheckLocation(PageTypes pageType)
        {
            // Uses reflection to keep generic and avoid a switch statement
            Type       page     = Type.GetType(PageNamespace + pageType.ToString() + "Page");
            MethodInfo pageIsAt = page.GetMethod("get_IsAt");
            MethodInfo pageGoTo = page.GetMethod("GoTo");

            if (!Convert.ToBoolean(pageIsAt.Invoke(null, null)))
            {
                pageGoTo.Invoke(null, null);
            }
        }
Beispiel #17
0
        /// <summary>
        /// Sleep until we get to the requested page.
        /// Sometimes the next command happens before the page is loaded.
        /// Not typically an issue with Coypu except for certain situations, but probably
        /// useful for for the base Selenium Framework, and might as well stay consistent.
        /// </summary>
        /// <param name="pageType">The type of page to wait to be loaded</param>
        public static void WaitFor(PageTypes pageType)
        {
            // Uses reflection to keep generic and avoid a switch statement
            int        waitTime = 20;
            Type       page     = Type.GetType(PageNamespace + pageType.ToString() + "Page");
            MethodInfo pageIsAt = page.GetMethod("get_IsAt");

            while (!Convert.ToBoolean(pageIsAt.Invoke(null, null)))
            {
                Thread.Sleep(waitTime);
            }
        }
 public PageSettings GetSettings(PageTypes type)
 {
     for (int i = 0; i < settings.Count; i++)
     {
         if (settings[i].type == type)
         {
             return(settings[i]);
         }
     }
     Debug.LogError("PageSettings for this Type not found");
     return(null);
 }
Beispiel #19
0
        public bool UpdatePageType(PageTypes pageTypeData)
        {
            //List Dictionary object for parameters of Store procedure
            ListDictionary param = new ListDictionary();

            param.Add("PageId", pageTypeData.PageId);
            param.Add("PageType", pageTypeData.PageType);
            param.Add("UpdatedBy", pageTypeData.UpdateBy);
            param.Add("IsActive", pageTypeData.IsActive);
            int Id = DataAccess.ExecuteSPNonQuery(DataAccess.ConnectionStrings.Ansira, "UpdatePageType", param);

            return(Convert.ToBoolean(Id));
        }
Beispiel #20
0
        /* Function: Build
         * Builds an output file based on the passed parameters.  Using this function centralizes standard elements of the page
         * structure like the doctype, charset, and embedded comments.
         */
        public void Build(Path outputPath, string pageTitle, string pageContentHTML, PageType pageType)
        {
            string pageTypeName     = PageTypes.NameOf(pageType);
            string jsRelativePrefix = context.Target.MakeRelativeURL(outputPath, Paths.Style.OutputFolder(context.Target.OutputFolder)) + '/';

            WriteTextFile(outputPath,

                          "<!DOCTYPE html>" +
                          "\r\n\r\n" +

                          "<html>" +
                          "<head>" +

                          "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" +

                          // This turns off Internet Explorer 11's compatibility view, since we might get hit by it if "Display intranet in Compatibility View" is
                          // turned on.
                          "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">" +

                          "<title>" + pageTitle.ToHTML() + "</title>" +

                          "<link rel=\"stylesheet\" type=\"text/css\" href=\"" +
                          context.Target.MakeRelativeURL(outputPath, Paths.Style.OutputFolder(context.Target.OutputFolder) + "/main.css") +
                          "\" />" +

                          "<script type=\"text/javascript\" src=\"" + jsRelativePrefix + "main.js\"></script>" +
                          "<script type=\"text/javascript\">" +
                          "NDLoader.LoadJS(\"" + pageTypeName + "\", \"" + jsRelativePrefix + "\");" +
                          "</script>" +

                          "</head>" +

                          "\r\n\r\n" +
                          "<!-- Generated by Natural Docs, version " + Instance.VersionString + " -->" +
                          "\r\n\r\n" +

                          // The IE mark of the web.  Without it Internet Explorer will pop up messages and possibly block JavaScript
                          // from running from the local drive.  Note that it MUST have at least one \r\n after it or it won't work.
                          // Microsoft Edge doesn't need it, but if it has it, it must be set to http://localhost or else it will block pages
                          // from loading external JavaScript files, possibly because it sees it as a cross domain request.
                          "<!-- saved from url=(0016)http://localhost -->" +
                          "\r\n\r\n" +

                          "<body onload=\"NDLoader.OnLoad('" + pageTypeName + "');\" " +
                          "class=\"NDPage ND" + pageTypeName + "Page\">" +

                          pageContentHTML +

                          "</body>" +
                          "</html>");
        }
    public static string getText(this PageTypes type)
    {
        switch (type)
        {
        case PageTypes.A:
            return("0001000");

        case PageTypes.F:
            return("0002000");

        default:
            return(null);
        }
    }
Beispiel #22
0
        public Page GetPage(PageTypes pageType)
        {
            for (int i = 0; i < pages.Length; i++)
            {
                EnumObject enumObject = pages [i];
                if (( PageTypes )enumObject.enumAsInt == pageType)
                {
                    Page page = (( GameObject )enumObject._object).GetComponent <Page>();
                    return(page);
                }
            }

            return(null);
        }
Beispiel #23
0
        /// <summary>
        /// Returns a UI page based on the <see cref="PageTypes"/> enum value passed into a viewmodel
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public static Page GetApplicationPage(this PageTypes page)
        {
            switch (page)
            {
            case PageTypes.MainPage:
                return(new MainPage());

            case PageTypes.AdministrationPage:
                return(new Page());

            default:
                return(new Page());
            }
        }
Beispiel #24
0
        /// <summary>
        /// scrapes the desired data from a Page
        /// </summary>
        /// <param name="webType">Determines whether to scrape an Index or a book</param>
        /// <param name="doc">The HTML Document that will be scraped</param>
        public StartScrape(PageTypes webType, HtmlDocument doc)
        {
            this.websites = new Dictionary <PageTypes, Websites.HtmlScraper>();
            WebList();

            if (webType == PageTypes.WuxiaIndex)
            {
                IndexScrape(doc, webType);
            }
            else
            {
                BookScrape(doc, webType);
            }
        }
Beispiel #25
0
        /* Function: Build
         * Builds an output file based on the passed parameters.  Using this function centralizes standard elements of the page
         * structure like the doctype, charset, and embedded comments.
         */
        public void Build(Path outputPath, string pageTitle, string pageContentHTML, PageType pageType)
        {
            string pageTypeName     = PageTypes.NameOf(pageType);
            string jsRelativePrefix = context.Target.MakeRelativeURL(outputPath, Paths.Style.OutputFolder(context.Target.OutputFolder)) + '/';

            WriteTextFile(outputPath,

                          // We're stuck in Transitional while we use iframes, which are deprecated in Strict.  HTML5 will supposedly bring
                          // iframes back.
                          "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" +
                          "\r\n\r\n" +

                          "<html>" +
                          "<head>" +

                          "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" +

                          "<title>" + pageTitle.ToHTML() + "</title>" +

                          "<link rel=\"stylesheet\" type=\"text/css\" href=\"" +
                          context.Target.MakeRelativeURL(outputPath, Paths.Style.OutputFolder(context.Target.OutputFolder) + "/main.css") +
                          "\" />" +

                          "<script type=\"text/javascript\" src=\"" + jsRelativePrefix + "main.js\"></script>" +
                          "<script type=\"text/javascript\">" +
                          "NDLoader.LoadJS(\"" + pageTypeName + "\", \"" + jsRelativePrefix + "\");" +
                          "</script>" +

                          "</head>" +

                          "\r\n\r\n" +
                          "<!-- Generated by Natural Docs, version " + Instance.VersionString + " -->" +
                          "\r\n\r\n" +

                          // The IE mark of the web.  Without it Internet Explorer will pop up messages and possibly block JavaScript
                          // from running from the local drive.  Note that it MUST have at least one \r\n after it or it won't work.
                          // Microsoft Edge doesn't need it, but if it has it, it must be set to http://localhost or else it will block pages
                          // from loading external JavaScript files, possibly because it sees it as a cross domain request.
                          "<!-- saved from url=(0016)http://localhost -->" +
                          "\r\n\r\n" +

                          "<body onload=\"NDLoader.OnLoad('" + pageTypeName + "');\" " +
                          "class=\"NDPage ND" + pageTypeName + "Page\">" +

                          pageContentHTML +

                          "</body>" +
                          "</html>");
        }
Beispiel #26
0
        // allocate a new node from free list or from pager
        private BTreeNode GetNewNode(PageTypes nodeType)
        {
            // allocate
            MemoryPage newPage = _freeList.AllocatePage();

            if (newPage == null)
            {
                newPage = _pager.GetNewPage();
            }

            // initialize node
            BTreeNode node = new BTreeNode(newPage, nodeType);

            return(node);
        }
        private void AssertExistence(string LookupName, PageTypes type)
        {
            //Check if specified page exists as the given type
            string str = "d=exist(" + LookupName + ")";
            double d   = -1.0f;

            if (oApp.Execute(str, null))
            {
                d = oApp.get_LTVar("d");
            }
            if (d != (double)type)
            {
                throw new Exception("Worksheet of name : " + LookupName + " and of type " + type.ToString() + " does not exist");
            }
        }
Beispiel #28
0
        public Page RequestPage(PageTypes type)
        {
            switch (type)
            {
            case PageTypes.TagPage:
                if (TagPage == null)
                {
                    return(createNewPage(PageTypes.TagPage));
                }
                else
                {
                    return(TagPage);
                }

            case PageTypes.ReviewPage:
                if (ReviewPage == null)
                {
                    return(createNewPage(PageTypes.ReviewPage));
                }
                else
                {
                    return(ReviewPage);
                }

            case PageTypes.SortPage:
                if (SortPage == null)
                {
                    return(createNewPage(PageTypes.SortPage));
                }
                else
                {
                    return(SortPage);
                }

            case PageTypes.StatPage:
                if (StatPage == null)
                {
                    return(createNewPage(PageTypes.StatPage));
                }
                else
                {
                    return(StatPage);
                }
            }

            return(null);
        }
Beispiel #29
0
        /// <summary>
        /// Creates PageTypes for records In the prefilled DataReader, And puts them into a HashTable
        /// </summary>
        /// <param name="dr">The DataReader prefilled With the PageTypes records</param>
        /// <returns>The Hashtable containing PageTypes objects And their ID As key.</returns>
        protected static Hashtable ConvertReaderToHashTable(SqlDataReader dr)
        {
            Hashtable result = new Hashtable();

            while (dr.Read())
            {
                PageTypes myPageTypes = new PageTypes();

                myPageTypes.m_intPageTypeID  = dr.GetSqlInt32(0);
                myPageTypes.m_strDescription = dr.GetSqlString(1);
                myPageTypes.m_strCode        = dr.GetSqlString(2);

                result.Add(myPageTypes.PageTypeID, myPageTypes);
            }

            return(result);
        }
        private static TagBuilder SetTagPage(PageTypes t, IPaginatedList list, Func <int, string> generatePageUrl)
        {
            int  pageNo   = 0;
            bool disabled = false;
            var  link     = new TagBuilder("a");

            link.AddCssClass("page-link");

            if (t == PageTypes.First)
            {
                pageNo = 1;
                link.InnerHtml.SetHtmlContent("<i class=\"fas fa-angle-double-left\"></i>");
                disabled = list.PageIndex == 1;
            }
            else if (t == PageTypes.Previous)
            {
                pageNo = list.HasPreviousPage ? list.PageIndex - 1 : 1;
                link.InnerHtml.SetHtmlContent("<i class=\"fas fa-angle-left\"></i>");
                disabled = list.PageIndex == 1;
            }
            else if (t == PageTypes.Next)
            {
                pageNo = list.HasNextPage ? list.PageIndex + 1 : list.TotalPages;
                link.InnerHtml.SetHtmlContent("<i class=\"fas fa-angle-right\"></i>");
                disabled = list.PageIndex == list.TotalPages;
            }
            else if (t == PageTypes.Last)
            {
                pageNo = list.TotalPages;
                link.InnerHtml.SetHtmlContent("<i class=\"fas fa-angle-double-right\"></i>");
                disabled = list.PageIndex == list.TotalPages;
            }
            else if (t == PageTypes.Ellipsis)
            {
                link.InnerHtml.SetHtmlContent("<i class=\"fas fa-ellipsis-h\"></i>");
                disabled = true;
            }

            if (pageNo > 0)
            {
                link.MergeAttribute("href", generatePageUrl(pageNo)); // url + "&pageNumber=" + pageNo);
            }

            return(SetTagWrapper(link, (disabled ? "page-item disabled" : "page-item")));
        }
Beispiel #31
0
 public static string PageUrl(int id, PageTypes type)
 {
     return Root + type.ToString() + "/" + id;
 }
Beispiel #32
0
 public static string GetTitile(PageTypes pageType)
 {
     var page = NavigationItems[pageType];
     var title = page.Titile;
     var displayTxt = page.DisplayText;
     return (string.IsNullOrEmpty(title) ? displayTxt : title) + " | NIT Calicut Alumni";
 }
Beispiel #33
0
 private static MyTreeViewItem GetMyTreeView(string text, string imagePath, PageTypes page, int unitNumber = -1,
                                             int screenNumber = -1)
 {
     var item = new MyTreeViewItem
     {
         Page = page,
         UnitNumber = unitNumber,
         ScreenNumber = screenNumber,
         IsExpanded = false
     };
     // create stack panel
     var stack = new StackPanel { Orientation = Orientation.Horizontal };
     // create Image
     var image = new Image
     {
         Source = new BitmapImage(new Uri("/iRduino;component/Resources/" + imagePath, UriKind.Relative))
     };
     // Label
     var lbl = new Label { Content = text };
     image.Margin = new Thickness(4,0,0,0);
     lbl.Margin = new Thickness(0);
     lbl.VerticalAlignment = VerticalAlignment.Center;
     stack.Margin = new Thickness(0);
     // Add into stack
     stack.Children.Add(image);
     stack.Children.Add(lbl);
     // assign stack to header
     item.Header = stack;
     if (page != PageTypes.Configuration)
     {
         item.Margin = new Thickness(-10, 0, 0, 0);
     }
     return item;
 }
Beispiel #34
0
 private void SetPage2(PageTypes pageType, int unit = -1, int screen = -1)
 {
     switch (pageType)
     {
         case PageTypes.Configuration:
             PageFrame.Source = new Uri("Pages/ConfigurationPage.xaml", UriKind.Relative);
             break;
         case PageTypes.CurrentConfiguration:
             this.configurationOptions.Dictionarys = this.hostApp.DisplayMngr.Dictionarys;
             PageFrame.DataContext = this.configurationOptions;
             PageFrame.Source = new Uri("Pages/CurrentConfiguration.xaml", UriKind.Relative);
             break;
         case PageTypes.AdvancedOptions:
             PageFrame.DataContext = this.configurationOptions;
             PageFrame.Source = new Uri("Pages/AdvancedOptions.xaml", UriKind.Relative);
             break;
         case PageTypes.TMUnits:
             this.configurationOptions.Dictionarys = this.hostApp.DisplayMngr.Dictionarys;
             PageFrame.DataContext = this.configurationOptions;
             PageFrame.Source = new Uri("Pages/TMUnits.xaml", UriKind.Relative);
             break;
         case PageTypes.Unit:
             this.configurationOptions.DisplayUnitConfigurations[unit].HostApp = this.hostApp;
             this.configurationOptions.DisplayUnitConfigurations[unit].UnitNumber = unit;
             PageFrame.DataContext = this.configurationOptions.DisplayUnitConfigurations[unit];
             PageFrame.Source = new Uri("Pages/UnitPage.xaml", UriKind.Relative);
             this.currentUnit = unit;
             break;
         case PageTypes.Buttons:
             this.configurationOptions.DisplayUnitConfigurations[unit].HostApp = this.hostApp;
             this.configurationOptions.DisplayUnitConfigurations[unit].TotalUnits =
                 this.configurationOptions.NumberDisplays;
             PageFrame.DataContext = this.configurationOptions.DisplayUnitConfigurations[unit];
             PageFrame.Source = new Uri("Pages/ButtonsPage.xaml", UriKind.Relative);
             this.currentUnit = unit;
             break;
         case PageTypes.LEDs:
             this.configurationOptions.DisplayUnitConfigurations[unit].HostApp = this.hostApp;
             this.configurationOptions.DisplayUnitConfigurations[unit].NumScreens =
                 this.configurationOptions.DisplayUnitConfigurations[unit].Screens.Count - 1;
             PageFrame.DataContext = this.configurationOptions.DisplayUnitConfigurations[unit];
             PageFrame.Source = new Uri("Pages/LEDsPage.xaml", UriKind.Relative);
             this.currentUnit = unit;
             break;
         case PageTypes.Screen:
             this.configurationOptions.DisplayUnitConfigurations[unit].HostApp = this.hostApp;
             this.configurationOptions.DisplayUnitConfigurations[unit].ScreenToEdit = screen;
             PageFrame.DataContext = this.configurationOptions.DisplayUnitConfigurations[unit];
             PageFrame.Source = new Uri("Pages/ScreenPage.xaml", UriKind.Relative);
             this.currentUnit = unit;
             break;
         case PageTypes.TM1640Screen:
             this.configurationOptions.DisplayUnitConfigurations[unit].HostApp = this.hostApp;
             this.configurationOptions.DisplayUnitConfigurations[unit].ScreenToEdit = screen;
             PageFrame.DataContext = this.configurationOptions.DisplayUnitConfigurations[unit];
             PageFrame.Source = new Uri("Pages/TM1640ScreenPage.xaml", UriKind.Relative);
             this.currentUnit = unit;
             break;
         case PageTypes.JoystickButtons:
             this.configurationOptions.Dictionarys = this.hostApp.DisplayMngr.Dictionarys;
             this.configurationOptions.EditNumber = unit;
             PageFrame.DataContext = this.configurationOptions;
             PageFrame.Source = new Uri("Pages/JoystickButtonsPage.xaml", UriKind.Relative);
             break;
         case PageTypes.Arduino:
             PageFrame.DataContext = this.configurationOptions;
             PageFrame.Source = new Uri("Pages/Arduino.xaml", UriKind.Relative);
             break;
         case PageTypes.FergoTech:
             PageFrame.DataContext = this.configurationOptions;
             PageFrame.Source = new Uri("Pages/FergoTech.xaml", UriKind.Relative);
             break;
         case PageTypes.DigitalInputs:
             PageFrame.Source = new Uri("Pages/DigitalInputs.xaml", UriKind.Relative);
             break;
         case PageTypes.DigitalOutputs:
             PageFrame.Source = new Uri("Pages/DigitalOutputs.xaml", UriKind.Relative);
             break;
         case PageTypes.Expander:
             PageFrame.Source = new Uri("Pages/Expander.xaml", UriKind.Relative);
             break;
         case PageTypes.Blank:
             PageFrame.Source = new Uri("Pages/BlankPage.xaml", UriKind.Relative);
             break;
         case PageTypes.None:
             break;
         default:
             throw new ArgumentOutOfRangeException("pageType");
     }
     ChangingPages = false;
 }
Beispiel #35
0
 private void SetPage(PageTypes pageType, int unit = -1, int screen = -1)
 {
     PageFrame.LoadCompleted += this.PageFrameLoaded;
     PageToSet = pageType;
     UnitToSet = unit;
     ScreenToSet = screen;
     ChangingPages = true;
     PageFrame.Source = new Uri("Pages/BlankPage.xaml", UriKind.Relative);
 }
Beispiel #36
0
		public static string PageUrl(PageTypes pageType, string pageName, params object[] Params)
		{
			string filter = "/pages";
			if (pageType.Equals(PageTypes.Admin))
				filter = "/admin";
			else if (pageType.Equals(PageTypes.Blank))
				filter = "/popup";

			filter += "/" + pageName.ToLower();

			string par = "";
			if (Params != null)
			{
				ArrayList keys = new ArrayList();
				for (int i = 0; i < Params.Length - 1; i = i + 2)
				{
					if (Params[i] != null && Params[i + 1] != null)
					{
						if (!keys.Contains(Params[i]))
						{
							if (Params[i + 1].ToString().Length > 0)
								par += "/" + Cambro.Web.Helpers.UrlTextSerialize(Params[i].ToString()) + "-" + Cambro.Web.Helpers.UrlTextSerialize(Params[i + 1].ToString());
							else
								par += "/" + Cambro.Web.Helpers.UrlTextSerialize(Params[i].ToString());
							keys.Add(Params[i]);
						}
					}
				}
			}

			return filter + par;

		}