示例#1
0
        public static string ResolveRemoteTargetId(string remoteTargetStringOrId)
        {
            RemoteTarget result1 = (RemoteTarget)null;
            int          result2 = -1;

            if (RemoteTargetUtils.TryParseRemoteTarget(remoteTargetStringOrId, out result1))
            {
                return(result1.Id.ToString());
            }
            if (int.TryParse(remoteTargetStringOrId, out result2))
            {
                return(result2.ToString());
            }
            StoredConnectionInfo connectionInfo = (StoredConnectionInfo)null;

            if (RemoteTargetUtils.TryGetConnectionInfoOrDefault(remoteTargetStringOrId, out connectionInfo))
            {
                return(connectionInfo.Id.ToString());
            }
            return(remoteTargetStringOrId);
        }