public OutlookPage(IStatusService statusService, IPageService pageSvc, IIconResourceService iconService, IPartRegistry partRegsistry) { m_StatusService = statusService; _pageSvc = pageSvc; _iconService = iconService; _partRegsistry = partRegsistry; }
public static Image GetImage(string iconId, string defaultId, IIconResourceService iconService, IVirtualFileSystem virtualFs) { try { if (iconId.StartsWith("$(file)/")) { string path = GetPath(iconId.Substring("$(file)/".Length), virtualFs); if (string.IsNullOrEmpty(path)) { return(iconService.GetBitmap(defaultId)); } else { return(Image.FromFile(path)); } } else { return(iconService.GetBitmap(iconId)); } } catch { return(iconService.GetBitmap(defaultId)); } }
public ContactPage(IBundleService bundleService , IIconResourceService iconResourceService , IPageService pageService , IVirtualFileSystem virtualFileSystem , IDbSessionFactory sessionFactory) : base(bundleService, iconResourceService, pageService, virtualFileSystem) { m_sessionFactory = sessionFactory; }
public MailPage(IBundleService bundleService , IIconResourceService iconResourceService , IPageService pageService , IVirtualFileSystem virtualFileSystem , IDbSessionFactory sessionFactory) : base(bundleService, iconResourceService, pageService, virtualFileSystem) { m_sessionFactory = sessionFactory; Initialize(); }
public TreePage(IBundleService bundleService , IIconResourceService iconResourceService , IPageService pageService , IVirtualFileSystem virtualFileSystem) { m_BundleService = bundleService; m_IconResourceService = iconResourceService; m_ToolStripFactory = pageService.PageLayoutProvider.ToolbarFactory; m_VirtualFileSystem = virtualFileSystem; }
public NewFolderCommand(ISelectionService selectionService , IDbSessionFactory sessionFactory , IExtensionRegistry extensionRegistry , IHierarchyDecoratorService contentService , IIconResourceService iconResourceService , IVirtualFileSystem virtualFs) : base(selectionService, sessionFactory, "InsertFolder") { _extensionRegistry = extensionRegistry; _contentService = contentService; _iconResourceService = iconResourceService; _virtualFs = virtualFs; }
public OutlookBar(IPageService pageSvc, IIconResourceService iconService, IPartRegistry partRegsistry, IViewPart viewPart) { _pageSvc = pageSvc; _iconService = iconService; _partRegsistry = partRegsistry; List <string> collection = new List <string>(); string selected = null; System.IO.TextReader textReader = new System.IO.StringReader(viewPart.ConfigurationXml); using (XmlReader reader = XmlReader.Create(textReader, XmlUtils.CreateFragmentReaderSettings(), XmlUtils.CreateParserContext())) { reader.ReadStartElement("viewSet"); //NON-NLS-1 while (reader.IsStartElement("viewBar")) //NON-NLS-1 { string id = XmlUtils.ReadAttribute(reader, "ref"); collection.Add(id); if (string.IsNullOrEmpty(selected)) { selected = id; } else if (0 == string.Compare("true", XmlUtils.ReadOptionalAttributeString(reader, "selected"), true)) { selected = id; } reader.ReadStartElement(); } reader.ReadEndElement(); //while (reader.Read()) //{ // if( reader.IsStartElement("viewBar") ) // collection.Add( XmlUtils.ReadAttribute(reader, "ref") ); //} } foreach (string config in collection) { IViewPart viewBar = _partRegsistry.Get <IViewPart>(config); Add(viewBar.Id, viewBar.Name, _iconService.GetBitmap(viewBar.IconId), viewBar.Widget); if (viewBar.Id == selected) { Switch(selected); } } }
public MessageExplorer(IBundleService bundleService , IIconResourceService iconResourceService , IDbSessionFactory sessionFactory , IPartRegistry partRegistry , IPageService pageService , IVirtualFileSystem virtualFileSystem) { m_BundleService = bundleService; m_IconResourceService = iconResourceService; m_sessionFactory = sessionFactory; m_PartRegistry = partRegistry; m_PageService = pageService; m_ToolStripFactory = pageService.PageLayoutProvider.ToolbarFactory; m_VirtualFileSystem = virtualFileSystem; }
public LayoutProvider( IExtensionRegistry extensionRegistry, IIconResourceService iconResourceService, IPartRegistry partRegistry, IStatusService statusService, IObjectBuilderService objectBuilder, IKeyBindingService keyBindingService) { m_ExtensionRegistry = extensionRegistry; m_IconResourceService = iconResourceService; m_PartRegistry = partRegistry; m_StatusService = statusService; m_ObjectBuilder = objectBuilder; m_KeyBindingService = keyBindingService; m_ActiveToolStrips = new Dictionary <IWorkbenchPart, ToolStrip>(); }
public ContentWidget(IViewPart viewPart, IIconResourceService iconResourceService, IKeyBindingService keyBindingService, bool lazy) { InitializeComponent(); m_ViewPart = viewPart; m_IconResourceService = iconResourceService; m_KeyBindingService = keyBindingService; Text = viewPart.Name; Name = viewPart.Id; //if (!string.IsNullOrEmpty(viewPart.IconId)) //{ // Icon = m_IconResourceService.GetIcon(viewPart.IconId); // ShowIcon = true; //} if (!lazy) { CreateAndApplyViewControl(); } KeyDown += HandleKeyInput; //Closing += ViewPart_Closing; }
public ToolbarFactory(IActionService actionService, IIconResourceService iconService) { m_ActionService = actionService; m_IconResourceService = iconService; }
public MessageExplorerWidget(IBundleService bundleService , IIconResourceService iconResourceService , IDbSessionFactory sessionFactory , IPartRegistry partRegistry , IPageService pageService , IVirtualFileSystem virtualFileSystem , IViewPart viewPart) { m_BundleService = bundleService; m_IconResourceService = iconResourceService; m_sessionFactory = sessionFactory; m_PartRegistry = partRegistry; m_PageService = pageService; m_ToolStripFactory = pageService.PageLayoutProvider.ToolbarFactory; m_VirtualFileSystem = virtualFileSystem; m_viewPart = viewPart; InitializeComponent(); m_image_mail = iconResourceService.GetImage("jingxian.ui.icons.mail.png"); m_image_open_mail = iconResourceService.GetIcon("jingxian.ui.icons.maillist.open_mail.ico").ToBitmap(); m_image_close_mail = iconResourceService.GetIcon("jingxian.ui.icons.maillist.close_mail.ico").ToBitmap(); m_image_litter_point = iconResourceService.GetImage("jingxian.ui.icons.maillist.litter_point.png"); m_image_big_point = iconResourceService.GetImage("jingxian.ui.icons.maillist.big_point.png"); m_image_spam = iconResourceService.GetImage("jingxian.ui.icons.maillist.spam.png"); m_image_red_flag = iconResourceService.GetImage("jingxian.ui.icons.maillist.red_flag.png"); m_image_gray_flag = iconResourceService.GetImage("jingxian.ui.icons.maillist.gray_flag.png"); m_image_right = iconResourceService.GetImage("jingxian.ui.icons.maillist.right.png"); m_image_open_mail = iconResourceService.GetIcon("jingxian.ui.icons.maillist.open_mail.ico").ToBitmap(); m_image_close_mail = iconResourceService.GetIcon("jingxian.ui.icons.maillist.close_mail.ico").ToBitmap(); m_image_litter_point = iconResourceService.GetBitmap("jingxian.ui.icons.maillist.litter_point.png"); m_image_big_point = iconResourceService.GetBitmap("jingxian.ui.icons.maillist.big_point.png"); m_image_spam = iconResourceService.GetBitmap("jingxian.ui.icons.maillist.spam.png"); m_image_red_flag = iconResourceService.GetBitmap("jingxian.ui.icons.maillist.red_flag.png"); m_image_gray_flag = iconResourceService.GetBitmap("jingxian.ui.icons.maillist.gray_flag.png"); m_image_right = iconResourceService.GetBitmap("jingxian.ui.icons.maillist.right.png"); LoadAllMessages(); string startView = null; System.IO.TextReader textReader = new System.IO.StringReader(m_viewPart.ConfigurationXml); using (XmlReader reader = XmlReader.Create(textReader, XmlUtils.CreateFragmentReaderSettings(), XmlUtils.CreateParserContext())) { if (reader.IsStartElement("view")) { startView = XmlUtils.ReadRequiredAttributeString(reader, "ref"); } } if (string.IsNullOrEmpty(startView)) { return; } IWorkbenchPart welcomePart; m_PartRegistry.TryGet(jingxian.ui.Constants.WelcomeId, out welcomePart); if (null == welcomePart) { return; } UserControl control = new UserControl(); control.BorderStyle = BorderStyle.Fixed3D; control.Dock = DockStyle.Fill; this.m_splitter.Panel2.Controls.Add(control); Control welcomePage = welcomePart.Widget; welcomePage.Dock = DockStyle.Fill; control.Controls.Add(welcomePage); }
public ListExplorer(IBundleService bundleService , IIconResourceService iconResourceService , IPartRegistry partRegistry , IPageService pageService , IVirtualFileSystem virtualFileSystem , IViewPart viewPart) { m_BundleService = bundleService; m_IconResourceService = iconResourceService; m_PartRegistry = partRegistry; m_PageService = pageService; m_ToolStripFactory = pageService.PageLayoutProvider.ToolbarFactory; m_VirtualFileSystem = virtualFileSystem; m_viewPart = viewPart; InitializeComponent(); DataExplorerConfiguration config = null; System.IO.TextReader textReader = new System.IO.StringReader(m_viewPart.ConfigurationXml); using (XmlReader reader = XmlReader.Create(textReader, XmlUtils.CreateFragmentReaderSettings(), XmlUtils.CreateParserContext())) { config = XmlUtils.ReadElement <DataExplorerConfiguration>(reader, "dataExplorer"); } foreach (ColumnModelConfiguration columnConfiguration in config.Table.Columns) { IFieldDescriptor descriptor = CreateDescriptor(columnConfiguration.Type); if (!string.IsNullOrEmpty(columnConfiguration.Text)) { descriptor.Column.Text = columnConfiguration.Text; } if (!string.IsNullOrEmpty(columnConfiguration.Format)) { descriptor.Column.Format = columnConfiguration.Format; } if (!string.IsNullOrEmpty(columnConfiguration.Alignment)) { descriptor.Column.Alignment = (ColumnAlignment)Enum.Parse(typeof(ColumnAlignment), columnConfiguration.Alignment); } if (0 > columnConfiguration.Width) { descriptor.Column.Width = columnConfiguration.Width; } if (0 > columnConfiguration.ContentWidth) { descriptor.Column.ContentWidth = columnConfiguration.ContentWidth; } if (!string.IsNullOrEmpty(columnConfiguration.Image)) { descriptor.Column.Image = iconResourceService.GetImage(columnConfiguration.Image); } if (!columnConfiguration.ImageOnRight) { descriptor.Column.ImageOnRight = columnConfiguration.ImageOnRight; } if (!columnConfiguration.Visible) { descriptor.Column.Visible = columnConfiguration.Visible; } if (!columnConfiguration.Sortable) { descriptor.Column.Sortable = columnConfiguration.Sortable; } if (!columnConfiguration.Resizable) { descriptor.Column.Resizable = columnConfiguration.Resizable; } //if (!string.IsNullOrEmpty(columnConfiguration.DefaultComparerType)) // descriptor.Column.DefaultComparerType = Type.GetType( columnConfiguration.DefaultComparerType ); //if (!string.IsNullOrEmpty(columnConfiguration.SortOrder)) // descriptor.Column.SortOrder =(SortOrder)Enum.Parse(typeof(SortOrder), columnConfiguration.SortOrder ); if (!columnConfiguration.Editable) { descriptor.Column.Editable = columnConfiguration.Editable; } if (!columnConfiguration.Enabled) { descriptor.Column.Enabled = columnConfiguration.Enabled; } if (!columnConfiguration.Selectable) { descriptor.Column.Selectable = columnConfiguration.Selectable; } if (!string.IsNullOrEmpty(columnConfiguration.ToolTipText)) { descriptor.Column.ToolTipText = columnConfiguration.ToolTipText; } _fieldDescriptors.Add(descriptor); } }
public FolderPropertyDlg(IExtensionRegistry extensionRegistry , IHierarchyDecoratorService contentService , IIconResourceService iconResourceService , IVirtualFileSystem virtualFs , FolderWithBLOBs folder) { _extensionRegistry = extensionRegistry; _contentService = contentService; _iconResourceService = iconResourceService; _virtualFs = virtualFs; InitializeComponent(); this.archivingSettingPane.Initialize(extensionRegistry); foreach (string path in System.IO.Directory.GetFiles(_virtualFs.GetBinPath("icons"))) { try { Bitmap img = new Bitmap(Image.FromFile(path)); img.MakeTransparent(); string imageFile = "$(file)\\icons\\" + System.IO.Path.GetFileName(path); iconComboBox.Add(imageFile, img); } catch { } } string[] icons = new string[] { "jingxian.ui.icons.edit.png", "jingxian.folder.attachments.png", "jingxian.folder.calendar.png", "jingxian.folder.draft.png", "jingxian.folder.dynamicfolder.png", "jingxian.folder.inbox.png", "jingxian.folder.junk.png", "jingxian.folder.mailinglist.png", "jingxian.folder.newsgroup.png", "jingxian.folder.note.png", "jingxian.folder.outbox.png", "jingxian.folder.sent.png", "jingxian.folder.standard.png", "jingxian.folder.today.png", "jingxian.folder.trash.png" }; foreach (string path in icons) { try { Bitmap img = _iconResourceService.GetBitmap(path); img.MakeTransparent(); iconComboBox.Add(path, img); } catch { } } //foreach (object obj in _contentService.GetChildren(_iconResourceService)) //{ // PropertyContentProvider contentProvider = obj as PropertyContentProvider; // if (null == contentProvider || "allIcons" != contentProvider.Name ) // continue; //} if (null == folder) { return; } _folder = folder; this.txtFolderCaption.Text = folder.Name; this.iconComboBox.Select(folder.Icon); this.archivingSettingPane.Time = _folder.Misc["Timeout"]; this.archivingSettingPane.Action = _folder.Misc["ActionOfTimeout"]; }