我刚刚完成了我的第一个"真正的"APEX应用程序,但它看起来有点凌乱.有什么方法可以重新编号页面,以便它们按应用程序流的顺序返回?
先谢谢,马特
我目前正在开发一个新的 Web 应用程序,它正在使用 Oracle APEX 进行开发。它基本上是一个十页的向导式 Web 表单,可以填写并提交。在几乎所有情况下,这些页面中只会使用三到四个,而另一个页面用于向用户呈现特殊情况信息。
无论如何......我目前正在编写一个测试计划,以确保所有验证和流程都按预期工作,如果可能的话,我想尝试自动化此测试。
有谁知道我可以为此目的使用任何好的自动化测试工具(最好是开源的)?此外,由于它可能是相关的,因此我仅限于使用 Java 和/或 APEX 来定制这些工具以满足我的测试需求。
我们目前有一个实用程序类,它处理大量字符串格式,日期显示和类似功能,它是一个共享/静态类.
这是"正确的"做事方式还是我们应该在需要时实例化实用程序类?
我们的主要目标是减少内存占用,但应用程序的性能也是一个考虑因素.
PS.我们正在使用.NET 2.0
我知道我可以使用以下查询从给定数据库中获取表的列表:
select *
from information_schema.tables
Run Code Online (Sandbox Code Playgroud)
我如何排除系统表呢?
我需要转换许多不同的对象,并且我想避免为每个对象编写转换器类。每个对象都继承自一个基类,我需要使用 Id 来获取描述(这是在我对 CacheManager 的调用中处理的)。
对于每个类(我有大约 30 个类),我编写了以下代码:
object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Dictionary<int, string> codes = CacheManager.CodeLookup<CourtEventCode>();
int id = 0;
string result = string.Empty;
if (int.TryParse(value.ToString(), out id) && id > 0)
{
if (codes.ContainsKey(id))
{
result = codes[id];
}
else
{
result = "Unknown";
}
}
return result;
}
Run Code Online (Sandbox Code Playgroud)
在上面的示例中,CourtEventCode代表这一类的转换器。有没有一种方法可以从 IValueConverter.Convert 的 targetType 输入派生该类,而不必基本上复制并粘贴该类两打?
预先感谢,
桑尼
我正在创建一个简单的用户控件; 只是一个ImageButton.
我已经成功将图像绑定到按钮,所以我决定添加一个工具提示.现在我遇到了麻烦.似乎我可以在XAML中为控件硬编码工具提示的文本,但是当它绑定时它返回一个空字符串.
这是我控制的XAML:
<Button x:Class="BCOCB.DACMS.Controls.ImageButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Name="this"
Style="{StaticResource DisabledButton}">
<Image Source="{Binding ElementName=this, Path=Source}" />
<Button.ToolTip>
<TextBlock Text="{Binding ElementName=this, Path=ToolTipText}" />
</Button.ToolTip>
</Button>
Run Code Online (Sandbox Code Playgroud)
这是工具提示文本的依赖属性信息:
public static readonly DependencyProperty ToolTipTextProperty = DependencyProperty.Register("ToolTipText", typeof(string), typeof(ImageButton));
public string ToolTipText
{
get
{
return this.GetValue(ToolTipTextProperty) as string;
}
set
{
this.SetValue(ToolTipTextProperty, value);
}
}
Run Code Online (Sandbox Code Playgroud)
最后,在我的窗口中声明控件:
<controls:ImageButton x:Name="btnAdd" Source="/DACMS;component/Resources/plus.png" ToolTipText="Add New Item" Click="btnAdd_Click" />
Run Code Online (Sandbox Code Playgroud)
正如我之前提到的,图像绑定得很好,我以完全相同的方式完成了它.
有任何想法吗?
谢谢,
桑尼
编辑:我现在有工作.我已经从绑定中删除了ElementName,并DataContext = this在instanciation后面的代码中设置了TextBlock .不过,我想知道如何在XAML中解决这个问题.
我怀疑这可能适用于多种编程语言,但在这种情况下,我指的是.NET.
当我使用时System.Diagnostics.Process.Start,我可以包括一个System.Diagnostics.ProcessStartInfo对象作为参数.ProcessStartInfo类的一个属性是Verb(字符串的类型).还有一个string []属性,Verbs其中似乎包含允许值列表Verb.
我注意到在Verbs数组中有一个"Print"值和一个"PrintTo"值.这两者有什么区别?我测试了两者,它们似乎都导致文件打印到我的默认打印机.
我正在搞乱泛型,我正在尝试编写一个函数,我可以通过指定表名来调用从数据库表中加载所有内容.
我大部分都在那里; 我的通用方法似乎都可行,但我不太确定如何将结果转换为可用的结果.
到目前为止,这是该方法的核心:
private static List<EntityCodeBase> GetCodeLoadResults(CodeTables table)
{
List<EntityCodeBase> results = new List<EntityCodeBase>();
Assembly assm = Assembly.Load(new System.Reflection.AssemblyName("RR"));
Type tableType = assm.GetTypes().Where(u => u.Name.ToLower() == table.ToString().ToLower()).FirstOrDefault();
MethodInfo mi = typeof(SpecificEntity).GetMethod("LoadAll");
mi = mi.MakeGenericMethod(tableType);
mi.Invoke(null, null); //how can I cast the resulting object into a List<EntityCodeBase> ?
return results;
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个泛型函数,它会在进行AJAX调用时阻塞UI.我要做的是有一个函数A运行作为参数传入的任何其他函数.这是我到目前为止所得到的:
function blockWhileLoading(fn, msg)
{
if (msg == null)
{
msg = 'Please wait while the next page is loaded...';
}
$.blockUI(
{
message: '<h1>' + msg + '</h1>',
css:
{
border: 'none',
padding: '15px',
backgroundColor: '#E3D9BA',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
color: '#4D2612'
}
});
$('body').scrollLeft(0);
setTimeout(function()
{
eval(fn);
$.unblockUI();
}, 1000);
}
Run Code Online (Sandbox Code Playgroud)
现在,当需要评估函数时,似乎没有任何事情发生.eval不是强制函数运行的正确方法吗?
我目前正在研究泛型集合类,我想创建一个从集合中返回对象的方法.如果集合中不存在特定对象,则应创建对象,将其添加到集合中,然后返回.
我遇到了一些问题.泛型集合if if表示抽象类的类型,我在实例化时遇到问题.
这是我的班级定义:
public class CacheCollection<T> : List<CacheItem<T>> where T : EntityBase
Run Code Online (Sandbox Code Playgroud)
这是我工作的部分完整的方法:
public T Item(int Id)
{
CacheItem<T> result = this.Where(t => t.Entity.Id == Id).First();
if (result == null) //item not yet in cache, load it!
{
T entity = new T(Id); //design time exception here: Cannot create an instance of the variable type 'T' because it does not have the new() constraint
result = new CacheItem<T>(entity);
this.Add(result);
}
return result.Entity;
}
Run Code Online (Sandbox Code Playgroud)
关于如何解决这个问题的任何想法?
编辑:从EntityBase派生的所有类都将Id作为只读属性.
c# ×4
.net ×3
generics ×3
oop ×2
oracle-apex ×2
wpf ×2
arguments ×1
binding ×1
collections ×1
converters ×1
function ×1
java ×1
javascript ×1
process ×1
shell ×1
shell-verbs ×1
sql ×1
sql-server ×1
testing ×1
windows ×1
xaml ×1