public void Create(ribbonTab myTab) { m_myTab = myTab; string imagePath = MMUtils.imagePath; try { m_rgPlaces = m_myTab.Groups.Add(0, MMUtils.GetString("places.group.name"), "www.palmaross.com", imagePath + "lists_s.png"); m_cmdNewPlace = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "NewPlace"); m_cmdNewPlace.Caption = MMUtils.GetString("places.commands.newplace.caption"); m_cmdNewPlace.ToolTip = MMUtils.GetString("places.commands.newplace.tooltip") + "\n" + m_cmdNewPlace.Caption; m_cmdNewPlace.LargeImagePath = MMUtils.imagePath + "common_stock.png"; m_cmdNewPlace.ImagePath = imagePath + "audio.png"; m_cmdNewPlace.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdNewPlace_UpdateState); m_cmdNewPlace.Click += new ICommandEvents_ClickEventHandler(m_cmdNewPlace_Click); m_ctrlNewPlace = m_rgPlaces.GroupControls.AddButton(m_cmdNewPlace); m_cmdManagePlaces = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ManagePlaces"); m_cmdManagePlaces.Caption = MMUtils.GetString("places.commands.manageplaces.caption"); m_cmdManagePlaces.ToolTip = MMUtils.GetString("places.commands.manageplaces.tooltip") + "\n" + m_cmdManagePlaces.Caption; m_cmdManagePlaces.LargeImagePath = MMUtils.imagePath + "common_stock.png"; m_cmdManagePlaces.ImagePath = imagePath + "audio.png"; m_cmdManagePlaces.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdManagePlaces_UpdateState); m_cmdManagePlaces.Click += new ICommandEvents_ClickEventHandler(m_cmdManagePlaces_Click); m_ctrlManagePlaces = m_rgPlaces.GroupControls.AddTwoPartButton(m_cmdManagePlaces); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
public void Create(ribbonTab myTab) { m_myTab = myTab; string imagePath = MMUtils.imagePath; m_rgProjects = m_myTab.Groups.Add(0, MMUtils.GetString("projects.group.name"), "www.palmaross.com", imagePath + "lists_s.png"); m_cmdNewProject = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "NewProject"); m_cmdNewProject.Caption = MMUtils.GetString("projects.commands.newproject.caption"); m_cmdNewProject.ToolTip = MMUtils.GetString("projects.commands.newproject.tooltip") + "\n" + m_cmdNewProject.Caption; m_cmdNewProject.LargeImagePath = imagePath + "common_stock.png"; m_cmdNewProject.ImagePath = imagePath + "audio.png"; m_cmdNewProject.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdNewProject_UpdateState); m_cmdNewProject.Click += new ICommandEvents_ClickEventHandler(m_cmdNewProject_Click); m_ctrlNewProject = m_rgProjects.GroupControls.AddButton(m_cmdNewProject); m_cmdManageProjects = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ManageProjects"); m_cmdManageProjects.Caption = MMUtils.GetString("projects.commands.manageprojects.caption"); m_cmdManageProjects.ToolTip = MMUtils.GetString("projects.commands.manageprojects.tooltip") + "\n" + m_cmdManageProjects.Caption; m_cmdManageProjects.LargeImagePath = imagePath + "common_stock.png"; m_cmdManageProjects.ImagePath = imagePath + "audio.png"; m_cmdManageProjects.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdManageProjects_UpdateState); m_cmdManageProjects.Click += new ICommandEvents_ClickEventHandler(m_cmdManageProjects_Click); m_ctrlManageProjects = m_rgProjects.GroupControls.AddTwoPartButton(m_cmdManageProjects); m_cmdShareProjects = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ShareProjects"); m_cmdShareProjects.Caption = MMUtils.GetString("projects.commands.shareprojects.caption"); m_cmdShareProjects.ToolTip = MMUtils.GetString("projects.commands.shareprojects.tooltip") + "\n" + m_cmdShareProjects.Caption; m_cmdShareProjects.LargeImagePath = imagePath + "common_stock.png"; m_cmdShareProjects.ImagePath = imagePath + "audio.png"; m_cmdShareProjects.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdShareProjects_UpdateState); m_cmdShareProjects.Click += new ICommandEvents_ClickEventHandler(m_cmdShareProjects_Click); m_ctrlShareProjects = m_rgProjects.GroupControls.AddButton(m_cmdShareProjects); m_cmdShareProject = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ShareProject"); m_cmdShareProject.Caption = MMUtils.GetString("projects.commands.shareproject.caption"); m_cmdShareProject.ImagePath = imagePath + "audio.png"; m_cmdShareProject.Click += new ICommandEvents_ClickEventHandler(m_cmdShareProject_Click); m_cmdShareProject.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdShareProject_UpdateState); m_ctrlShareProject = m_ctrlShareProjects.Controls.AddButton(m_cmdShareProject); m_cmdReceiveProject = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ReceiveProject"); m_cmdReceiveProject.Caption = MMUtils.GetString("projects.commands.receiveproject.caption"); m_cmdReceiveProject.ImagePath = imagePath + "audio.png"; m_cmdReceiveProject.Click += new ICommandEvents_ClickEventHandler(m_cmdReceiveProject_Click); m_cmdReceiveProject.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdReceiveProject_UpdateState); m_ctrlReceiveProject = m_ctrlShareProjects.Controls.AddButton(m_cmdReceiveProject); }
public void Create(ribbonTab myTab) { m_myTab = myTab; string imagePath = MMUtils.imagePath; m_rgMaps = m_myTab.Groups.Add(0, MMUtils.GetString("about.group.name"), "www.palmaross.com", imagePath + "lists_s.png"); m_cmdHelp = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "SynergyHelp"); m_cmdHelp.Caption = MMUtils.GetString("about.commands.help.caption"); m_cmdHelp.ToolTip = MMUtils.GetString("about.commands.help.tooltip") + "\n" + m_cmdHelp.Caption; m_cmdHelp.LargeImagePath = MMUtils.imagePath + "common_stock.png"; m_cmdHelp.ImagePath = imagePath + "audio.png"; m_cmdHelp.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdHelp_UpdateState); m_cmdHelp.Click += new ICommandEvents_ClickEventHandler(m_cmdHelp_Click); m_ctrlHelp = m_rgMaps.GroupControls.AddButton(m_cmdHelp); }
public void Create(ribbonTab myTab) { m_myTab = myTab; // Init SaveChanges SC = new Changes.SaveChanges(); LOGIN = new Login.LoginToSynergy(); LOGIN.Init(); // There are the only exemplares of these dialogs! dlgUsersOnline = new MapUsersDlg(); InternetChecking = new InternetCheckDlg(); m_menus = new SubMenus(); string imagePath = MMUtils.imagePath; reopenmaps_timer = new System.Windows.Forms.Timer { Interval = 50 }; reopenmaps_timer.Tick += new EventHandler(Reopenmaps_Timer_Tick); try { m_rgMaps = m_myTab.Groups.Add(0, MMUtils.GetString("maps.group.name"), "www.palmaross.com", imagePath + "lists_s.png"); m_cmdOpenMaps = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "OpenMap"); m_cmdOpenMaps.Caption = MMUtils.GetString("maps.commands.open.caption"); m_cmdOpenMaps.ToolTip = MMUtils.GetString("maps.commands.open.tooltip") + "\n" + m_cmdOpenMaps.Caption; m_cmdOpenMaps.LargeImagePath = MMUtils.imagePath + "common_stock.png"; m_cmdOpenMaps.ImagePath = imagePath + "audio.png"; m_cmdOpenMaps.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdOpenMaps_UpdateState); m_cmdOpenMaps.Click += new ICommandEvents_ClickEventHandler(m_cmdOpenMaps_Click); m_ctrlOpenMaps = m_rgMaps.GroupControls.AddButton(m_cmdOpenMaps); m_UpdateOpenMap = true; m_cmdPublishMap = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "PublishMap"); m_cmdPublishMap.Caption = MMUtils.GetString("maps.commands.publish.caption"); m_cmdPublishMap.ToolTip = MMUtils.GetString("maps.commands.publish.tooltip") + "\n" + m_cmdPublishMap.Caption; m_cmdPublishMap.LargeImagePath = imagePath + "common_stock.png"; m_cmdPublishMap.ImagePath = imagePath + "audio.png"; m_cmdPublishMap.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdPublishMap_UpdateState); m_cmdPublishMap.Click += new ICommandEvents_ClickEventHandler(m_cmdPublishMap_Click); m_ctrlPublishMap = m_rgMaps.GroupControls.AddButton(m_cmdPublishMap); m_cmdShareMaps = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ShareMaps"); m_cmdShareMaps.Caption = MMUtils.GetString("maps.commands.share.caption"); m_cmdShareMaps.ToolTip = MMUtils.GetString("maps.commands.share.tooltip") + "\n" + m_cmdShareMaps.Caption; m_cmdShareMaps.LargeImagePath = imagePath + "common_stock.png"; m_cmdShareMaps.ImagePath = imagePath + "common_stock_s.png"; m_cmdShareMaps.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdShareMaps_UpdateState); //m_cmdShareMaps.Click += new ICommandEvents_ClickEventHandler(m_cmdShareMaps_Click); m_ctrlShareMaps = m_rgMaps.GroupControls.AddButton(m_cmdShareMaps); m_cmdShareMap = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ShareMap"); m_cmdShareMap.Caption = MMUtils.GetString("maps.commands.sharemap.caption"); m_cmdShareMap.ImagePath = imagePath + "common_stock_s.png"; m_cmdShareMap.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdShareMap_UpdateState); m_cmdShareMap.Click += new ICommandEvents_ClickEventHandler(m_cmdShareMap_Click); m_ctrlShareMap = m_ctrlShareMaps.Controls.AddButton(m_cmdShareMap); m_cmdReceiveMap = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ReceiveMap"); m_cmdReceiveMap.Caption = MMUtils.GetString("maps.commands.receivemap.caption"); m_cmdReceiveMap.ImagePath = imagePath + "common_stock_s.png"; m_cmdReceiveMap.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdReceiveMap_UpdateState); m_cmdReceiveMap.Click += new ICommandEvents_ClickEventHandler(m_cmdReceiveMap_Click); m_ctrlReceiveMap = m_ctrlShareMaps.Controls.AddButton(m_cmdReceiveMap); //m_cmdDeleteMap = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "DeleteMap"); //m_cmdDeleteMap.Caption = MMUtils.getString("maps.commands.delete.caption"); //m_cmdDeleteMap.ToolTip = MMUtils.getString("maps.commands.delete.tooltip") + "\n" + m_cmdDeleteMap.Caption; //m_cmdDeleteMap.LargeImagePath = imagePath + "common_stock.png"; //m_cmdDeleteMap.ImagePath = imagePath + "common_stock_s.png"; //m_cmdDeleteMap.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdDeleteMap_UpdateState); //m_cmdDeleteMap.Click += new ICommandEvents_ClickEventHandler(m_cmdDeleteMap_Click); //m_ctrlDeleteMap = m_rgMaps.GroupControls.AddButton(m_cmdDeleteMap); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } if (MMUtils.MindManager.AllDocuments.Count == 0) { DestroyTimer(); return; } bool _closeSynergyMaps = false; // Reopen and process opened Synergy maps at MindManager start (if user wants to log in Synergy) // TODO возможно, придется итерировать через for - проверить закрытие на нескольких открытых при старте карт Synergy List <Document> _allmaps = new List <Document>(); foreach (Document _doc in MMUtils.MindManager.AllDocuments) { _allmaps.Add(_doc); } for (int i = 0; i < _allmaps.Count; i++) { if (_allmaps[i].HasAttributesNamespace[SUtils.SYNERGYNAMESPACE] == false) { continue; } if (_closeSynergyMaps) { DocumentStorage.closeMap = true; _allmaps[i].Close(); continue; } if (LOGIN.logged == false) // user not logged in Synergy yet { if (System.Windows.Forms.MessageBox.Show( MMUtils.GetString("maps.usernotlogged.message"), MMUtils.GetString("maps.synergywarning.caption"), System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { LOGIN.m_cmdLogin_Click(); } if (LOGIN.logged == false) // user don't want to log in Synergy { _closeSynergyMaps = true; DocumentStorage.closeMap = true; _allmaps[i].Close(); continue; } } _reopenmaps.Add(_allmaps[i]); } // Timer to reopen maps (because from here we can't open maps) if (_reopenmaps.Count > 0) { reopenmaps_timer.Start(); } else { DestroyTimer(); } _allmaps.Clear(); }