public static void init(pageBase pb) { if (myClient == null) { try { if ((Boolean)Application.Current.Properties["SPOnline.isSelected"] == true) { mode = HMS.SP.SPMode.SPOnline; } if ((Boolean)Application.Current.Properties["SP2010.isSelected"] == true) { mode = HMS.SP.SPMode.SP2010; } if ((Boolean)Application.Current.Properties["SP2016.isSelected"] == true) { mode = HMS.SP.SPMode.SP2016; } } catch (Exception) { } if (mode == HMS.SP.SPMode.SPOnline) { string baseurl = "https://DOMAIN.sharepoint.com/"; string userName = "******"; string password = "******"; if (Application.Current.Properties.ContainsKey("SPOnline.server")) { baseurl = Application.Current.Properties["SPOnline.server"].ToString(); } if (Application.Current.Properties.ContainsKey("SPOnline.user")) { userName = Application.Current.Properties["SPOnline.user"].ToString(); } if (Application.Current.Properties.ContainsKey("SPOnline.password")) { password = Application.Current.Properties["SPOnline.password"].ToString(); } // myClient = NETClient.SPOnline(baseurl, userName, password); myClient = new HMS.Auth.LoginSPO(baseurl, userName, password); spEndpoints = new HMS.SP.SPEndpoints.SPOnline(); } else if (mode == HMS.SP.SPMode.SP2010) { string baseurl = "http://win2008r2:12345/cm/";// this is an Intranet URL string domain = "DOMAIN"; string userName = "******"; string password = "******"; if (Application.Current.Properties.ContainsKey("SP2010.server")) { baseurl = Application.Current.Properties["SP2010.server"].ToString(); } if (Application.Current.Properties.ContainsKey("SP2010.domain")) { domain = Application.Current.Properties["SP2010.domain"].ToString(); } if (Application.Current.Properties.ContainsKey("SP2010.user")) { userName = Application.Current.Properties["SP2010.user"].ToString(); } if (Application.Current.Properties.ContainsKey("SP2010.password")) { password = Application.Current.Properties["SP2010.password"].ToString(); } // myClient = NETClient.SP2010(baseurl, domain, userName, password); myClient = new HMS.Auth.LoginNTLM(baseurl, domain, userName, password); spEndpoints = new HMS.SP.SPEndpoints.SP2010(); } else if (mode == HMS.SP.SPMode.SP2016) { string baseurl = "http://hmsspx/";// this is an Intranet URL string domain = "DOMAIN"; string userName = "******"; string password = "******"; if (Application.Current.Properties.ContainsKey("SP2016.server")) { baseurl = Application.Current.Properties["SP2016.server"].ToString(); } if (Application.Current.Properties.ContainsKey("SP2016.domain")) { domain = Application.Current.Properties["SP2016.domain"].ToString(); } if (Application.Current.Properties.ContainsKey("SP2016.user")) { userName = Application.Current.Properties["SP2016.user"].ToString(); } if (Application.Current.Properties.ContainsKey("SP2016.password")) { password = Application.Current.Properties["SP2016.password"].ToString(); } // myClient = NETClient.SP2016( baseurl, domain, userName, password); myClient = new HMS.Auth.LoginNTLM(baseurl, domain, userName, password); spEndpoints = new HMS.SP.SPEndpoints.SP2016(); } else { throw new Exception("not implemented"); } } myClient.showProgress = pb.showProgress; myClient.setPlatform(spglb.platform); }