GVKun编程网logo

以编程方式附加到窗口中的所有用户的path(编写程序,该程序在同一窗口中绘制函数在)

9

如果您想了解以编程方式附加到窗口中的所有用户的path和编写程序,该程序在同一窗口中绘制函数在的知识,那么本篇文章将是您的不二之选。我们将深入剖析以编程方式附加到窗口中的所有用户的path的各个方面,

如果您想了解以编程方式附加到窗口中的所有用户的path编写程序,该程序在同一窗口中绘制函数在的知识,那么本篇文章将是您的不二之选。我们将深入剖析以编程方式附加到窗口中的所有用户的path的各个方面,并为您解答编写程序,该程序在同一窗口中绘制函数在的疑在这篇文章中,我们将为您介绍以编程方式附加到窗口中的所有用户的path的相关知识,同时也会详细的解释编写程序,该程序在同一窗口中绘制函数在的运用方法,并给出实际的案例分析,希望能帮助到您!

本文目录一览:

以编程方式附加到窗口中的所有用户的path(编写程序,该程序在同一窗口中绘制函数在)

以编程方式附加到窗口中的所有用户的path(编写程序,该程序在同一窗口中绘制函数在)

我添加到厨师的Windowspath,但它只反映为pipe理员(用于pipe理员追加到path)

# append dnx.exe to %PATH% windows_path '%USERPROFILE%\.dnx\runtimes\dnx-coreclr-win-x64.1.0.0-rc1-update1\bin' do action :add end

有没有一个命令追加到path,并使其可编程的窗口的所有用户?

厨师生成食谱

如何使用Chef在Windows上安装Xamarin

厨师独奏错误Errno :: ENOENT:没有这样的文件或目录 – solo.rb

使用厨师添加一个ssh密钥

如何在Windows上安装厨师服务器

我没有Chef的经验,但是为所有用户添加PATH环境变量的规范方法是将其附加到机器环境中的变量而不是用户环境中。 在PowerShell中,你是这样做的:

$path = [Environment]::GetEnvironmentvariable('PATH','Machine') $path += ';%USERPROFILE%.dnxruntimesdnx-coreclr-win-x64.1.0.0-rc1-update1bin' [Environment]::SetEnvironmentvariable('PATH',$path,'Machine')

如果你想合并成一个单一的声明它看起来有点像这样:

[Environment]::SetEnvironmentvariable('PATH',([Environment]::GetEnvironmentvariable('PATH','Machine') + ';%USERPROFILE%.dnxruntimesdnx-coreclr-win-x64.1.0.0-rc1-update1bin'),'Machine')

但是,您可能不想简单地追加到变量,因为这可能会一直添加到变量的路径。 为了避免这样做,你可以做这样的事情:

$dir = '%USERPROFILE%.dnxruntimesdnx-coreclr-win-x64.1.0.0-rc1-update1bin' $path = [Environment]::GetEnvironmentvariable('PATH','Machine') -split ';' | Where-Object { $_ -ne $dir } $path += $dir [Environment]::SetEnvironmentvariable('PATH',($path -join ';'),'Machine')

编辑:我只是意识到[Environment]::SetEnvironmentvariable()不能用于你的情况。 虽然该方法将变量设置为您传入的字符串,但该字符串将作为REG_SZ值存储在注册表中。 当查找路径时,会阻止字符串内部的变量(如%USERPROFILE% )被扩展,使得整个事情变得毫无意义。

为了避免这个缺陷,你必须确保路径存储在一个REG_EXPAND_SZ值中,例如:

$regkey = 'HKLM:SYstemCurrentControlSetControlSession ManagerEnvironment' Set-ItemProperty -Path $regkey -Name 'Path' -Value $path -Type ExpandString

.NET Core如何以编程方式检索具有相同所有者的所有nuget包元数据?

.NET Core如何以编程方式检索具有相同所有者的所有nuget包元数据?

是否可以使用与nuget API进行通信的任何官方提供的nuget软件包?

不是,不是。

NuGet客户团队将他们在nuget.org上发布的软件包称为NuGet (Client) SDK。 NuGet.Protocol是用于实现NuGet server HTTP API客户端的软件包。 NuGet SDK并没有实现所有服务器API,仅实现了Visual Studio中使用的部分。

由于您的问题与搜索有关,因此search docs是相关的。查看response schema,我们可以看到owners是字段之一,但是查看request parameters,没有查询专门询问所有者。

因此,您可以尝试将您感兴趣的nuget.org帐户名作为搜索关键字传递,并希望搜索索引中包含该信息。返回结果后,您可以检查每个包裹,而忽略那些没有要作为包裹所有者的帐户的人。

其他两个具有包元数据的服务器API资源是catalog(由摄取管道处理的所有包的事务日志)和package metadata,但都不显示所有者信息。

但是,NuGet服务器团队的问题跟踪者是GitHub的NuGet / NuGetGallary存储库,我发现了一个问题询问how to get the list of owners of a given package on nuget.org。他们承认这是该协议的缺点。您可以对该问题进行投票,以表明它很重要(到目前为止只有1票赞成,因此对于大多数客户而言,这并不重要)。但是他们还回复了一个非正式的,未记录的URL,其中包含所有软件包的所有者列表。您可以使用它,但显然要考虑理论上随时可能发生变化的风险。话虽如此,评论还是在2年前发布的,至今仍然有效。

android – 视图未附加到窗口

android – 视图未附加到窗口

什么警告视图没有附加到窗口意味着什么?在尝试调试我的游戏时,我经常在Logcat中获取它.

确切的输出:

12-27 18:14:12.415: W/View(16827): The view is not attached to a window

我已经搜索过这个警告,但却找不到任何内容.我得到的只是error about Window Manager,这不是我到这里来的.我想知道这个警告的原因,只是为了确认它是否与FPS下降有关?

解决方法

这意味着在方向更改时,您可以运行任何对话框.只需关闭活动的onFinish或onDestroy中的对话框.

android-以编程方式将视图添加到LinearLayout不会在除一个以外的所有内容上设置文本

android-以编程方式将视图添加到LinearLayout不会在除一个以外的所有内容上设置文本

我有一个线性布局,想动态添加可变数量的列表项. (它不能是回收站视图,因为此列表已经在回收站视图中,并且被认为是一个很小的列表.)但是由于某些原因,它没有保存我设置的文本(最后一项除外).如果我添加了另一个标题不同的项目,则将显示最后添加的项目,其他项目将显示“默认”.有人知道发生了什么吗?真的很奇怪谢谢!

这是代码:

settings_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <TextViewhttps://www.jb51.cc/tag/ara/" target="_blank">aratorTextViewStyle"
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="#00000000"
        android:text="Default"
        android:layout_weight="1"/>

    <CheckBox
        android:id="@+id/checkBox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="end|center_vertical"
        android:layout_weight="0"/>

</LinearLayout>

root_settings_view.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginEnd="5dp">
</LinearLayout>

SettingsView.java:

public class SettingsView extends LinearLayout {

    //Views
    private View view;

    /**
     * Constructor for android tools to use.
     */
    public SettingsView(Context context) {
        super(context);
    }

    /**
     *
     * @param parent
     */
    public SettingsView(ViewGroup parent) {
        super(parent.getContext());

        //Get the inflated layout
        LinearLayout view = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.root_settings_view, parent, false);


        View itemView = LinearLayout.inflate(parent.getContext(), R.layout.settings_item, view);
        ((TextView) itemView.findViewById(R.id.title)).setText("Hi");
        ((CheckBox) itemView.findViewById(R.id.checkBox)).setChecked(true);


        View itemView2 = LinearLayout.inflate(parent.getContext(), R.layout.settings_item, view);
        ((TextView) itemView2.findViewById(R.id.title)).setText("Hello");
        ((CheckBox) itemView2.findViewById(R.id.checkBox)).setChecked(false);

        View itemView3 = LinearLayout.inflate(parent.getContext(), R.layout.settings_item, view);
        ((TextView) itemView3.findViewById(R.id.title)).setText("Bye");
        ((CheckBox) itemView3.findViewById(R.id.checkBox)).setChecked(true);

        View itemView4 = LinearLayout.inflate(parent.getContext(), R.layout.settings_item, view);
        ((TextView) itemView4.findViewById(R.id.title)).setText("Test");
        ((CheckBox) itemView4.findViewById(R.id.checkBox)).setChecked(false);

        addView(view);
    }

Result

解决方法:

感谢@Rod_Algonquin的评论,这使我确信必须为此制作一个小部件.幸运的是,我之前做过小部件,所以我知道该怎么做.我只是想避免这种情况,但是如果我们不使用小部件,我想它在重复ID方面会出现问题.

以下代码使它起作用:

添加了新类SettingItemView.java:

/**
 * A item view with the title and a checkBox.
 */
public class SettingItemView extends LinearLayout {

    private TextView mTitle;
    private CheckBox mCheckBox;

    public SettingItemView(Context context) {
        super(context);
        inflate(context, R.layout.settings_item, this);
        mTitle = (TextView) findViewById(R.id.title);
        mCheckBox = (CheckBox) findViewById(R.id.checkBox);
    }

    public void setTitle(String title) {
        mTitle.setText(title);
    }

    public void setCheckBox(boolean checked) {
        mCheckBox.setChecked(checked);
    }
}

更改了此构造方法:

/**
 *
 * @param parent
 */
public SettingsView(ViewGroup parent) {
        super(parent.getContext());

        //Get the inflated layout.
        LinearLayout view = LayoutInflater.from(getContext()).inflate(R.layout.root_settings_view, parent, false);


        SettingItemView itemView = new SettingItemView(parent.getContext());
        itemView.setTitle("Hi");
        itemView.setCheckBox(true);
        view.addView(itemView);

        SettingItemView itemView2 = new SettingItemView(parent.getContext());
        itemView2.setTitle("Hello");
        itemView2.setCheckBox(true);
        view.addView(itemView2);

        SettingItemView itemView3 = new SettingItemView(parent.getContext());
        itemView3.setTitle("Bye");
        itemView3.setCheckBox(true);
        view.addView(itemView3);

        addView(view);
    }

asp.net – Sitecore – 以编程方式清除用户的缓存

asp.net – Sitecore – 以编程方式清除用户的缓存

我有一个自定义角色提供程序,用户可以在执行某些操作时更改特定用户的角色.

这导致了一些问题:

>如果将角色添加到用户,则允许他们访问
在我清除sitecore缓存之前,这不会生效
手动使用/sitecore/admin/cache.aspx
>我们正在缓存用户呈现的菜单栏.但是当权限
    更改,可能会添加新项目/删除项目,但这不会反映,因为它来自缓存版本.

有没有办法可以通过编程方式清除特定用户的sitecore缓存?

解决方法

是 – Sitecore执行此操作的方法是将用户详细信息添加到缓存键以进行渲染.这是存储在html缓存中,因此要清除它,您需要获取html缓存并清除包含用户名的所有条目.

这个代码片段会这样做:

// Need to clear the cache for the header and the user profile....
var htmlCache = CacheManager.GetHtmlCache(Context.Site);

// Remove all cache keys that contain the currently logged in user.
var cacheKey = $"#login:True_#user:{Context.GetUserName()}";
htmlCache.RemoveKeysContaining(cacheKey);

这将清除当前登录用户的html缓存中的所有条目.如果要清除其他用户,只需更改Context.GetUserName()以获取要清除的特定用户.

今天关于以编程方式附加到窗口中的所有用户的path编写程序,该程序在同一窗口中绘制函数在的介绍到此结束,谢谢您的阅读,有关.NET Core如何以编程方式检索具有相同所有者的所有nuget包元数据?、android – 视图未附加到窗口、android-以编程方式将视图添加到LinearLayout不会在除一个以外的所有内容上设置文本、asp.net – Sitecore – 以编程方式清除用户的缓存等更多相关知识的信息可以在本站进行查询。

本文标签: