当前位置: 首页>>代码示例>>C#>>正文


C# SelectedItemCollection.GetConnectionOfFirstItem方法代码示例

本文整理汇总了C#中SelectedItemCollection.GetConnectionOfFirstItem方法的典型用法代码示例。如果您正苦于以下问题:C# SelectedItemCollection.GetConnectionOfFirstItem方法的具体用法?C# SelectedItemCollection.GetConnectionOfFirstItem怎么用?C# SelectedItemCollection.GetConnectionOfFirstItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SelectedItemCollection的用法示例。


在下文中一共展示了SelectedItemCollection.GetConnectionOfFirstItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteCore

        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            var con = selection.GetConnectionOfFirstItem();

            if (Helpers.FeatureForbidden(con, Host.RestrictCrossPoolMigrate))
            {
                ShowUpsellDialog(Parent);
            }
            else
            {
                MainWindowCommandInterface.ShowPerConnectionWizard(con,
                    new CrossPoolMigrateWizard(con, selection, preSelectedHost, WizardMode.Copy));
            }
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:14,代码来源:CrossPoolCopyVMCommand.cs

示例2: CanExecuteCore

            protected override bool CanExecuteCore(SelectedItemCollection selection)
            {
                IXenConnection connection = selection.GetConnectionOfFirstItem();

                bool atLeastOneCanExecute = false;
                foreach (SelectedItem item in selection)
                {
                    //all items should be VMs
                    VM vm = item.XenObject as VM;
                    if (vm == null)
                        return false;

                    // all VMs must be on the same connection
                    if (connection != null && vm.Connection != connection)
                        return false;

                    //at least one VM should be able to execute
                    if (CanExecute(vm))
                        atLeastOneCanExecute = true;

                }
                return atLeastOneCanExecute;
            }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:23,代码来源:MigrateVMToolStripMenuItem.cs

示例3: ExecuteCore

		protected override void ExecuteCore(SelectedItemCollection selection)
		{
			var con = selection.GetConnectionOfFirstItem();
			MainWindowCommandInterface.ShowPerConnectionWizard(con, new ImportWizard(con, selection.FirstAsXenObject, null, false));
		}
开发者ID:huizh,项目名称:xenadmin,代码行数:5,代码来源:ImPortCommand.cs

示例4: ExecuteCore

 protected override void ExecuteCore(SelectedItemCollection selection)
 {
     var vdis = selection.AsXenObjects<VDI>();
     new MoveVirtualDiskDialog(selection.GetConnectionOfFirstItem(), vdis, null).Show(Program.MainWindow);
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:5,代码来源:MoveVirtualDiskCommand.cs

示例5: ExecuteCore

 protected override void ExecuteCore(SelectedItemCollection selection)
 {
     var con = selection.GetConnectionOfFirstItem();
     MainWindowCommandInterface.ShowPerConnectionWizard(con, new ExportApplianceWizard(con, selection));
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:5,代码来源:ExportCommand.cs


注:本文中的SelectedItemCollection.GetConnectionOfFirstItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。