Show
Ignore:
Timestamp:
06/03/08 15:50:30 (2 years ago)
Author:
jnorman
Message:

Code cleanup on c# launcher

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/digitalme/launchers/csharp/Novell.IdentityModel.Selectors/DigitalMeSelector.cs

    r1892 r1900  
    1010    public class DigitalMeSelector 
    1111    { 
    12  
    1312        private static string DM_TEST_ARG_STR = "--test"; 
    1413        private static string DM_GET_TOKEN_ARG_STR = "--gettoken "; 
     
    5958        } 
    6059 
    61         public static void GetToken(String sRelyingParty, 
     60        public static byte[] GetToken(String sRelyingParty, 
    6261                                    String[] saRequiredClaims, 
    6362                                    String[] saOptionalClaims, 
    6463                                    String sTokenType) 
    6564        { 
    66             Console.WriteLine("Looking for DigitalMe"); 
    6765            String sExePath = GetExePath(); 
    6866            if (null != sExePath) 
     
    116114                File.Delete(sTempFileName); 
    117115 
    118                 Console.WriteLine("Token: " + System.Text.Encoding.ASCII.GetString(baToken)); 
     116                DbgLog("Token: " + System.Text.Encoding.ASCII.GetString(baToken)); 
     117                return baToken; 
    119118            } 
    120119            else 
    121120            { 
    122                 Console.WriteLine("DigitalMe application not found"); 
    123             } 
     121                DbgLog("DigitalMe application not found"); 
     122            } 
     123            return null; 
    124124        } 
    125125 
    126126        private static void LaunchSelector(String sExePath, StringBuilder sbArgs) 
    127127        { 
    128  
    129128            try 
    130129            { 
     
    133132                StreamReader myStreamReader = null; 
    134133 
    135  
    136134                myProcess = new Process(); 
    137135                ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(sExePath); 
     
    140138                { 
    141139                    myProcessStartInfo.Arguments = sbArgs.ToString(); 
    142                     Console.WriteLine("Args: {0}", myProcessStartInfo.Arguments); 
     140                    DbgLog("Args:" + myProcessStartInfo.Arguments); 
    143141                } 
    144142 
     
    173171 
    174172 
    175             Console.WriteLine("Platform: {0}", platform); 
    176             Console.WriteLine("OSVersion: {0}", Environment.OSVersion.Version.ToString()); 
     173            DbgLog("Platform: " + platform.ToString()); 
     174            DbgLog("OSVersion: " + Environment.OSVersion.Version.ToString()); 
    177175 
    178176            foreach (string path in paths) 
    179177            { 
    180                 Console.WriteLine("Checking: {0}", path); 
    181178                if (File.Exists(path)) 
    182179                { 
     180                    DbgLog(path); 
    183181                    return path; 
    184182                } 
     
    192190            else 
    193191            { 
    194                 Console.WriteLine("Platform: {0}" + platform); 
     192                DbgLog("Platform: " + platform.ToString()); 
    195193            } 
    196194 
    197195            return null; 
     196        } 
     197 
     198        private static void DbgLog(String sMessage) 
     199        { 
     200#if DEBUG 
     201            Console.WriteLine(sMessage); 
     202#endif 
    198203        } 
    199204    }