小编Nei*_*enn的帖子

用C#代替Swing的包

我正在开发一个C#的快速应用程序.我想做的一件事就是相当于Swing(java)pack().这是一个允许我对表单(Java中的Frame)说出来的调用,将自己的大小调整为自己内部组件总和的大小.

我搜索和搜索(组件动态变化,所以我不能简单地将表单硬编码到正确的大小),但我找不到C#中的等效方法.

有谁知道它叫什么?

c# user-interface swing

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

Bluez简介注册

我正试图在Bluez5上使用Python工作.目前我有以下内容:

    #set up a bluez profile to advertise device capabilities from a loaded service record
def init_bluez_profile(self):

    print("Configuring Bluez Profile")

    #setup profile options
    service_record=self.read_sdp_service_record()

    opts = {
        "ServiceRecord":service_record,
        "Role":"server",
        "RequireAuthentication":False,
        "RequireAuthorization":False,
        "Name":BTKbDevice.MY_DEV_NAME,
        "AutoConnect":True
    }

    #retrieve a proxy for the bluez profile interface
    bus = dbus.SystemBus()
    self.manager = dbus.Interface(bus.get_object("org.bluez","/org/bluez"), "org.bluez.ProfileManager1")
    self.profile = BTKbBluezProfile(bus, BTKbDevice.PROFILE_DBUS_PATH)
    self.manager.RegisterProfile(BTKbDevice.PROFILE_DBUS_PATH, BTKbDevice.UUID, opts)
    print("Profile registered ")
Run Code Online (Sandbox Code Playgroud)

此代码正确执行,配置文件代码是teh bluez测试用例的标准代码:

class BTKbBluezProfile(dbus.service.Object):
fd = -1

@dbus.service.method("org.bluez.Profile1",
                                in_signature="", out_signature="")
def Release(self):
        print("Release")
        mainloop.quit()

@dbus.service.method("org.bluez.Profile1",
                                in_signature="", out_signature="")
def Cancel(self):
        print("Cancel")

@dbus.service.method("org.bluez.Profile1", …
Run Code Online (Sandbox Code Playgroud)

python bluez

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

引用GUID

我正在尝试捕获一个事件并引用一个GUID来查看它是哪个事件.代码如下:

DWORD WINAPI AvisionEventProc(LPVOID lpParam){
    //HANDLE hEvent = * (HANDLE *) lpParam;   // This thread's read event
    STINOTIFY pStiNotify;

    if (debug){
        wprintf(L"Avision Event\n");
    }
    while(true){
        WaitForSingleObject(hAvisionEvent, INFINITE);
        wprintf(L"Event");
        pStiDevice->GetLastNotificationData(&pStiNotify);
        if (pStiNotify.guidNotificationCode == GUID_STIUserDefined1){
            wprintf(L"User defined 1");
        }else if (pStiNotify.guidNotificationCode == GUID_STIUserDefined2){
            wprintf(L"User defined 2");
        }else if (pStiNotify.guidNotificationCode == GUID_STIUserDefined3){
            wprintf(L"User defined 3");
        }

        ResetEvent(hAvisionEvent);
    }
    return 1;
}
Run Code Online (Sandbox Code Playgroud)

这编译得很好,但我在链接时得到以下错误:

1>sti.obj : error LNK2001: unresolved external symbol _GUID_STIUserDefined3
1>sti.obj : error LNK2001: unresolved external symbol _GUID_STIUserDefined2
1>sti.obj : error LNK2001: unresolved …
Run Code Online (Sandbox Code Playgroud)

winapi guid

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

NpgsqlException 上的代码属性

我试图在我的代码中从 NPGSQL 的 v2.0.11 移动到 v3.1.7,但是我正在访问 NpgsqlException 的代码属性。在 3.1.7 中这已经消失了;我现在如何从 postgres 访问底层代码错误?

npgsql

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

Thymeleaf 中的绑定列表;索引越界

我正在尝试在 Thymeleaf 中绑定一个列表,并按照教程进行操作并在此处进行搜索;我在提交时的绑定索引中遇到问题,被跳过然后超出。首先详细介绍一下代码,核心内容如下:

package com.ziath.manu.stockcheck.model;

import java.util.UUID;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import org.apache.commons.lang3.builder.ToStringBuilder;

@Entity
public class StockItem {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private UUID id;
    private String itemId;
    private String description;
    private Integer currentStockLevel;
    private Integer warnStockLevel;
    private Integer errorStockLevel;
    private Boolean purchaseOrderPlaced;

    public StockItem() {
        super();
       warnStockLevel = 0;
       errorStockLevel = 0;
    }

    public StockItem(String itemId, String description, Integer stockLevel) {

        this();
        this.itemId = itemId;
        this.description = description;
        this.currentStockLevel = stockLevel;
    }

    public String getItemId() …
Run Code Online (Sandbox Code Playgroud)

java spring thymeleaf

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

标签 统计

bluez ×1

c# ×1

guid ×1

java ×1

npgsql ×1

python ×1

spring ×1

swing ×1

thymeleaf ×1

user-interface ×1

winapi ×1