public IMForm(CoreUI ui) : base(ui.Core) { InitializeComponent(); UI = ui; Core = ui.Core; GuiUtils.SetupToolstrip(TopStrip, new OpusColorTable()); GuiUtils.FixMonoDropDownOpening(OptionsButton, OptionsButton_DropDownOpening); UI.ShowView += ShowExternal; Text = "IM - " + Core.GetName(Core.UserID); BuddyList.Init(UI, Core.Buddies, SelectionInfo, true); IM = UI.GetService(ServiceIDs.IM) as IMUI; SelectionInfo.Init(UI); SelectionInfo.ShowNetwork(); if (GuiUtils.IsRunningOnMono()) { AddButton.Text = "Add"; SharedButton.Text = "Files"; } Rectangle screen = Screen.GetWorkingArea(this); Location = new Point(screen.Width - Width, screen.Height / 2 - Height / 2); ShowExternal(new Info.InfoView(Core, false, true)); }
public CoreUI(OpCore core) { Core = core; // load menus for loaded services foreach (var service in Core.ServiceMap.Values) { var id = service.ServiceID; if (id == ServiceIDs.Board) Services[id] = new BoardUI(this, service); if (id == ServiceIDs.Buddy) Services[id] = new BuddyUI(this, service); if (id == ServiceIDs.Chat) Services[id] = new ChatUI(this, service); if (id == ServiceIDs.IM) Services[id] = new IMUI(this, service); if (id == ServiceIDs.Mail) Services[id] = new MailUI(this, service); if (id == ServiceIDs.Plan) Services[id] = new PlanUI(this, service); if (id == ServiceIDs.Profile) Services[id] = new ProfileUI(this, service); if (id == ServiceIDs.Share) Services[id] = new ShareUI(this, service); if (id == ServiceIDs.Storage) Services[id] = new StorageUI(this, service); if (id == ServiceIDs.Trust) Services[id] = new TrustUI(this, service); } Core.RunInGui += Core_RunInGui; Core.UpdateConsole += Core_UpdateConsole; Core.ShowConfirm += Core_ShowConfirm; Core.ShowMessage += Core_ShowMessage; Core.VerifyPass += Core_VerifyPass; Core_UpdateConsole("DeOps " + Application.ProductVersion); }
public void Init(CoreUI ui) { UI = ui; Core = ui.Core; Trust = UI.GetService(ServiceIDs.Trust) as TrustUI; IM = UI.GetService(ServiceIDs.IM) as IMUI; Mail = UI.GetService(ServiceIDs.Mail) as MailUI; Buddy = UI.GetService(ServiceIDs.Buddy) as BuddyUI; Core.Locations.GuiUpdate += new LocationGuiUpdateHandler(Location_Update); Core.Buddies.GuiUpdate += new BuddyGuiUpdateHandler(Buddy_Update); if (Core.Trust != null) Core.Trust.GuiUpdate += new LinkGuiUpdateHandler(Trust_Update); IMImg = ExtractImage("IM", DeOps.Services.IM.IMRes.Icon.ToBitmap()); MailImg = ExtractImage("Mail", DeOps.Services.Mail.MailRes.Mail); BuddyWhoImg = ExtractImage("BuddyWho", DeOps.Services.Buddy.BuddyRes.buddy_who); TrustImg = ExtractImage("Trust", DeOps.Services.Trust.LinkRes.linkup); UntrustImg = ExtractImage("Untrust", DeOps.Services.Trust.LinkRes.unlink); RegImg = ExtractImage("Reg", InterfaceRes.reg); ShowNetwork(); }