标签: items

如何清除列表直到某些项目?C#

我有List<sting>5个条目.[0],[1],[2],[3],[4].

如果我使用List.Clear()所有项目都被删除.

我需要删除到特定项目,例如直到[1].这意味着在我的名单中只是2 items [0] and [1].怎么用c#?

c# items list clear

5
推荐指数
2
解决办法
4437
查看次数

如何更改MenuStrip的外观

我加MenuStrip在我的应用程序,并添加上ManagerRenderModeRender Mode.问题在于外观,看起来很内脏.看看那两张照片,我想改变透明的子菜单的白色边框,那个看起来灰色的蓝色矩形菜单和深灰色的子菜单(和他的边框是深蓝色)和边框白色菜单何时被选中.我怎么能这样做?

BackColor是:36; 36; 36ForeColorLightGray.

在此输入图像描述

在此输入图像描述

我设法更改了蓝色矩形,选中选项时的白色矩形,选择子菜单选项时的蓝色矩形,但我不知道如何更改white border,请帮助..

这是迄今为止的代码......

        Color culoare = Color.FromArgb(20, 20, 20);
        Color culoare1 = Color.FromArgb(36, 36, 36);

        public override Color MenuItemSelected
        {
            get { return culoare; }
        }

        public override Color MenuItemBorder
        {
            get { return culoare; }
        }

        public override Color MenuItemSelectedGradientBegin
        { 
            get { return culoare; } 
        }

        public override Color MenuItemSelectedGradientEnd
        { 
            get { return culoare; } 
        }

        public …
Run Code Online (Sandbox Code Playgroud)

c# appearance items border menustrip

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

如何获取维基数据项的所有属性值标签?

您如何请求Item具有的所有属性集?

具体来说,我正在寻找每个项目的英文标签,这是项目属性的价值.

例如" 地球 ":

{
    "Challenger Deep",
    "Solar System",
    "oblate spheroid",
    "geoid",
    "World Ocean",
    "Afro-Eurasia",
    ...
}
Run Code Online (Sandbox Code Playgroud)

我现在正在使用维基数据工具包库,但我会提出建议.

java items labels wikidata wikidata-api

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

UIPrintInteractionController 打印项目不显示/工作

很直接...

这些天我认为自己是一名经验丰富的 iOS 开发人员,但这似乎是 iOS 中一个明显的错误,除非我错过了什么。

请看下面的代码。

文件路径指向两个一页的 PDF。

显示的是一个没有要打印的内容的打印交互控制器。

如果我一次只做 1 个文件,如下所示:

pc.printingItem = [NSURL fileURLWithPath:filePath1];
Run Code Online (Sandbox Code Playgroud)

它就像一个冠军。

我在这里错过了什么?!

UIPrintInteractionController *pc = [UIPrintInteractionController sharedPrintController];
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputPhoto;
printInfo.orientation = UIPrintInfoOrientationLandscape;
pc.printInfo = printInfo;

pc.printingItems = @[[NSURL fileURLWithPath:filePath1], 
                     [NSURL fileURLWithPath:filePath2]];

[pc presentAnimated:YES completionHandler:completionHandler];
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

items objective-c ios uiprintinteractioncntrler swift

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

清除旋转木马的所有元素 - Sencha

Dows任何人都知道如何删除sencha中旋转木马上的所有元素???

carousel = new Ext.Carousel({
    fullscreen: true,
    defaults: {
        cls: 'carousel-item'
    },
    items: [{
            id:'tab-1',
            html: '',
            cls: 'card card1'
        },{
            id:'tab-2',
            html: '<p>Clicking on either side of the indicators below</p>',
            cls: 'card card2'
        },{
            id:'tab-3',
            html: 'Card #3',
            cls: 'card card3'
        }]
});
Run Code Online (Sandbox Code Playgroud)

非常感谢

extjs items carousel

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

Python,从元组列表中删除重复项

我有以下列表:

[('mail', 167, datetime.datetime(2010, 9, 29)) , 
 ('name', 1317, datetime.datetime(2011, 12, 12)), 
 ('mail', 1045, datetime.datetime(2010, 8, 13)), 
 ('name', 3, datetime.datetime(2011, 11, 3))]
Run Code Online (Sandbox Code Playgroud)

并且我想从列表中删除项目,其中元组中的第一项是重合的,其中日期不是最新的.换句话说,我需要得到这个:

[('mail', 167, datetime.datetime(2010, 9, 29)) , 
 ('name', 1317, datetime.datetime(2011, 12, 12))]
Run Code Online (Sandbox Code Playgroud)

python items list

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

从SQLite数据库填充listview

我有一个活动,我写了一个插入数据库的名称.在另一个活动中,我想放置一个ListView,它使用数据库中的那些名称填充,或者在我从第一个活动的edittext中写入时直接添加新项目.我意识到插入到数据库部分,但我无法弄清楚如何填充该listview.

public class Add extends Activity implements OnClickListener{

Button sqlUpdate;
EditText sqlName;


@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add);
    sqlUpdate = (Button) findViewById(R.id.bFinishAdd);
    //sqlView = (Button) findViewById(R.id.bSQLopenView);
    sqlName = (EditText) findViewById(R.id.etAdd);
    sqlUpdate.setOnClickListener(new OnClickListener(){

        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            boolean didItWork = true;

            try{
            String name = sqlName.getText().toString();

            DBhelp entry = new DBhelp(Add.this);
            entry.open();
            entry.createEntry(name);
            entry.close();
            Intent i = new Intent(Add.this, Liste.class);
            startActivity(i);

            }catch(Exception i){
                didItWork = false;
            }finally{
        } …
Run Code Online (Sandbox Code Playgroud)

database android listview items populate

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

Sitecore Axes.IsDescendantOf/Axes.IsAncestorOf - Inclusive?

有没有办法,我很想念有Sitecore的退货原因或什么true的都Item.Axes.IsDescendantOf()Item.Axes.IsAncestorOf()

var test =
Sitecore.Context.Database.GetItem("{862B466A-079B-40E7-8661-FC064EC28574}");  
Response.Write(test.Axes.IsAncestorOf(test));  
Response.Write(test.Axes.IsDes(test));
Run Code Online (Sandbox Code Playgroud)

// True
// True

编辑:任何可能偶然发现这个答案寻找非包容性的人,IsAncestorOf或者IsDescendantOf下面是一些例子,我需要在新选类别的多选字段中找到最高级别的元素.

newsCategories
   .Where(x => newsCategories
                       .Any(y => x != y && !x.Axes.IsDescendantOf(y)))
Run Code Online (Sandbox Code Playgroud)

newsCategories
   .Where(x => newsCategories
                       .Any(y => x != y && !x.Axes.IsDescendantOf(y)))
Run Code Online (Sandbox Code Playgroud)

items sitecore sitecore6

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

如何使用Linq在c#list中添加缺失值列表

我有一个类似的课程

public class MyClass
{
  public float Consumed { get; set;}
  public int RequiredValue { get; set;}
}
Run Code Online (Sandbox Code Playgroud)

这个班级的清单

List<MyClass> list
Run Code Online (Sandbox Code Playgroud)

已经有一些MyClass类型的项目包含"RequiredValue",例如3,5,6,8和10以及"Consumed"属性中的相应值.我使用以下代码在范围1到10中找到缺失值:

var missingValues = Enumerable.Range(1, 10).Except(list.Select(p1 => p1.RequiredValue));
Run Code Online (Sandbox Code Playgroud)

我想使用Linq在"列表"中添加项目,以使新项目在"RequiredValue"和"Consumed"中缺少值为0.

c# linq items list add

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

过滤列表.获取列表元素只与项目之间有一定距离?

我只需要获得在某种程度上彼此远离的元素/项目.例如,我有一个整数列表:

data = [-2000, 1000, 2000, 3500, 3800, 4500, 4600, 5000, 6000]
Run Code Online (Sandbox Code Playgroud)

让我们假设我只想检索那些彼此之间的距离至少为1000的元素.从上面的列表我需要输出:

[-2000, 1000, 2000, 3500, 4500, 6000]
Run Code Online (Sandbox Code Playgroud)

我这样过滤:

filtered.append(data[0])
for index, obj in enumerate(data):
    if index < (l - 1): 
        if abs(obj - data[index+1]) > 999:
            filtered.append(data[index+1])

print(filtered)
Run Code Online (Sandbox Code Playgroud)

不受欢迎的输出:

[-2000, 1000, 2000, 3500, 6000]
Run Code Online (Sandbox Code Playgroud)

它失败了,因为它比较了两个相邻的列表元素,而不管一些元素应该被过滤掉而不应该被考虑在内.

让我更清楚地表明.
原始清单:[-2000, 1000, 2000, 3500, 3800, 4500, 4600, 5000, 6000]

过滤过程:

-2000 - OK
1000 - OK
2000 - OK
3500 - OK
3800 - Out
4500 - Should be …
Run Code Online (Sandbox Code Playgroud)

python items list distance python-3.x

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