/// <summary>
        /// Focus()'s the control without the implied ScrollControlIntoView(). This prevents things
        /// jumping around while doing focus-follows-cursor.
        /// </summary>
        /// <param name="control">The control to Focus().</param>
        public static void FocusWithoutScroll(Control control)
        {
            Control focusControl = control;

            Form form = control.FindForm();

            if (form != null && !form.ContainsFocus)
            {
                return;                                  // form doesn't have focus, don't steal
            }
            TaskPane taskpane = null;

            while (control != null)
            {
                if (control is TaskPane)
                {
                    taskpane = control as TaskPane;
                }
                control = control.Parent;
            }

            if (taskpane != null)
            {
                taskpane.PreventAutoScroll = true;
            }
            focusControl.Focus();
            if (taskpane != null)
            {
                taskpane.PreventAutoScroll = false;
            }
        }
Exemple #2
0
        private void OnNewStackClicked(object sender, RibbonControlEventArgs e)
        {
            try
            {
                EditStackTaskPane control = new EditStackTaskPane();
                control.EditedStack = new Stack();
                control.Confirmed  += (s, args) =>
                {
                    // TODO: Move this validation inside the DataSource
                    List <Stack> existing = extension.Notebooks.SelectedNotebook.Stacks;

                    if (existing.Exists(item => item.Name == control.EditedStack.Name))
                    {
                        InformationDispatcher.Default.Dispatch("A Stack with this name already exists!", informationContext, InformationKind.Error);
                        args.KeepOpen = true;

                        return;
                    }

                    extension.Notebooks.AddStack(control.EditedStack);
                    LoadStacks();
                };

                TaskPane <EditStackTaskPane> taskPane = new TaskPane <EditStackTaskPane>("New Stack", control);
                taskPane.Visible = true;
            }
            catch (Exception exception)
            {
                InformationDispatcher.Default.Dispatch(exception, informationContext);
            }
        }
Exemple #3
0
        public frm_main_task()
        {
            InitializeComponent();

            m_taskPane      = new TaskPane("全部");
            m_taskPane.Dock = DockStyle.Fill;
            this.Controls.Add(m_taskPane);
        }
Exemple #4
0
        private void OnLoginClicked(object sender, RibbonControlEventArgs e)
        {
            LoginTaskPane control = new LoginTaskPane(extension.CredentialsManager);

            TaskPane <LoginTaskPane> taskPane = new TaskPane <LoginTaskPane>("Chronicy Login", control);

            taskPane.Visible = true;
        }
 private void DestroyPlugin(IApplicationBlock plugin, TaskPane taskPane)
 {
     foreach (IMenu menu in plugin.Menus)
     {
         DestroyMenu(menu, MenuBindings[menu]);
         MenuBindings.Remove(menu);
     }
     taskPane.Dispose();
     // remove link from explorer bar
 }
        public virtual void RegisterBlock(IApplicationBlock plugin)
        {
            #region Pre-conditions
            Debug.Assert(plugin != null);
            Debug.Assert(!PluginBindings.ContainsKey(plugin));
            #endregion

            TaskPane taskPane = CreateApplicationBlockPane(plugin);
            taskPane.AutoScroll = true;
            taskPane.Dock       = DockStyle.Fill;
            taskPane.Size       = new Size(
                _applicationBar.Width,
                _applicationBar.Height
                );
            _applicationBar.AddItem(
                new ApplicationBar.Item(
                    taskPane,
                    plugin.Image32x32,
                    plugin.Name
                    )
                );

            Plugins.Add(plugin);
            PluginBindings.Add(plugin, taskPane);

            if (ActiveBlock == null)
            {
                ActiveBlock = plugin;
            }
            if (plugin.ShowInMenuStrip)
            {
                RegisterBlockInMenu(plugin);
            }
            RebuildToolBar();

#warning Execute these on form load rather than now?
            foreach (IMenu menu in plugin.Menus)
            {
                foreach (IMenuItem menuItem in menu.Items)
                {
                    if (menuItem.ExecuteOnLoad)
                    {
                        ExecuteMenuItem(menuItem);
                    }
                }
            }
        }
        /// <summary>
        /// Returns a TaskPane that contains the deserialized TaskPaneSurrogate data
        /// </summary>
        /// <returns>A TaskPane that contains the deserialized TaskPaneSurrogate data</returns>
        public TaskPane Save()
        {
            TaskPane taskPane = new TaskPane();

            ((ISupportInitialize)taskPane).BeginInit();
            taskPane.SuspendLayout();

            taskPane.Name     = this.Name;
            taskPane.Size     = this.Size;
            taskPane.Location = this.Location;

            taskPane.BackColor = Tools.Drawing.ConvertStringToColor(this.BackColor);

            taskPane.CustomSettings          = this.CustomSettings.Save();
            taskPane.CustomSettings.TaskPane = taskPane;

            taskPane.AutoScroll       = this.AutoScroll;
            taskPane.AutoScrollMargin = this.AutoScrollMargin;

            taskPane.Enabled = this.Enabled;
            taskPane.Visible = this.Visible;

            taskPane.Anchor = this.Anchor;
            taskPane.Dock   = this.Dock;

            taskPane.Font = new Font(this.FontName, this.FontSize, this.FontDecoration);

            taskPane.Tag = this.Tag.SerializeToByteArray();

            taskPane.AllowExpandoDragging      = this.AllowExpandoDragging;
            taskPane.ExpandoDropIndicatorColor = Tools.Drawing.ConvertStringToColor(this.ExpandoDropIndicatorColor);

            foreach (Object o in this.Expandos)
            {
                Expando e = ((ExpandoSurrogate)o).Save();

                taskPane.Expandos.Add(e);
            }

            ((ISupportInitialize)taskPane).EndInit();
            taskPane.ResumeLayout(false);

            return(taskPane);
        }
Exemple #8
0
        /// <summary>
        /// Initializes a new instance of the TaskPaneInfo class with default settings
        /// </summary>
        public TaskPaneInfo()
        {
            // set background values
            this.gradientStartColor = Color.Transparent;
            this.gradientEndColor   = Color.Transparent;
            this.direction          = LinearGradientMode.Vertical;

            // set padding values
            this.padding = new PaddingEx(12, 12, 12, 12);

            // images
            this.backImage   = null;
            this.stretchMode = ImageStretchMode.Tile;

            this.watermark          = null;
            this.watermarkAlignment = ContentAlignment.BottomCenter;

            this.owner = null;
        }
        private TaskPane CreateApplicationBlockPane(IApplicationBlock plugin)
        {
            TaskPane taskPane = new TaskPane();

            taskPane.AutoScroll       = true;
            taskPane.AutoScrollMargin = new System.Drawing.Size(12, 12);
            taskPane.Dock             = System.Windows.Forms.DockStyle.Fill;
            taskPane.Location         = new System.Drawing.Point(0, 0);
            taskPane.Name             = plugin.Name + " TaskPane";
            taskPane.TabIndex         = 0;
            taskPane.Text             = "N/A";
            foreach (IMenu menu in plugin.Menus)
            {
                taskPane.Expandos.Add(
                    CreateMenu(menu)
                    );
            }
            return(taskPane);
        }
        /// <summary>
        /// Populates the TaskPaneSurrogate with data that is to be
        /// serialized from the specified TaskPane
        /// </summary>
        /// <param name="taskPane">The TaskPane that contains the data
        /// to be serialized</param>
        public void Load(TaskPane taskPane)
        {
            this.Name     = taskPane.Name;
            this.Size     = taskPane.Size;
            this.Location = taskPane.Location;

            this.BackColor = Tools.Drawing.ConvertColorToString(taskPane.BackColor);

            this.CustomSettings = new TaskPaneInfoSurrogate();
            this.CustomSettings.Load(taskPane.CustomSettings);

            this.AutoScroll       = taskPane.AutoScroll;
            this.AutoScrollMargin = taskPane.AutoScrollMargin;

            this.Enabled = taskPane.Enabled;
            this.Visible = taskPane.Visible;

            this.Anchor = taskPane.Anchor;
            this.Dock   = taskPane.Dock;

            this.FontName       = taskPane.Font.FontFamily.Name;
            this.FontSize       = taskPane.Font.SizeInPoints;
            this.FontDecoration = taskPane.Font.Style;

            this.AllowExpandoDragging      = taskPane.AllowExpandoDragging;
            this.ExpandoDropIndicatorColor = Tools.Drawing.ConvertColorToString(taskPane.ExpandoDropIndicatorColor);

            this.Tag = taskPane.Tag.SerializeToByteArray();

            foreach (Expando expando in taskPane.Expandos)
            {
                ExpandoSurrogate es = new ExpandoSurrogate();

                es.Load(expando);

                this.Expandos.Add(es);
            }
        }
Exemple #11
0
        public void UsingWebExtensionTaskPanes()
        {
            //ExStart:UsingWebExtensionTaskPanes
            Document doc = new Document();

            TaskPane taskPane = new TaskPane();

            doc.WebExtensionTaskPanes.Add(taskPane);

            taskPane.DockState = TaskPaneDockState.Right;
            taskPane.IsVisible = true;
            taskPane.Width     = 300;

            taskPane.WebExtension.Reference.Id        = "wa102923726";
            taskPane.WebExtension.Reference.Version   = "1.0.0.0";
            taskPane.WebExtension.Reference.StoreType = WebExtensionStoreType.OMEX;
            taskPane.WebExtension.Reference.Store     = "th-TH";
            taskPane.WebExtension.Properties.Add(new WebExtensionProperty("mailchimpCampaign", "mailchimpCampaign"));
            taskPane.WebExtension.Bindings.Add(new WebExtensionBinding("UnnamedBinding_0_1506535429545",
                                                                       WebExtensionBindingType.Text, "194740422"));

            doc.Save(ArtifactsDir + "WorkingWithWebExtension.UsingWebExtensionTaskPanes.docx");
            //ExEnd:UsingWebExtensionTaskPanes

            //ExStart:GetListOfAddins
            doc = new Document(ArtifactsDir + "WorkingWithWebExtension.UsingWebExtensionTaskPanes.docx");

            Console.WriteLine("Task panes sources:\n");

            foreach (TaskPane taskPaneInfo in doc.WebExtensionTaskPanes)
            {
                WebExtensionReference reference = taskPaneInfo.WebExtension.Reference;
                Console.WriteLine($"Provider: \"{reference.Store}\", version: \"{reference.Version}\", catalog identifier: \"{reference.Id}\";");
            }
            //ExEnd:GetListOfAddins
        }
Exemple #12
0
        private void OnViewAllClicked(object sender, RibbonControlEventArgs e)
        {
            try
            {
                NotebooksTaskPane control = new NotebooksTaskPane();
                control.Notebooks  = extension.Notebooks.GetNotebooks();
                control.Confirmed += (s, args) =>
                {
                    foreach (Notebook notebook in control.Notebooks)
                    {
                        extension.Notebooks.UpdateNotebook(notebook);
                    }

                    LoadStacks();
                };

                TaskPane <NotebooksTaskPane> taskPane = new TaskPane <NotebooksTaskPane>("Notebooks", control);
                taskPane.Visible = true;
            }
            catch (Exception exception)
            {
                InformationDispatcher.Default.Dispatch(exception, informationContext);
            }
        }
        /// <summary>
        /// Focus()'s the outer-most TaskPane that contains the given control.
        /// </summary>
        /// <param name="control">The child control to start searching with.</param>
        public static void FocusTaskPane(Control control)
        {
            Form form = control.FindForm();

            if (form != null && !form.ContainsFocus)
            {
                return;                                  // form doesn't have focus, don't steal
            }
            TaskPane taskpane = null;

            while (control != null)
            {
                if (control is TaskPane)
                {
                    taskpane = control as TaskPane;
                }
                control = control.Parent;
            }

            if (taskpane != null)
            {
                taskpane.Focus();
            }
        }
        public static void UsingWebExtensionTaskPanes(string dataDir)
        {
            // ExStart:UsingWebExtensionTaskPanes
            Document doc = new Document();

            TaskPane taskPane = new TaskPane();

            doc.WebExtensionTaskPanes.Add(taskPane);

            taskPane.DockState = TaskPaneDockState.Right;
            taskPane.IsVisible = true;
            taskPane.Width     = 300;

            taskPane.WebExtension.Reference.Id        = "wa102923726";
            taskPane.WebExtension.Reference.Version   = "1.0.0.0";
            taskPane.WebExtension.Reference.StoreType = WebExtensionStoreType.OMEX;
            taskPane.WebExtension.Reference.Store     = "th-TH";
            taskPane.WebExtension.Properties.Add(new WebExtensionProperty("mailchimpCampaign", "mailchimpCampaign"));
            taskPane.WebExtension.Bindings.Add(new WebExtensionBinding("UnnamedBinding_0_1506535429545", WebExtensionBindingType.Text, "194740422"));

            doc.Save(dataDir + "output.docx", SaveFormat.Docx);
            // ExEnd:UsingWebExtensionTaskPanes
            Console.WriteLine("\nThe file is saved successfully at " + dataDir);
        }
 private void _applicationBar_ButtonPressed(ApplicationBar source, ApplicationBar.Item button)
 {
     // purpose here is to set ActivePlugin to current Plugin visible in application bar
     // current taskpane on application bar is current active view
     if (_applicationBar.ApplicationBarControl != null)
     {
         TaskPane pane = (TaskPane)_applicationBar.ApplicationBarControl;
         foreach (Control control in PluginBindings.Values)
         {
             if (pane == control)
             {
                 foreach (IApplicationBlock block in PluginBindings.Keys)
                 {
                     if (PluginBindings[block] == control)
                     {
                         ActiveBlock = block;
                         break;
                     }
                 }
                 break;
             }
         }
     }
 }
Exemple #16
0
        //*************************************************************************
        //  Constructor: SelectionCoordinator()
        //
        /// <summary>
        /// Initializes a new instance of the <see cref="SelectionCoordinator" />
        /// class.
        /// </summary>
        ///
        /// <param name="thisWorkbook">
        /// The Excel workbook.
        /// </param>
        ///
        /// <param name="edgeWorksheet">
        /// The edge worksheet in the Excel workbook.
        /// </param>
        ///
        /// <param name="edgeTable">
        /// The edge table on the edge worksheet.
        /// </param>
        ///
        /// <param name="vertexWorksheet">
        /// The vertex worksheet in the Excel workbook.
        /// </param>
        ///
        /// <param name="vertexTable">
        /// The vertex table on the vertex worksheet.
        /// </param>
        ///
        /// <param name="groupWorksheet">
        /// The group worksheet in the Excel workbook.
        /// </param>
        ///
        /// <param name="groupTable">
        /// The group table on the group worksheet.
        /// </param>
        ///
        /// <param name="groupVertexWorksheet">
        /// The group-vertex worksheet in the Excel workbook.
        /// </param>
        ///
        /// <param name="taskPane">
        /// The TaskPane.
        /// </param>
        //*************************************************************************

        public SelectionCoordinator
        (
            ThisWorkbook thisWorkbook,
            Sheet1 edgeWorksheet,
            Microsoft.Office.Tools.Excel.ListObject edgeTable,
            Sheet2 vertexWorksheet,
            Microsoft.Office.Tools.Excel.ListObject vertexTable,
            Sheet5 groupWorksheet,
            Microsoft.Office.Tools.Excel.ListObject groupTable,
            Sheet6 groupVertexWorksheet,
            TaskPane taskPane
        )
        {
            Debug.Assert(thisWorkbook != null);
            Debug.Assert(edgeWorksheet != null);
            Debug.Assert(edgeTable != null);
            Debug.Assert(vertexWorksheet != null);
            Debug.Assert(vertexTable != null);
            Debug.Assert(groupWorksheet != null);
            Debug.Assert(groupTable != null);
            Debug.Assert(groupVertexWorksheet != null);
            Debug.Assert(taskPane != null);

            m_oThisWorkbook         = thisWorkbook;
            m_oEdgeWorksheet        = edgeWorksheet;
            m_oVertexWorksheet      = vertexWorksheet;
            m_oGroupWorksheet       = groupWorksheet;
            m_oGroupTable           = groupTable;
            m_oGroupVertexWorksheet = groupVertexWorksheet;
            m_oTaskPane             = taskPane;

            m_bIgnoreSelectionEvents             = false;
            m_bUpdateVertexSelectionOnActivation = false;
            m_bUpdateEdgeSelectionOnActivation   = false;
            m_bUpdateGroupSelectionOnActivation  = false;


            edgeTable.SelectionChange += new DocEvents_SelectionChangeEventHandler(
                EdgeTable_SelectionChange);

            edgeTable.Deselected += new DocEvents_SelectionChangeEventHandler(
                EdgeTable_Deselected);

            m_oEdgeWorksheet.ActivateEvent += new DocEvents_ActivateEventHandler(
                EdgeWorksheet_ActivateEvent);


            vertexTable.SelectionChange +=
                new DocEvents_SelectionChangeEventHandler(
                    VertexTable_SelectionChange);

            vertexTable.Deselected += new DocEvents_SelectionChangeEventHandler(
                VertexTable_Deselected);

            m_oVertexWorksheet.ActivateEvent += new DocEvents_ActivateEventHandler(
                VertexWorksheet_ActivateEvent);


            m_oGroupTable.SelectionChange +=
                new DocEvents_SelectionChangeEventHandler(
                    GroupTable_SelectionChange);

            m_oGroupTable.Deselected += new DocEvents_SelectionChangeEventHandler(
                GroupTable_Deselected);

            m_oGroupWorksheet.ActivateEvent += new DocEvents_ActivateEventHandler(
                GroupWorksheet_ActivateEvent);


            m_oTaskPane.SelectionChangedInGraph +=
                new EventHandler <EventArgs>(this.TaskPane_SelectionChangedInGraph);
        }
Exemple #17
0
 private void InitializeComponent()
 {
     this.taskPane1 = new TaskPane();
     this.expando1  = new Expando();
     this.taskItem1 = new TaskItem();
     this.taskItem2 = new TaskItem();
     this.expando2  = new Expando();
     this.taskItem5 = new TaskItem();
     this.checkBox1 = new System.Windows.Forms.CheckBox();
     this.taskItem3 = new TaskItem();
     this.treeView1 = new System.Windows.Forms.TreeView();
     this.expando3  = new Expando();
     ((System.ComponentModel.ISupportInitialize)(this.taskPane1)).BeginInit();
     this.taskPane1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.expando1)).BeginInit();
     this.expando1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.expando2)).BeginInit();
     this.expando2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.expando3)).BeginInit();
     this.SuspendLayout();
     //
     // taskPane1
     //
     this.taskPane1.AutoScrollMargin = new System.Drawing.Size(12, 12);
     this.taskPane1.Expandos.AddRange(new Expando[] {
         this.expando1,
         this.expando2,
         this.expando3
     });
     this.taskPane1.Location = new System.Drawing.Point(12, 12);
     this.taskPane1.Name     = "taskPane1";
     this.taskPane1.Size     = new System.Drawing.Size(212, 470);
     this.taskPane1.TabIndex = 0;
     this.taskPane1.Text     = "taskPane1";
     //
     // expando1
     //
     this.expando1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.expando1.Animate = true;
     this.expando1.Font    = new System.Drawing.Font("Tahoma", 8.25F);
     this.expando1.Items.AddRange(new System.Windows.Forms.Control[] {
         this.taskItem1,
         this.taskItem2
     });
     this.expando1.Location = new System.Drawing.Point(12, 12);
     this.expando1.Name     = "expando1";
     this.expando1.Size     = new System.Drawing.Size(188, 100);
     this.expando1.TabIndex = 0;
     this.expando1.Text     = "expando1";
     //
     // taskItem1
     //
     this.taskItem1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.taskItem1.BackColor = System.Drawing.Color.Transparent;
     this.taskItem1.Image     = null;
     this.taskItem1.Location  = new System.Drawing.Point(20, 26);
     this.taskItem1.Name      = "taskItem1";
     this.taskItem1.Size      = new System.Drawing.Size(164, 16);
     this.taskItem1.TabIndex  = 0;
     this.taskItem1.Text      = "taskItem1";
     this.taskItem1.TextAlign = System.Drawing.ContentAlignment.TopLeft;
     this.taskItem1.UseVisualStyleBackColor = false;
     //
     // taskItem2
     //
     this.taskItem2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.taskItem2.BackColor = System.Drawing.Color.Transparent;
     this.taskItem2.Image     = null;
     this.taskItem2.Location  = new System.Drawing.Point(20, 48);
     this.taskItem2.Name      = "taskItem2";
     this.taskItem2.Size      = new System.Drawing.Size(164, 16);
     this.taskItem2.TabIndex  = 1;
     this.taskItem2.Text      = "taskItem2";
     this.taskItem2.TextAlign = System.Drawing.ContentAlignment.TopLeft;
     this.taskItem2.UseVisualStyleBackColor = false;
     //
     // expando2
     //
     this.expando2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.expando2.Animate        = true;
     this.expando2.AutoLayout     = true;
     this.expando2.ExpandedHeight = 209;
     this.expando2.Font           = new System.Drawing.Font("Tahoma", 8.25F);
     this.expando2.Items.AddRange(new System.Windows.Forms.Control[] {
         this.taskItem5,
         this.checkBox1,
         this.taskItem3,
         this.treeView1
     });
     this.expando2.Location = new System.Drawing.Point(12, 124);
     this.expando2.Name     = "expando2";
     this.expando2.Size     = new System.Drawing.Size(188, 209);
     this.expando2.TabIndex = 1;
     this.expando2.Text     = "expando2";
     //
     // taskItem5
     //
     this.taskItem5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.taskItem5.BackColor = System.Drawing.Color.Transparent;
     this.taskItem5.Image     = null;
     this.taskItem5.Location  = new System.Drawing.Point(12, 33);
     this.taskItem5.Name      = "taskItem5";
     this.taskItem5.Size      = new System.Drawing.Size(162, 16);
     this.taskItem5.TabIndex  = 2;
     this.taskItem5.Text      = "taskItem5";
     this.taskItem5.TextAlign = System.Drawing.ContentAlignment.TopLeft;
     this.taskItem5.UseVisualStyleBackColor = false;
     //
     // checkBox1
     //
     this.checkBox1.Location = new System.Drawing.Point(12, 53);
     this.checkBox1.Name     = "checkBox1";
     this.checkBox1.Size     = new System.Drawing.Size(104, 24);
     this.checkBox1.TabIndex = 3;
     this.checkBox1.Text     = "checkBox1";
     this.checkBox1.UseVisualStyleBackColor = true;
     //
     // taskItem3
     //
     this.taskItem3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.taskItem3.BackColor = System.Drawing.Color.Transparent;
     this.taskItem3.Image     = null;
     this.taskItem3.Location  = new System.Drawing.Point(12, 81);
     this.taskItem3.Name      = "taskItem3";
     this.taskItem3.Size      = new System.Drawing.Size(162, 16);
     this.taskItem3.TabIndex  = 4;
     this.taskItem3.Text      = "taskItem3";
     this.taskItem3.TextAlign = System.Drawing.ContentAlignment.TopLeft;
     this.taskItem3.UseVisualStyleBackColor = false;
     //
     // treeView1
     //
     this.treeView1.Location = new System.Drawing.Point(12, 101);
     this.treeView1.Name     = "treeView1";
     this.treeView1.Size     = new System.Drawing.Size(121, 97);
     this.treeView1.TabIndex = 5;
     //
     // expando3
     //
     this.expando3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.expando3.Animate  = true;
     this.expando3.Font     = new System.Drawing.Font("Tahoma", 8.25F);
     this.expando3.Location = new System.Drawing.Point(12, 345);
     this.expando3.Name     = "expando3";
     this.expando3.Size     = new System.Drawing.Size(188, 100);
     this.expando3.TabIndex = 2;
     this.expando3.Text     = "expando3";
     //
     // Form1
     //
     this.ClientSize = new System.Drawing.Size(615, 558);
     this.Controls.Add(this.taskPane1);
     this.Name = "Form1";
     ((System.ComponentModel.ISupportInitialize)(this.taskPane1)).EndInit();
     this.taskPane1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.expando1)).EndInit();
     this.expando1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.expando2)).EndInit();
     this.expando2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.expando3)).EndInit();
     this.ResumeLayout(false);
 }
		private void ExecutedOpenPaneCommand(object sender, ExecutedRoutedEventArgs e)
		{
			IPane pane = null;

			switch (e.Parameter.ToString().ToLowerInvariant())
			{
				case "trade":
					pane = new TradesPane { SelectedSecurity = SelectedSecurity };
					break;

				case "depth":
					pane = new DepthPane { SelectedSecurity = SelectedSecurity };
					break;

				case "candle":
					pane = new CandlesPane { SelectedSecurity = SelectedSecurity };
					break;

				case "orderlog":
					pane = new OrderLogPane { SelectedSecurity = SelectedSecurity };
					break;

				case "level1":
					pane = new Level1Pane { SelectedSecurity = SelectedSecurity };
					break;

				case "news":
					pane = new NewsPane();
					break;

				case "task":
					var task = (IHydraTask)(NavigationBar.SelectedPane == SourcesPane ? CurrentSources.SelectedItem : CurrentConverters.SelectedItem);

					if (task != null)
					{
						var taskWnd = DockSite.DocumentWindows.FirstOrDefault(w =>
						{
							var pw = w as PaneWindow;

							if (pw == null)
								return false;

							var taskPane = pw.Pane as TaskPane;

							if (taskPane == null)
								return false;

							return taskPane.Task == task;
						});

						if (taskWnd != null)
							taskWnd.Activate();
						else
							pane = new TaskPane { Task = task };
					}

					break;

				case "execution":
					pane = new ExecutionsPane { SelectedSecurity = SelectedSecurity };
					break;
			}

			if (pane == null)
				return;

			ShowPane(pane);
		}
Exemple #19
0
        private void ExecutedOpenPaneCommand(object sender, ExecutedRoutedEventArgs e)
        {
            IPane pane = null;

            switch (e.Parameter.ToString().ToLowerInvariant())
            {
            case "trade":
                pane = new TradesPane {
                    SelectedSecurity = SelectedSecurity
                };
                break;

            case "depth":
                pane = new DepthPane {
                    SelectedSecurity = SelectedSecurity
                };
                break;

            case "candle":
                pane = new CandlesPane {
                    SelectedSecurity = SelectedSecurity
                };
                break;

            case "orderlog":
                pane = new OrderLogPane {
                    SelectedSecurity = SelectedSecurity
                };
                break;

            case "level1":
                pane = new Level1Pane {
                    SelectedSecurity = SelectedSecurity
                };
                break;

            case "news":
                pane = new NewsPane();
                break;

            case "task":
                var task = (IHydraTask)(NavigationBar.SelectedPane == SourcesPane ? CurrentSources.SelectedItem : CurrentConverters.SelectedItem);

                if (task != null)
                {
                    var taskWnd = DockSite.DocumentWindows.FirstOrDefault(w =>
                    {
                        var pw = w as PaneWindow;

                        if (pw == null)
                        {
                            return(false);
                        }

                        var taskPane = pw.Pane as TaskPane;

                        if (taskPane == null)
                        {
                            return(false);
                        }

                        return(taskPane.Task == task);
                    });

                    if (taskWnd != null)
                    {
                        taskWnd.Activate();
                    }
                    else
                    {
                        pane = new TaskPane {
                            Task = task
                        }
                    };
                }

                break;

            case "execution":
                pane = new ExecutionsPane {
                    SelectedSecurity = SelectedSecurity
                };
                break;
            }

            if (pane == null)
            {
                return;
            }

            ShowPane(pane);
        }