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


C# Plan.TryAddSet方法代码示例

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


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

示例1: miCopyToNewPlan_Click

        /// <summary>
        /// Context > Copy to new plan...
        /// Opens a dialog to prompt the user for a name and create a plan with the selected entries.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void miCopyToNewPlan_Click(object sender, EventArgs e)
        {
            IList<PlanEntry> entries = SelectedEntries.ToList();
            if (!entries.Any())
                return;

            // Ask the user for a new name
            string planName,
                   planDescription;
            using (NewPlanWindow npw = new NewPlanWindow())
            {
                DialogResult dr = npw.ShowDialog();
                if (dr == DialogResult.Cancel)
                    return;
                planName = npw.PlanName;
                planDescription = npw.PlanDescription;
            }

            // Create a new plan
            Plan newPlan = new Plan(m_character) { Name = planName, Description = planDescription };
            IPlanOperation operation = newPlan.TryAddSet(entries, $"Exported from {m_plan.Name}");
            operation.Perform();

            // Add plan and save
            m_character.Plans.Add(newPlan);
        }
开发者ID:RapidFiring,项目名称:evemon,代码行数:32,代码来源:PlanEditorControl.cs

示例2: miCopySelectedToClipboard_Click

        /// <summary>
        /// Context > Copy selected skills to Clipboard
        /// Copy selected entries to clipoboard 
        /// for importation in EVE client Skill Queue
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void miCopySelectedToClipboard_Click(object sender, EventArgs e)
        {
            // Create a new plan
            Plan newPlan = new Plan(m_character);
            IPlanOperation operation = newPlan.TryAddSet(SelectedEntries, $"Exported from {m_plan.Name}");
            operation.Perform();

            // Prompt the user for settings. When null, the user cancelled
            PlanExportSettings settings = UIHelper.PromptUserForPlanExportSettings(newPlan);
            if (settings == null)
                return;
            
            string output = PlanIOHelper.ExportAsText(newPlan, settings);

            // Copy the result to the clipboard
            try
            {
                Clipboard.Clear();
                Clipboard.SetText(output);

                MessageBox.Show(@"The selected entries have been copied to the clipboard.",
                    @"Plan Copied",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
            catch (ExternalException ex)
            {
                ExceptionHandler.LogException(ex, true);

                MessageBox.Show(@"The copy to clipboard has failed. You may retry later.",
                    @"Plan Copy Failure",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
        }
开发者ID:RapidFiring,项目名称:evemon,代码行数:42,代码来源:PlanEditorControl.cs

示例3: miCopyToNewPlan_Click

        /// <summary>
        /// Context > Copy to new plan...
        /// Opens a dialog to prompt the user for a name and create a plan with the selected entries.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void miCopyToNewPlan_Click(object sender, EventArgs e)
        {
            var entries = SelectedEntries;
            if (entries.IsEmpty())
                return;

            // Ask the user for a new name
            string planName;
            using (NewPlanWindow npw = new NewPlanWindow())
            {
                DialogResult dr = npw.ShowDialog();
                if (dr == DialogResult.Cancel)
                    return;
                planName = npw.Result;
            }

            // Create a new plan
            Plan newPlan = new Plan(Character);
            newPlan.Name = planName;
            var operation = newPlan.TryAddSet(entries, "Exported from " + m_plan.Name);
            operation.Perform();

            // Add plan and save
            Character.Plans.Add(newPlan);
        }
开发者ID:wow4all,项目名称:evemu_server,代码行数:31,代码来源:PlanEditorControl.cs


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