小编hid*_*den的帖子

使用图表控件在两点之间绘制一条线

如何在附图中的点(3,3)和点(1,1)之间画一条线.

这是一个图表控件.使用c#的WinForms应用程序

图表示例

private void Form1_Load(object sender, EventArgs e)
{

    //chart1 is the name of the chart control
    chart1.ChartAreas.Add("Area");
    chart1.ChartAreas["Area"].AxisX.Minimum = 0;
    chart1.ChartAreas["Area"].AxisX.Maximum = 10;
    chart1.ChartAreas["Area"].AxisX.Interval = 1;
    chart1.ChartAreas["Area"].AxisY.Minimum = 0;
    chart1.ChartAreas["Area"].AxisY.Maximum = 10;
    chart1.ChartAreas["Area"].AxisY.Interval = 1;


    chart1.Series.Add("Node");
    chart1.Series.Add("DG");
    chart1.Series["Node"].Color = Color.Blue;
    chart1.Series["DG"].Color = Color.Red;


    chart1.Series["Node"].Points.Add(new DataPoint(1, 1));
    chart1.Series["Node"].Points.Add(new DataPoint(8, 2));
    chart1.Series["DG"].Points.Add(new DataPoint(3, 3));

    chart1.Series["Node"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
    chart1.Series["DG"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
}
Run Code Online (Sandbox Code Playgroud)

c# winforms c#-4.0

3
推荐指数
1
解决办法
2万
查看次数

如何编辑对象深处的属性

假设有一个person对象有很多ICollection而ObjectType2有Icollection

因此,要编辑属性,理论上您可以使用forloops进行深入搜索.但是什么是语法上更好的更好的方法.

例如,要编辑名为PP的属性,可以执行以下操作:

foreach (var item in PersonData)
            {
                foreach (var item2 in item.Staffs)
                {
                    foreach (var item3 in item2.Employees)
                    {
                        foreach (var item4 in item3.EmployeePositions)
                        {
                            item4.PP = "test";
                        }
                    }
                }
            }
Run Code Online (Sandbox Code Playgroud)

但我正在寻找一些非常好的东西,例如:无论是通过linq还是其他方法.

c# linq

3
推荐指数
1
解决办法
65
查看次数

为什么即使我知道该组存在,GroupPrincipal.FindByIdentity也会返回null?

为什么会

GroupPrincipal group = GroupPrincipal.FindByIdentity(getPrincipalContext(), 
                                                         "TEST_DESTINATION_GRP");
Run Code Online (Sandbox Code Playgroud)

回来null?我知道TEST_DESTINATION_GRP群组织单位下存在的事实.

我的代码:

private void addUserToGroup(string userName, string groupName)
{
    try
    {
        UserPrincipal user = UserPrincipal.FindByIdentity(getPrincipalContext(), IdentityType.SamAccountName, "jcolon");
        GroupPrincipal group = GroupPrincipal.FindByIdentity(getPrincipalContext(), "TEST_DESTINATION_GRP");
        //just to show that I can access AD            
        ArrayList x = getUserGroups(userName);

        foreach (var xy in x)
        {
            Console.WriteLine(xy);
        }//I can access AD FINE

        if (group == null)
        { Console.WriteLine("Wtf!"); }
        Console.WriteLine(user); 
        Console.WriteLine(group + "empty why!!!!");
    }
    catch (Exception e)
    { 
        //log e
    }
}

private PrincipalContext getPrincipalContext() …
Run Code Online (Sandbox Code Playgroud)

c# active-directory

2
推荐指数
1
解决办法
1万
查看次数

什么是HttpDelete属性

http://msdn.microsoft.com/en-us/library/system.web.mvc.httpdeleteattribute.aspx 表示用于限制操作方法的属性,以便该方法仅处理HTTP DELETE请求.

但这对于Mvc来说意味着什么呢?

 @Html.ActionLink("delete", new {id= model.PrimaryKey})// 
Run Code Online (Sandbox Code Playgroud)

这是删除请求吗?浏览器将如何区分

 @Html.ActionLink("gridDisplay", new {id= model.PrimaryKey})// 
Run Code Online (Sandbox Code Playgroud)

调节器

[HttpDelete] //what is this how does it know?
public action result delete()
{
 delete();//web service deletes something just go with me here 
}
public action result gridDisplay()
{
  return view()
}
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-3

2
推荐指数
1
解决办法
4427
查看次数

SQL两个具有不同月份值的表.获得所有月份的一个结​​果集

如果我有两个这样的表:

表格1

Month
1
3

表2

Month 
1
4

如何获得以下结果集?结果集

Month
1 
3
4

sql select

1
推荐指数
1
解决办法
574
查看次数

重叠的盒子

在此输入图像描述

我有两个盒子重叠的问题.我应该使用绝对定位吗?z-index还是有什么技术?顺便说一句,我希望它们重叠只是我想确保它适用于跨现代浏览器.IE8或+

我不能把黑匣子推到中心为什么? 在此输入图像描述

<!DOCTYPE HTML>
<html>

<head>
<title>Metropolitan State Hospital Intranet</title>
<link rel="stylesheet" type="text/css" href="Home.css">
</head>

<body>

        <div id="masthead">

            <div id="logo">
                Logo here
            </div><!--end logo-->

            <div id="header">
                <div id="horizontalMainMenu">
                    <ul>
                        <li><a href="#">About Us     |</a></li>
                        <li><a href="#">Contact Us   |</a></li>
                        <li><a href="#">Metro Link   |</a></li>
                        <li><a href="#">WaRMSS Login  </a></li>
                    </ul>
                    <br style="clear:left;"><!--I used float:left in the css to stack the list items now I need to clear it-->
                </div>
            </div>
            <!--end header-->

        </div><!--end masthead-->

        <div id="container">
            <div id="left_col">
                <div id="verticalMainMenu">
                    <ul>
                        <li><a href="#">Air Quality …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
2430
查看次数

防止用户多次点击按钮; 阻止我的控制器操作执行

我将这个jquery函数添加到我的表单中.

$('#NewVarianceSubmitButton').click(function () {
    $(this).attr("disabled", "disabled")
});
Run Code Online (Sandbox Code Playgroud)

现在,当我点击它时按钮被禁用但它不会将数据提交到数据库.如果我删除上面的代码,一切都提交到数据库就好了.我是否需要告诉jquery执行控制器操作?

jquery asp.net-mvc-3

1
推荐指数
1
解决办法
184
查看次数

关于Ruby中$ LOAD_PATH的问题

$: = '/users/joecool/rubylib'
$: << '/users/joecool/rubylib'
$:.unshift('/users/joecool/rubylib')
ruby -c somescript.rb    
ruby -e "puts 'Hello, world!'
Run Code Online (Sandbox Code Playgroud)

有人可以指导我阅读,以便我可以弄清楚这段代码的作用吗?

ruby path

0
推荐指数
1
解决办法
338
查看次数

IComparer问题

目的:有多个选项可以使用我的类的属性进行排序.我设法使用Comparable使用samAccountName排序,但未能正确实现IComparer.但是知道我收到了下面指定的错误.

错误:未实现接口成员System.Collections.Icomparer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace ActiveDirectory
{
    public class sortLastName : IComparer
    {
        int IComparer.CompareTo(Employee oEmployee, Employee oEmployee2)
        {
            return String.Compare(oEmployee.lastName, oEmployee2.lastName);
        }
        public static IComparer sortYearAscending()
        {
            return (IComparer)new sortLastName();
        }

    }
//The code works great when I make a call like 
// List<Employee> x = new List<Employee>();
// x.sort();// sorts by samAccountName
// Now I would like to figure out how to sort by lastName and still be able to …
Run Code Online (Sandbox Code Playgroud)

c#

0
推荐指数
1
解决办法
3390
查看次数

标签 统计

c# ×4

asp.net-mvc-3 ×2

active-directory ×1

c#-4.0 ×1

css ×1

html ×1

jquery ×1

linq ×1

path ×1

ruby ×1

select ×1

sql ×1

winforms ×1