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


C# Boss.GetRepeated方法代码示例

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


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

示例1: DoGetEntries

        private void DoGetEntries(NSTextView view, string selection, string language, Boss boss)
        {
            int group = 0;

            bool editable = view.isEditable();
            foreach (ITextContextCommands i in boss.GetRepeated<ITextContextCommands>())
            {
                var items = new List<TextContextItem>();
                i.Get(selection, language, editable, items);

                if (items.Count > 0)
                {
                    if (!items.All(item => item.Name == null))
                    {
                        for (int j = 0; j < items.Count; ++j)
                        {
                            m_entries.Add(new Entry(items[j], group));
                        }

                        ++group;
                    }
                }
            }
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:24,代码来源:BuildTextContextMenu.cs

示例2: DirectoryController

        public DirectoryController(string path)
            : base(NSObject.AllocAndInitInstance("DirectoryController"))
        {
            m_boss = ObjectModel.Create("DirectoryEditor");
            m_path = path;
            m_dirStyler = new DirectoryItemStyler(path);

            Unused.Value = NSBundle.loadNibNamed_owner(NSString.Create("directory-editor"), this);
            m_table = new IBOutlet<NSOutlineView>(this, "table").Value;
            m_targets = new IBOutlet<NSPopUpButton>(this, "targets").Value;
            m_prefs = new IBOutlet<DirPrefsController>(this, "prefsController");

            m_name = System.IO.Path.GetFileName(path);
            window().setTitle(NSString.Create(m_name));
            Unused.Value = window().setFrameAutosaveName(NSString.Create(window().title().ToString() + " editor"));
            window().makeKeyAndOrderFront(this);

            m_table.setDoubleAction("doubleClicked:");
            m_table.setTarget(this);

            var wind = m_boss.Get<IWindow>();
            wind.Window = window();

            m_builder = new GenericBuilder(path);

            m_targets.removeAllItems();
            if (m_builder.CanBuild)
            {
                var handler = m_boss.Get<IMenuHandler>();
                handler.Register(this, 50, this.DoBuild, this.DoBuildEnabled);
                handler.Register(this, 51, this.DoBuildVariables, this.DoHaveBuilder);
                handler.Register(this, 52, this.DoBuildFlags, this.DoHaveBuilder);
                handler.Register(this, 599, () => m_builder.Cancel(), this.DoCancelEnabled);
                handler.Register(this, 1000, this.DoShowPrefs);

                DoLoadPrefs(path);
                Broadcaster.Register("global ignores changed", this);
                Broadcaster.Register("finished building", this);
                DoUpdateTargets(string.Empty, null);
            }
            else
                DoLoadPrefs(path);

            m_root = new FolderItem(m_path, m_dirStyler, this);
            m_table.reloadData();

            m_watcher = DoCreateWatcher(path);
            if (m_watcher != null)
                m_watcher.Changed += this.DoDirChanged;

            //			m_watcher = new FileSystemWatcher(path);
            //			m_watcher.IncludeSubdirectories = true;
            //			m_watcher.Created += this.DoDirChanged;
            //			m_watcher.Deleted += this.DoDirChanged;
            //			m_watcher.Renamed += this.DoDirChanged;

            foreach (IOpened open in m_boss.GetRepeated<IOpened>())
            {
                open.Opened();
            }
            Broadcaster.Invoke("opened directory", m_boss);

            ActiveObjects.Add(this);
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:64,代码来源:DirectoryController.cs


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