Exemple #1
0
        void RegisterAppLinks()
        {
            if (!AppLinkHelpers.IsDeepLinkingSupported)
            {
                return;
            }

            var listViewPageLink = AppLinkHelpers.CreateAppLink("List View Page", "Open the List View Page", DeepLinkingIdConstants.ListPageId, "icon");

            AppLinks.RegisterLink(listViewPageLink);
        }
Exemple #2
0
        protected override void OnStart()
        {
            int majorVersion, minorVersion;

            if (Device.OS == TargetPlatform.iOS)
            {
                majorVersion = 9;
                minorVersion = 0;
            }
            else
            {
                majorVersion = 4;
                minorVersion = 2;
            }

            if (DependencyService.Get <IEnvironment>().IsOperatingSystemSupported(majorVersion, minorVersion))
            {
                var listViewPageLink = Extensions.CreateAppLink("List View Page", "Open the List View Page", DeepLinkingIdConstants.ListViewPageId, "icon");
                AppLinks.RegisterLink(listViewPageLink);
            }
        }
Exemple #3
0
        public static void AppLinksLogger(AppLinks appLinks, string action, string screenName, string UserId)
        {
            string fullFilePath = GetFilePath(screenName);

            try
            {
                if (!File.Exists(fullFilePath))
                {
                    FileStream file = File.Create(fullFilePath);
                    file.Close();
                }

                using (StreamWriter writer = File.AppendText(fullFilePath))
                {
                    PrintDefaultText(writer, fullFilePath, action, screenName, UserId);

                    writer.WriteLine("AppLinkId: " + appLinks.AppLinkId);
                    writer.WriteLine("AppEnvironmentId: " + appLinks.AppEnvironmentId);
                    writer.WriteLine("AppEnvironmentName: " + appLinks.AppEnvironmentName);
                    writer.WriteLine("AppCategoryId: " + appLinks.AppCategoryId);
                    writer.WriteLine("ApplicationId: " + appLinks.ApplicationId);
                    writer.WriteLine("ApplicationNodeId: " + appLinks.ApplicationNodeId);
                    writer.WriteLine("AppNodeName: " + appLinks.AppNodeName);
                    writer.WriteLine("CountryId: " + appLinks.CountryId);
                    writer.WriteLine("Description: " + appLinks.Description);
                    writer.WriteLine("Link: " + appLinks.Link);
                    writer.WriteLine("CredentialId: " + appLinks.CredentialId);
                    writer.WriteLine("Username: "******"-------------------------------------------------------------------------------");
                    writer.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private async void GoBtn_Click(object sender, RoutedEventArgs e)
        {
            LaunchLinkResult a = await AppLinks.LaunchLinkAsync(new Uri(AppUriTxt.Text, UriKind.Absolute), new Uri(WebUriTxt.Text, UriKind.Absolute));

            StatusTxt.Text = $"Launcher: {a.LinkLaunchedBy}, IsLinkLaunched: {a.IsLinkLaunched}";
        }
Exemple #5
0
        public frmAddOrUpdateAppLinks(AppLinks appLinks)
        {
            InitializeComponent();

            GlobalLinkId = appLinks.AppLinkId;

            #region "Loading Credentials"

            dtCredentials.Columns.Add("CredentialId", typeof(int));
            dtCredentials.Columns.Add("CredentialDescription", typeof(string));
            dtCredentials.Columns.Add("Username", typeof(string));
            dtCredentials.Columns.Add("Password", typeof(string));
            dtCredentials.Columns.Add("StringToSearch", typeof(string));

            #endregion

            countryList  = DALHelpers.GetCountries();
            appList      = DALHelpers.GetApplications();
            categoryList = DALHelpers.GetCategories();

            StyleApplicationButtons();

            this.Size = new Size(536, 466);
            grpCredential.Location = new Point(12, 12);

            if (GlobalLinkId > 0)
            {
                txtDescription.Text = appLinks.Description;
                txtURL.Text         = appLinks.Link;

                int counter = 0;

                foreach (Country country in countryList)
                {
                    cmbCountry.Items.Add(country.CountryName.ToString());

                    if (appLinks.CountryId == country.CountryId)
                    {
                        cmbCountry.SelectedIndex = counter;
                    }

                    counter++;
                }

                counter = 0;
                foreach (App app in appList)
                {
                    cmbApplication.Items.Add(app.ApplicationName.ToString());

                    if (appLinks.ApplicationId == app.ApplicationId)
                    {
                        cmbApplication.SelectedIndex = counter;
                    }

                    counter++;
                }

                counter = 0;
                foreach (Category category in categoryList)
                {
                    cmbCategory.Items.Add(category.CategoryName.ToString());

                    if (appLinks.AppCategoryId == category.CategoryId)
                    {
                        cmbCategory.SelectedIndex = counter;
                    }

                    counter++;
                }

                credentialList = loadCredentials();

                counter = 0;
                foreach (Credential credential in credentialList)
                {
                    if (appLinks.CredentialId == credential.CredentialId)
                    {
                        CredentialId             = credential.CredentialId;
                        txtCredentialId.Text     = credential.Username;
                        btnRemoveCredential.Text = "Remove Credential";
                    }
                }
                dgvCredentials.ClearSelection();
            }
            else
            {
                foreach (Country country in countryList)
                {
                    cmbCountry.Items.Add(country.CountryName.ToString());
                }

                foreach (App app in appList)
                {
                    cmbApplication.Items.Add(app.ApplicationName.ToString());
                }

                foreach (Category category in categoryList)
                {
                    cmbCategory.Items.Add(category.CategoryName.ToString());
                }

                credentialList = loadCredentials();
                dgvCredentials.ClearSelection();
            }

            if (btnRemoveCredential.Text == "Select Credential")
            {
                pictureBox1.Visible = false;
            }
            else
            {
                pictureBox1.Visible = true;
            }
        }
Exemple #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            hasTheSaveButtonPressed = true;

            bool ok = false;

            AppLinks appLinks = new AppLinks();

            if (Validation.AppLinkDataValidation(cmbCountry.Text, cmbApplication.Text, cmbCategory.Text, txtDescription.Text, txtURL.Text))
            {
                MessageBox.Show("Please enter the AppLink details.");
                return;
            }
            else
            {
                appLinks.Description = txtDescription.Text;
                appLinks.Link        = txtURL.Text;

                if (txtCredentialId.Text == "")
                {
                    appLinks.CredentialId = 0;
                }
                else
                {
                    appLinks.CredentialId = CredentialId;
                }

                foreach (Country country in countryList)
                {
                    if (cmbCountry.Text == country.CountryName)
                    {
                        appLinks.CountryId = country.CountryId;
                    }
                }

                foreach (App app in appList)
                {
                    if (cmbApplication.Text == app.ApplicationName)
                    {
                        appLinks.ApplicationId = app.ApplicationId;
                    }
                }

                foreach (Category category in categoryList)
                {
                    if (cmbCategory.Text == category.CategoryName)
                    {
                        appLinks.AppCategoryId = category.CategoryId;
                    }
                }
            }

            #region "UPDATE"

            //UPDATE
            if (GlobalLinkId > 0)
            {
                appLinks.AppLinkId = GlobalLinkId;

                ok = DALHelpers.UpdateAppLink(appLinks);

                if (ok == true)
                {
                    MessageBox.Show("The record was successfully saved!");
                }
                else
                {
                    MessageBox.Show("Error: An error has ocurred when trying to update the App Link!");
                }

                this.Close();
            }

            #endregion

            #region "NEW"

            else
            {
                //NEW
                ok = DALHelpers.AddAppLink(appLinks);

                if (ok == true)
                {
                    MessageBox.Show("The record was successfully saved!");
                }
                else
                {
                    MessageBox.Show("Error: An error has ocurred when trying to add a new App Link!");
                }

                this.Close();
            }

            #endregion
        }
Exemple #7
0
        void RegisterAppLinks()
        {
            var listViewPageLink = AppLinkHelpers.CreateAppLink("List View Page", "Open the List View Page", DeepLinkingIdConstants.ListPageId, "icon");

            AppLinks.RegisterLink(listViewPageLink);
        }