本文整理汇总了C#中Gtk.ActionGroup.ListActions方法的典型用法代码示例。如果您正苦于以下问题:C# ActionGroup.ListActions方法的具体用法?C# ActionGroup.ListActions怎么用?C# ActionGroup.ListActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ActionGroup
的用法示例。
在下文中一共展示了ActionGroup.ListActions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getUi
private string getUi(ActionGroup actionGroup)
{
string uiItems = "";
foreach (Gtk.Action action in actionGroup.ListActions())
uiItems = uiItems + String.Format (uiItem, action.Name);
return prefix + uiItems + sufix;
}
示例2: MainWindow
public MainWindow (): base (MainClass.AppName)
{
this.Build();
_views = new IGedcomView[]
{
SummaryViewView,
FamilyViewView,
IndividualViewView
};
_viewActions = new Gtk.Action[]
{
SummaryViewAction,
FamilyViewAction,
IndividualViewAction,
SourceViewAction,
MultimediaViewAction,
RepositoryViewAction,
PedigreeViewAction,
NoteViewAction
};
foreach (IGedcomView view in _views)
{
view.MoreInformation += new EventHandler<IndividualArgs>(OnMoreInformation);
view.MoreFamilyInformation += new EventHandler<FamilyArgs>(OnMoreFamilyInformation);
view.SpouseSelect += new EventHandler<SpouseSelectArgs>(OnSpouseSelect);
view.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
view.SelectNewChild += new EventHandler<IndividualArgs>(OnSelectNewChild);
view.SelectNewSpouse += new EventHandler<IndividualArgs>(OnSelectNewSpouse);
view.SelectNewNote += new EventHandler<NoteArgs>(OnSelectNewNote);
view.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
view.ShowName += new EventHandler<IndividualArgs>(OnShowName);
view.DeleteIndividual += new EventHandler<IndividualArgs>(OnDeleteIndividual);
view.MoreFactInformation += new EventHandler<FactArgs>(OnMoreFactInformation);
}
SourceViewView.ShowScrapBook += new EventHandler<ScrapBookArgs>(OnShowScrapBook);
SourceViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
MultimediaViewView.AddFile += new EventHandler<MultimediaFileArgs>(OnMultimediaView_AddFile);
MultimediaViewView.OpenFile += new EventHandler<MultimediaFileArgs>(OnMultimediaView_OpenFile);
MultimediaViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
RepositoryViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
NotesViewView.ShowSourceCitation += new EventHandler<SourceCitationArgs>(OnShowSourceCitation);
// FIXME: not working via property in designer show all kicking in?
NotesViewView.NoteOnly = true;
ViewNotebook.ShowTabs = false;
ViewNotebook.Page = 0;
_currentView = _views[0];
ViewNotebook.Sensitive = false;
Merge.Sensitive = false;
Save.Sensitive = false;
SaveAs.Sensitive = false;
PropertiesAction.Sensitive = false;
_viewGroup = View.ActionGroup;
_toolsGroup = Tools.ActionGroup;
_reportsGroup = Reports.ActionGroup;
_defaultGroup = New.ActionGroup;
// get all report related actions, make insensitive
foreach (Gtk.Action action in _reportsGroup.ListActions())
{
action.Sensitive = false;
}
// get all tools related actions, make insensitive
foreach (Gtk.Action action in _toolsGroup.ListActions())
{
action.Sensitive = false;
}
// get all view related actions, make insensitive
foreach (Gtk.Action action in _viewGroup.ListActions())
{
action.Sensitive = false;
}
SummaryViewAction.ActionGroup.Sensitive = true;
NewIndividual.Sensitive = false;
NewMedia.Sensitive = false;
NewRepository.Sensitive = false;
NewSource.Sensitive = false;
NewNote.Sensitive = false;
// dropdown actions, not supported by stetic
Gtk.UIManager manager = new Gtk.UIManager();
GtkDropDownAction newDropDown = new GtkDropDownAction("New", "New", string.Empty, Gtk.Stock.New);
newDropDown.Activated += OnNew_Activated;
newDropDown.UIManager = manager;
newDropDown.MenuPath = "/newpopup";
manager.InsertActionGroup(_defaultGroup, 0);
manager.AddUiFromString("<ui><popup name='newpopup'><menuitem action='NewDatabase'/><menuitem action='NewIndividual'/><menuitem action='NewMedia'/><menuitem action='NewRepository'/><menuitem action='NewSource'/><menuitem action='NewNote'/></popup></ui>");
Gtk.Widget newButton = newDropDown.CreateToolItem();
newDropDown.ConnectProxy(newButton);
//.........这里部分代码省略.........