00001 /* ---------------------------------------------------------------------------- 00002 * Microsoft Corporation 00003 * ---------------------------------------------------------------------------- 00004 * Microsoft Project Server mpFx (mpFx) 00005 * ---------------------------------------------------------------------------- 00006 * Author: Colby Africa 00007 * ---------------------------------------------------------------------------- 00008 * License: http://code.msdn.microsoft.com/mpFx/Project/License.aspx 00009 * ---------------------------------------------------------------------------- 00010 */ 00011 00012 namespace ImpersonationTestHarness 00013 { 00014 internal class Program 00015 { 00016 private static void Main(string[] args) 00017 { 00018 //const string userAccount = @"EPM2007DEMO\colby.africa"; 00019 00020 //using (var projectServer = new ProjectServer("http://epm2007demo/pwa", 00021 // "http://epm2007demo:56737/ProjectServer_SSP", 00022 // DataStoreEnum.PublishedStore)) 00023 //{ 00024 // bool isWindowsUser = !userAccount.Contains("aspnetsqlmembershipprovider"); 00025 00026 // ResourceDataSet.ResourcesRow resource = projectServer.Resources.GetResourceGuidByAccount(userAccount); 00027 00028 // if (resource != null) 00029 // { 00030 // StatusingProxy.SetImpersonationContext(isWindowsUser, 00031 // userAccount, 00032 // resource.RES_UID, 00033 // Guid.NewGuid(), 00034 // projectServer.SiteID, 00035 // "1033"); 00036 00037 // try 00038 // { 00039 // int taskCount = projectServer.Proxies.Statusing.GetNewTaskCount(); 00040 // Console.WriteLine(taskCount); 00041 // } 00042 // catch (SoapException exception) 00043 // { 00044 // Debug.WriteLine(Errors.ProcessMSProjectErrors(exception)); 00045 // throw; 00046 // } 00047 00048 // //projectServer.Proxies.Statusing.UpdateStatus(string.Empty); 00049 // } 00050 //} 00051 } 00052 } 00053 }
1.5.8