示例#1
0
 public void AddServer(ServerSetting server)
 {
     if (!String.IsNullOrWhiteSpace(server.ServerName) && !String.IsNullOrWhiteSpace(server.ServerHost))
     {
         ServerSetting old = ServerList.FirstOrDefault(item => item.ServerHost.Equals(server.ServerHost, StringComparison.CurrentCultureIgnoreCase));
         if (old != null)
         {
             old.ServerHost = server.ServerHost;
         }
         else
         {
             ServerList.Add(server);
         }
         SaveConfig();
     }
 }
        private void addCustomHostBtn_Click(object sender, RoutedEventArgs e)
        {
            string hname = hostName.Text;
            string haddress = hostAddress.Text;
            ServerSetting server = new ServerSetting()
                {
                    ServerHost = haddress,
                    ServerName = hname
                };
            SalesforceApplication.ServerConfiguration.AddServer(server);

            ServerFlyout.ShowAt(applicationTitle);
        }
 private void StartLoginFlow(ServerSetting server)
 {
     if (server != null)
     {
         VisualStateManager.GoToState(this, LoggingUserInViewState, true);
         SDKManager.ResetClientManager();
         SalesforceConfig config = SDKManager.ServerConfiguration;
         var options = new LoginOptions(server.ServerHost, config.ClientId, config.CallbackUrl, config.Scopes);
         SalesforceConfig.LoginOptions = new LoginOptions(server.ServerHost, config.ClientId, config.CallbackUrl,
             config.Scopes);
         StartLoginFlow(options);
     }
 }
        private void addCustomHostBtn_Click(object sender, RoutedEventArgs e)
        {
            string hname = HostName.Text;
            string haddress = HostAddress.Text;
            if (String.IsNullOrWhiteSpace(haddress))
            {
                return;
            }
            if (String.IsNullOrWhiteSpace(hname))
            {
                hname = haddress;
            }
            var server = new ServerSetting
            {
                ServerHost = haddress,
                ServerName = hname
            };
            SDKManager.ServerConfiguration.AddServer(server);

            TryShowFlyout(ServerFlyout, ApplicationTitle);
        }
示例#5
0
 public virtual bool GetUseTwoParamAuthAsyncMethodForServer(ServerSetting server)
 {
     return(false);
 }
示例#6
0
 public virtual WebAuthenticationOptions GetOptionsForServer(ServerSetting server)
 {
     return(WebAuthenticationOptions.None);
 }
示例#7
0
 public virtual string GetCallbackUrlForServer(ServerSetting server)
 {
     return(string.Empty);
 }
示例#8
0
 public virtual string GetClientIdForServer(ServerSetting server)
 {
     return(string.Empty);
 }