Beispiel #1
0
        public void GetResouceByConnectorId()
        {
            Guid id = Guid.NewGuid();

            appAdminService.Setup(c => c.GetConnectionById(id))
            .Returns(new Connector()
            {
                ResourceType = "type1"
            });

            var resource = _resourceFactory.GetResource(id, "obj1");

            Assert.IsInstanceOfType(resource, typeof(IOperationResource));
        }
Beispiel #2
0
 public static string G(string message)
 {
     if (!string.IsNullOrEmpty(message))
     {
         int index = message.IndexOf(":");
         if (index != -1)
         {
             string key   = message.Split(':')[0];
             string value = message.Split(':')[1];
             return(factory.GetResource(key, value));
         }
     }
     return(message);
 }
		private string LoadAndPlay(IResourceFactory factory, PlayData data)
		{
			if (data.Resource == null)
			{
				string netlinkurl = TextUtil.ExtractUrlFromBB(data.Message);

				AudioResource resource;
				RResultCode result = factory.GetResource(netlinkurl, out resource);
				if (result != RResultCode.Success)
					return $"Could not play ({result})";
				data.Resource = resource;
			}
			return PostProcessStart(factory, data);
		}
Beispiel #4
0
        public SchemaViewModel ListSchemaObject(Guid connectorId)
        {
            var resource = _resourceFactory.GetResource(connectorId, string.Empty);

            resource.LoadSchema();

            return(new SchemaViewModel()
            {
                ConnectorId = connectorId,
                ConnectorName = resource.Connector.Name,
                Tables = resource.DbSchema.Tables,
                Views = resource.DbSchema.Views,
                StoredProcedures = resource.DbSchema.StoredProcedures
            });
        }
Beispiel #5
0
        private string LoadAndPlay(IResourceFactory factory, PlayData data)
        {
            if (data.Resource == null)
            {
                string netlinkurl = TextUtil.ExtractUrlFromBB(data.Message);

                AudioResource resource;
                RResultCode   result = factory.GetResource(netlinkurl, out resource);
                if (result != RResultCode.Success)
                {
                    return($"Could not play ({result})");
                }
                data.Resource = resource;
            }
            return(PostProcessStart(factory, data));
        }