예제 #1
0
        /// <summary>
        /// Finishes initializing component by creating ListView, and initializing it and subscribing it to events</summary>
        void IInitializable.Initialize()
        {
            m_resourcesListView = new ListView();
            m_resourcesListView.AllowDrop = true;
            m_resourcesListView.MultiSelect = true;
            m_resourcesListView.AllowColumnReorder = true;
            m_resourcesListView.LabelEdit = true;
            m_resourcesListView.Dock = DockStyle.Fill;

            m_resourcesListView.DragOver += resourcesListView_DragOver;
            m_resourcesListView.DragDrop += resourcesListView_DragDrop;
            m_resourcesListView.MouseUp += resourcesListView_MouseUp;
            m_resourcesListViewAdapter = new ListViewAdapter(m_resourcesListView);
            m_resourcesListViewAdapter.LabelEdited +=
                resourcesListViewAdapter_LabelEdited;

            m_resourcesControlInfo = new ControlInfo(
                "Resources".Localize(),
                "Resources for selected Event".Localize(),
                StandardControlGroup.Bottom);

            m_controlHostService.RegisterControl(m_resourcesListView, m_resourcesControlInfo, this);

            if (m_settingsService != null)
            {
                m_settingsService.RegisterSettings(this, new BoundPropertyDescriptor(this, () => ListViewSettings, "ListViewSettings", "", ""));
            }
        }
예제 #2
0
        /// <summary>
        /// Finishes initializing component by creating ListView and initializing it, subscribing to drag events,
        /// and registering the control</summary>
        void IInitializable.Initialize()
        {
            m_resourcesListView = new ListView();
            m_resourcesListView.SmallImageList = ResourceUtil.GetImageList16();
            m_resourcesListView.AllowDrop = true;
            m_resourcesListView.MultiSelect = true;
            m_resourcesListView.AllowColumnReorder = true;
            m_resourcesListView.LabelEdit = true;
            m_resourcesListView.Dock = DockStyle.Fill;

            m_resourcesListView.DragOver += new DragEventHandler(resourcesListView_DragOver);
            m_resourcesListView.DragDrop += new DragEventHandler(resourcesListView_DragDrop);
            m_resourcesListView.MouseUp += new MouseEventHandler(resourcesListView_MouseUp);
            m_resourcesListViewAdapter = new ListViewAdapter(m_resourcesListView);
            m_resourcesListViewAdapter.LabelEdited +=
                new EventHandler<LabelEditedEventArgs<object>>(resourcesListViewAdapter_LabelEdited);

            m_resourcesControlInfo = new ControlInfo(
                Localizer.Localize("Resources"),
                Localizer.Localize("Resources for selected Event"),
                StandardControlGroup.Bottom);

            m_controlHostService.RegisterControl(m_resourcesListView, m_resourcesControlInfo, this);

            if (m_settingsService != null)
            {
                SettingsServices.RegisterSettings(
                    m_settingsService,
                    this,
                    new BoundPropertyDescriptor(this, () => ListViewSettings, "ListViewSettings", "", "")
                );
            }
        }
예제 #3
0
        /// <summary>
        /// Finishes initializing component by creating ListView and initializing it, subscribing to drag events,
        /// and registering the control</summary>
        void IInitializable.Initialize()
        {
            m_characterListView = new ListView();
            //m_characterListView.SmallImageList = ResourceUtil.GetImageList16();
            m_characterListView.AllowDrop = false;
            m_characterListView.MultiSelect = true;
            m_characterListView.AllowColumnReorder = true;
            m_characterListView.LabelEdit = true;
            m_characterListView.Dock = DockStyle.Top;
            
            m_characterListView.MouseUp += characterListView_MouseUp;
            m_characteListViewAdapter = new ListViewAdapter(m_characterListView);
            m_characteListViewAdapter.LabelEdited +=
                resourcesListViewAdapter_LabelEdited;

            m_characteControlInfo = new ControlInfo(
                "Characters".Localize(),
                "Characters".Localize(),
                StandardControlGroup.Right);

            m_controlHostService.RegisterControl(m_characterListView, m_characteControlInfo, this);

            if (m_settingsService != null)
            {
                m_settingsService.RegisterSettings(this, new BoundPropertyDescriptor(this, () => ListViewSettings, "ListViewSettings", "", ""));
            }
        }
예제 #4
0
파일: ListViewEditor.cs 프로젝트: zparr/ATF
        /// <summary>
        /// Configures the editor</summary>
        /// <param name="listView">Control to display data</param>
        /// <param name="listViewAdapter">Adapter to drive control</param>
        /// <remarks>Default is to create a ListView and ListViewAdapter,
        /// using the global image lists.</remarks>
        protected virtual void Configure(
            out ListView listView,
            out ListViewAdapter listViewAdapter)
        {
            listView = new ListView();
            listView.SmallImageList = ResourceUtil.GetImageList16();
            listView.LargeImageList = ResourceUtil.GetImageList32();

            listViewAdapter = new ListViewAdapter(listView);
        }
예제 #5
0
        /// <summary>
        /// Configures the editor</summary>
        /// <param name="listView">Control to display data</param>
        /// <param name="listViewAdapter">Adapter to drive control</param>
        /// <remarks>Default is to create a ListView and ListViewAdapter,
        /// using the global image lists.</remarks>
        protected virtual void Configure(
            out ListView listView,
            out ListViewAdapter listViewAdapter)
        {
            listView = new ListView();
            listView.SmallImageList = ResourceUtil.GetImageList16();
            listView.LargeImageList = ResourceUtil.GetImageList32();

            listViewAdapter = new ListViewAdapter(listView);
        }
예제 #6
0
        /// <summary>
        /// Performs initialization when the adapter is connected to the event context's DomNode.
        /// Raises the HistoryContext NodeSet event and performs custom processing.</summary>
        protected override void OnNodeSet()
        {
            DomNode.AttributeChanged += DomNode_AttributeChanged;
            DomNode.ChildInserted += DomNode_ChildInserted;
            DomNode.ChildRemoved += DomNode_ChildRemoved;

            m_listViewAdapter = new ListViewAdapter(m_listView);
            m_listViewAdapter.AllowSorting = true;
            m_listViewAdapter.ListView = this;

            base.OnNodeSet();
        }
예제 #7
0
        /// <summary>
        /// Performs initialization when the adapter is connected to the context's DomNode.
        /// Raises the HistoryContext NodeSet event and performs custom processing.</summary>
        protected override void OnNodeSet()
        {
            DomNode.AttributeChanged += new EventHandler<AttributeEventArgs>(DomNode_AttributeChanged);
            DomNode.ChildInserted += new EventHandler<ChildEventArgs>(DomNode_ChildInserted);
            DomNode.ChildRemoved += new EventHandler<ChildEventArgs>(DomNode_ChildRemoved);

            m_listViewAdapter = new ListViewAdapter(m_listView);
            m_listViewAdapter.AllowSorting = true;
            m_listViewAdapter.ListView = this;

            base.OnNodeSet();
        }
예제 #8
0
파일: FileViewer.cs 프로젝트: Joxx0r/ATF
        public FileViewer(MainForm mainForm)
        {
            m_mainForm = mainForm;

            // create a standard WinForms ListView control
            m_listView = new ListView();
            m_listView.Dock = DockStyle.Fill;
            m_listView.Text = "File Viewer";
            m_listView.BackColor = SystemColors.Window;
            m_listView.SmallImageList = ResourceUtil.GetImageList16();
            m_listView.AllowColumnReorder = true;

            // create an adapter to drive the ListView control
            m_listViewAdapter = new ListViewAdapter(m_listView);

            m_fileListView = new FileListView();
        }
예제 #9
0
        /// <summary>
        /// Initializes the MEF component</summary>
        public void Initialize()
        {
            m_treeControl                = new TreeControl();
            m_treeControl.Dock           = DockStyle.Fill;
            m_treeControl.AllowDrop      = true;
            m_treeControl.SelectionMode  = SelectionMode.MultiExtended;
            m_treeControl.ImageList      = ResourceUtil.GetImageList16();
            m_treeControl.StateImageList = ResourceUtil.GetImageList16();

            m_treeControl.DragOver += treeControl_DragOver;
            m_treeControl.DragDrop += treeControl_DragDrop;
            m_treeControl.MouseUp  += treeControl_MouseUp;

            m_treeControlAdapter = new TreeControlAdapter(m_treeControl);

            m_listView           = new ListView();
            m_listView.View      = View.Details;
            m_listView.Dock      = DockStyle.Fill;
            m_listView.AllowDrop = true;
            m_listView.LabelEdit = false;

            m_listView.MouseUp    += thumbnailControl_MouseUp;
            m_listView.MouseMove  += thumbnailControl_MouseMove;
            m_listView.MouseLeave += thumbnailControl_MouseLeave;
            m_listView.DragOver   += thumbnailControl_DragOver;

            m_listViewAdapter = new ListViewAdapter(m_listView);

            m_thumbnailControl           = new ThumbnailControl();
            m_thumbnailControl.Dock      = DockStyle.Fill;
            m_thumbnailControl.AllowDrop = true;
            m_thumbnailControl.BackColor = SystemColors.Window;

            m_thumbnailControl.SelectionChanged += thumbnailControl_SelectionChanged;
            m_thumbnailControl.MouseMove        += thumbnailControl_MouseMove;
            m_thumbnailControl.MouseUp          += thumbnailControl_MouseUp;
            m_thumbnailControl.MouseLeave       += thumbnailControl_MouseLeave;
            m_thumbnailControl.DragOver         += thumbnailControl_DragOver;

            m_splitContainer             = new SplitContainer();
            m_splitContainer.Name        = "Resources".Localize();
            m_splitContainer.Orientation = Orientation.Vertical;
            m_splitContainer.Panel1.Controls.Add(m_treeControl);
            m_splitContainer.Panel2.Controls.Add(m_thumbnailControl);
            m_splitContainer.Panel2.Controls.Add(m_listView);
            m_splitContainer.SplitterDistance = 10;

            m_listView.Hide();

            Image resourceImage = ResourceUtil.GetImage16(Resources.ResourceImage);

            // on initialization, register our tree control with the hosting service
            m_controlHostService.RegisterControl(
                m_splitContainer,
                new ControlInfo(
                    "Resources".Localize(),
                    "Lists available resources".Localize(),
                    StandardControlGroup.Left,
                    resourceImage),
                this);

            RegisterCommands(m_commandService);
            RegisterSettings();
        }