Ejemplo n.º 1
0
 public OutlookPage(IStatusService statusService, IPageService pageSvc, IIconResourceService iconService, IPartRegistry partRegsistry)
 {
     m_StatusService = statusService;
     _pageSvc        = pageSvc;
     _iconService    = iconService;
     _partRegsistry  = partRegsistry;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConventionPartCreator"/> class.
        /// </summary>
        /// <param name="registry">The <see cref="IPartRegistry{T}"/> instance that should be used by the part creator.</param>
        /// <exception cref="ArgumentNullException">The provided <paramref name="registry"/> was <see langword="null"/>.</exception>
        public ConventionPartCreator(IPartRegistry<IContractService> registry)
        {
            if (registry == null)
            {
                throw new ArgumentNullException("registry", "The registry cannot be null.");
            }

            this.Registry = registry;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConventionPartCreator"/> class.
        /// </summary>
        /// <param name="registry">The <see cref="IPartRegistry{T}"/> instance that should be used by the part creator.</param>
        /// <exception cref="ArgumentNullException">The provided <paramref name="registry"/> was <see langword="null"/>.</exception>
        public ConventionPartCreator(IPartRegistry <IContractService> registry)
        {
            if (registry == null)
            {
                throw new ArgumentNullException("registry", "The registry cannot be null.");
            }

            this.Registry = registry;
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
        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>();
        }
Ejemplo n.º 7
0
 private static bool TypeScannerIsNotNull(IPartRegistry<IContractService> registry)
 {
     return registry.TypeScanner != null;
 }
Ejemplo n.º 8
0
 private static IEnumerable<Type> GetTypesFromTypeScanner(IPartRegistry<IContractService> registry)
 {
     return registry.TypeScanner.GetTypes(t => true);
 }
Ejemplo n.º 9
0
 private static bool TypeScannerIsNotNull(IPartRegistry <IContractService> registry)
 {
     return(registry.TypeScanner != null);
 }
Ejemplo n.º 10
0
 private static IEnumerable <Type> GetTypesFromTypeScanner(IPartRegistry <IContractService> registry)
 {
     return(registry.TypeScanner.GetTypes(t => true));
 }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
            }
        }