private Uri getRequestUri(BaseInfo result)
        {
            if (result is Command)
            {
                return getUri("/api/Command");
            }

            if (result is CommandResult)
            {
                return getUri("/api/CommandResult");
            }

            if (result is CommandConnection)
            {
                return getUri("/api/CommandConnection");
            }

            if (result is CommandTransaction)
            {
                return getUri("/api/CommandTransaction");
            }

            return null;
        }
Beispiel #2
0
        private bool isConnectionDataPointAdded(BaseInfo item)
        {
            if (item.ConnectionId == null)
                return false;

            var point = FindDataPointInfo(item.ApplicationIdentity, item.ConnectionId.Value);
            return point.Index != -1;
        }
Beispiel #3
0
 private bool shouldIgnoreAddingThisContext(BaseInfo item)
 {
     return _localContexts.Any(
         context => context.ObjectContextId == item.ObjectContextId &&
                    context.ApplicationIdentity.Equals(item.ApplicationIdentity));
 }
 private void postDataAsJson(BaseInfo result)
 {
     var response = _simpleHttp.PostAsJson(getRequestUri(result), result,
         new JsonSerializerSettings
         {
             Formatting = Formatting.None,
             NullValueHandling = NullValueHandling.Ignore,
             DefaultValueHandling = DefaultValueHandling.Ignore,
             Converters = { new StringEnumConverter() },
             TypeNameHandling = TypeNameHandling.Objects,
             ContractResolver = new OrderedContractResolver()
         });
     if (response == HttpStatusCode.Created)
     {
         // good!
     }
 }
Beispiel #5
0
 private bool shouldIgnoreAddingThisMethod(BaseInfo item)
 {
     return _localCallingMethodStackTraces.Any(
         x => x.StackTraceHash.Equals(item.StackTrace.StackTraceHash, StringComparison.OrdinalIgnoreCase) &&
              x.ApplicationIdentity.Equals(item.ApplicationIdentity));
 }