Exemplo n.º 1
0
        /// <summary>
        /// Constructor for the default logic behind all Shepherds.
        /// </summary>
        /// <param name="AYamlFile">Full path to the Shepherd's YAML Definition file.</param>
        /// <param name="APetraShepherdForm"></param>
        public TPetraShepherdFormLogic(string AYamlFile, IPetraShepherdConcreteFormInterface APetraShepherdForm)
        {
            TLogging.Log(
                "Entering TPetraShepherdFormLogic Constructor. AYamlFile = " + AYamlFile + "; APetraShepherdForm = " +
                APetraShepherdForm.ToString() +
                "...");

            FForm = APetraShepherdForm;

            //// Take AYamlFile and parse it into an XmlNode structure

            ParseYAMLFileElements(AYamlFile);

            FShepherdPages = new TPetraShepherdPagesList(AYamlFile);

            SwitchToStartPage();

            TLogging.Log("The TPetraShepherdFormLogic constructor has switched to the first page.");

            // Iterate over all FPetraShepherdPages and add the VisibleOrEnabledChangedEventHandler

            //// FShepherdPages needs to get added an auto-generated TPetraShepherdFinishPage
            //// for the Finish Page (that is not specified in the YAML file!)
            //// Note: That Finish Page (and only this) will have IsLastPage = true!!!


            TLogging.Log(
                "TPetraShepherdFormLogic Constructor ran and returned to the TPetraShepherdFormLogic constructor in PetraShepherdConcreteForm.");
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="AShepherdPages">TODO</param>
        /// <param name="APanelCollapsible">TODO</param>
        public TShepherdNavigationHelper(TPetraShepherdPagesList AShepherdPages, Panel APanelCollapsible)
        {
            TLogging.Log("Entering TShepherdNavigationHelper Constructor...");

            //// TODO

            TLogging.Log("TShepherdNavigationHelper Constructor ran.");
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="AShepherdPages">TODO</param>
        /// <param name="APanelCollapsible">TODO</param>
        public TShepherdNavigationHelper(TPetraShepherdPagesList AShepherdPages, Panel APanelCollapsible)
        {
            TLogging.Log("Entering TShepherdNavigationHelper Constructor...");

            //// TODO

            TLogging.Log("TShepherdNavigationHelper Constructor ran.");
        }
Exemplo n.º 4
0
        public void TestTPetraShepherdPagesListConstructor()
        {
            TPetraShepherdPagesList testPetraShepherdPagesList =
                new TPetraShepherdPagesList(FTestShepherdYAMLFile);

            Assert.True(testPetraShepherdPagesList.Pages.Count == 4,
                "Wrong shepherd page count; expected: " + testPetraShepherdPagesList.Pages.Count);

            Assert.True(testPetraShepherdPagesList.Pages.ContainsKey("5"),
                "Shepherd did not contain key 5");
            Assert.True(testPetraShepherdPagesList.Pages.ContainsKey("56"),
                "Shepherd did not contain key 56");
            Assert.True(testPetraShepherdPagesList.Pages.ContainsKey("12"),
                "Shepherd did not contain key 12");

            Assert.False(testPetraShepherdPagesList.Pages.ContainsKey("123"),
                "Shepherd inadvertently contained key 123");
            Assert.False(testPetraShepherdPagesList.Pages.ContainsKey("1532"),
                "Shepherd inadvertently contained key 1532");
            Assert.False(testPetraShepherdPagesList.Pages.ContainsKey("00"),
                "Shepherd inadvertently contained key 00");

            foreach (KeyValuePair <string, TPetraShepherdPage>pair in testPetraShepherdPagesList.Pages)
            {
                switch (pair.Key)
                {
                    case "5":
                        Assert.AreEqual(pair.Value.ID, "5", "The shepherd page 5 did not have the key 5");
                        Assert.AreEqual(pair.Value.Title, "Personnel Shepherd",
                        "The shepherd page 5 did not have the name Personnel Shepherd");
                        Assert.AreEqual(pair.Value.Note, "This is a test, this is only a test.",
                        "The note did not match: This is a test, this ois only a test.");
                        Assert.True(pair.Value.Visible, "The page was not visible.");
                        Assert.True(pair.Value.Enabled, "The page was not enabled");
                        Assert.AreEqual(pair.Value.UserControlNamespace, "Ict.Petra.Client.MPartner.Gui",
                        "The namespace was not: Ict.Petra.Client.MPartner.Gui");
                        Assert.AreEqual(pair.Value.UserControlClassName, "TUC_PartnerDetails_Church",
                        "The user control class name was not: TUC_PartnerDetails_Church");
                        Assert.AreEqual(pair.Value.HelpContext, "HELPME!!!", "The help context was not: HELPME!!!");
                        break;
                }
            }
        }
        /// <summary>
        /// Constructor for the default logic behind all Shepherds.
        /// </summary>
        /// <param name="AYamlFile">Full path to the Shepherd's YAML Definition file.</param>
        /// <param name="APetraShepherdForm"></param>
        public TPetraShepherdFormLogic(string AYamlFile, IPetraShepherdConcreteFormInterface APetraShepherdForm)
        {
            TLogging.Log(
                "Entering TPetraShepherdFormLogic Constructor. AYamlFile = " + AYamlFile + "; APetraShepherdForm = " +
                APetraShepherdForm.ToString() +
                "...");

            FForm = APetraShepherdForm;

            //// Take AYamlFile and parse it into an XmlNode structure

            ParseYAMLFileElements(AYamlFile);

            FShepherdPages = new TPetraShepherdPagesList(AYamlFile);

            SwitchToStartPage();

            TLogging.Log("The TPetraShepherdFormLogic constructor has switched to the first page.");

            // Iterate over all FPetraShepherdPages and add the VisibleOrEnabledChangedEventHandler

            //// FShepherdPages needs to get added an auto-generated TPetraShepherdFinishPage
            //// for the Finish Page (that is not specified in the YAML file!)
            //// Note: That Finish Page (and only this) will have IsLastPage = true!!!


            TLogging.Log(
                "TPetraShepherdFormLogic Constructor ran and returned to the TPetraShepherdFormLogic constructor in PetraShepherdConcreteForm.");
        }