下面的代码在同一页面的底部创建图像.如何将该图像显示到新的选项卡/窗口而不是显示在同一页面中?
success: function (data) {
var image = new Image();
image.src = "data:image/jpg;base64," + data.d;
document.body.appendChild(image);
}
Run Code Online (Sandbox Code Playgroud) 码:
string spName = "usp_Test_Procedure.sql";
var tfsPp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
tfsPp.ShowDialog();
_tfs = tfsPp.SelectedTeamProjectCollection;
if (tfsPp.SelectedProjects.Any())
{
_selectedTeamProject = tfsPp.SelectedProjects[0];
}
string selectedProjectName = _selectedTeamProject.Name;
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(_tfs.Uri);
var vsStore = tfs.GetService<VersionControlServer>();
var project = "project";
var branchVersion = "1.0.0";
var folders = vsStore.GetItems("$/" + selectedProjectName + "/*", RecursionType.Full);
Run Code Online (Sandbox Code Playgroud)
如何在特定选定项目中搜索TFS源代码控件中的特定文件,以及用户从c#UI winforms应用程序中选择下拉菜单中的branchversion?
我需要搜索的文件usp_Test_Procedure.sql位于以下路径中
$/selectedProjectName/project/1.0.0/UI/Scripts/usp_Test_Procedure.sql
Run Code Online (Sandbox Code Playgroud)
实际上我从愚蠢的代码中获得了上述路径:
folders.Items[29956].ServerItem
Run Code Online (Sandbox Code Playgroud)
但我需要知道如何在特定选定项目内的TFS源控件中搜索特定文件,还选择branchversion?谢谢.
我想转换WorkItemCollection为a List<WorkItem>,以便我可以将其进一步转换为a dictionary.这是迄今为止的代码:
var testItemCollectionList = new List<WorkItem>();
WorkItemCollection testItemCollection;
Query query = new Query(project.Store, "Select [Title] From WorkItems", testResults.Select(item => item.TargetId).ToArray());
var car = query.BeginQuery();
testItemCollection = query.EndQuery(car);
testItemCollectionList = ???;
var testItemMapQuery = testItemCollectionList.ToDictionary(w => w, createItemFromQuery);
Run Code Online (Sandbox Code Playgroud) 码:
@Html.TextBoxFor(x => x.PercentNos, new {@class = "percentage-numbers"})
Run Code Online (Sandbox Code Playgroud)
如何@html.textboxfor在mvc4的cshtml视图页面中设置数字限制0到100 ?
我用来读取2个richtextbox内容的代码如下:
richTextBox1.Text = File.ReadAllText(tfsVersionFilePath);
richTextBox2.Text = File.ReadAllText(dbVersionFilePath);
Run Code Online (Sandbox Code Playgroud)
现在,我需要比较两个富文本框内容,并突出显示两个richtextbox中更改的字符.目的是as in TFS通过c#应用程序获得差异并突出显示字符(比较文件).谢谢.
编辑:
int length = (richTextBox1.Text.Length > richTextBox2.Text.Length) ? richTextBox1.Text.Length : richTextBox2.Text.Length;
for (int i = 0; i < length; i++)
{
if (richTextBox1.Text[i] != richTextBox2.Text[i])
{
/* and then start your highlight selection here,
this is where some difference between the two rich
text boxes begins */
richTextBox1.Select(i, 1);
richTextBox1.SelectionColor = System.Drawing.Color.Yellow;
richTextBox1.SelectionBackColor = System.Drawing.Color.Red;
}
}
Run Code Online (Sandbox Code Playgroud)
我从调试中理解的是,在执行特定行之后,指向文本光标的richTextBox1 Select或SelectionColor或SelectionBackColor方法增加到7个位置.如何保持 richTextBox1 …
码:
TestItem TI = new TestItem();
ITestItem IC = TI;
controls.TestItems.Add(IC); //This adds the item into the last column, but I need to add this in a particular index
TestItem is a Class
ITestItem is an Interface
controls is a local variable
TestItems is a ICollection<ITestItem>
Run Code Online (Sandbox Code Playgroud)
如何在ICollection中的特定索引中添加项目?
如何在javascript中用以下行中的"i"替换for循环?
码:
for (var i = 0, n = checkboxes.length; i < n; i++) {
e.form.NameLists_0__IsDeleted.checked = false;
}
Run Code Online (Sandbox Code Playgroud) 码:
foreach (var item in items.Children)
{
RadTreeViewItem parent1 = new RadTreeViewItem();
parent1.Header = NodeHeader(item.Path, item.Name, SelectedPath, ProjectData);
parent1.Tag = item;
foreach (var child in item.Children)
{
RadTreeViewItem children = new RadTreeViewItem();
children.Header = NodeHeader(child.Path, child.Name, SelectedPath, ProjectData);
children.Tag = child;
parent1.Items.Add(children);
}
Parent.Items.Add(parent1);
}
Run Code Online (Sandbox Code Playgroud)
items.Children和item.Children是 ObservableCollection<>
parent1.Header和children.Header是 HeaderedItemsControl.Header
parent1.Tag和children.Tag是 FrameworkElement.Tag
如何将上面的foreach嵌套循环转换为LINQ?
码:
$(".drpdwn")[0].options.value = "1"
Run Code Online (Sandbox Code Playgroud)
我需要将此值更改为 "string"
所以,我编码为,
$(".drpdwn")[0].options.value = "string"
Run Code Online (Sandbox Code Playgroud)
但是,价值就像""快速观察一样.
如何应用字符串值?
我有一个像这样的HTML字符串:
<p>First Sentence is this. Second sentence is this.</p>
Run Code Online (Sandbox Code Playgroud)
我可以<p>使用regex函数从上面的字符串中删除标签.
但是,如何从上面的字符串中删除 - 编码字符winforms?
我不想 出现在输出中.
c# ×5
.net ×4
collections ×2
javascript ×2
jquery ×2
linq ×2
list ×2
tfs ×2
winforms ×2
wpf ×2
ajax ×1
asp.net-mvc ×1
c#-4.0 ×1
dom ×1
foreach ×1
html ×1
performance ×1
razor ×1
regex ×1
richtextbox ×1
tfs2012 ×1