コード例 #1
0
        internal void LoadPadContentIfRequired()
        {
            bool dockingManagerIsInitializing = layout.Busy || !layout.DockingManager.IsLoaded;

            if (placeholder != null && placeholder.IsVisible && !dockingManagerIsInitializing)
            {
                placeholder.IsVisibleChanged -= AvalonPadContent_IsVisibleChanged;
                padInstance = descriptor.PadContent;
                if (padInstance != null)
                {
                    bool isFocused = this.IsKeyboardFocused;
                    SD.WinForms.SetContent(this, padInstance.Control, padInstance);
                    placeholder = null;

                    if (isFocused)
                    {
                        IInputElement initialFocus = padInstance.InitiallyFocusedControl as IInputElement;
                        if (initialFocus != null)
                        {
                            Dispatcher.BeginInvoke(DispatcherPriority.Loaded,
                                                   new Action(delegate { Keyboard.Focus(initialFocus); }));
                        }
                    }
                }
            }
        }
コード例 #2
0
        void PropertyChanged(object sender, PropertyValueChangedEventArgs e)
        {
            AlgorithmManager.Algorithms.CurrentAlgorithm.UpdateGraphAppearance();
            IPadContent animationPad = WorkbenchSingleton.Workbench.GetPad(typeof(AnimationPad));

            AlgorithmManager.Algorithms.CurrentAlgorithm.UpdateAnimationPad();
        }
コード例 #3
0
ファイル: PadDescriptor.cs プロジェクト: olesar/Altaxo
 public void CreatePad()
 {
     if (Altaxo.Current.Dispatcher.InvokeRequired)
     {
         throw new InvalidOperationException("This action could trigger pad creation and is only valid on the main thread!");
     }
     if (!padContentCreated)
     {
         padContentCreated = true;
         try
         {
             if (addIn != null)
             {
                 Current.Log.Debug("Creating pad " + Class + "...");
                 padContent = (IPadContent)addIn.CreateObject(Class);
                 padContent.PadDescriptor = this;
             }
             else
             {
                 padContent = (IPadContent)Activator.CreateInstance(padType);
                 padContent.PadDescriptor = this;
             }
             if (padContent is IMVCController mvcPadContent && padContent.ViewObject == null)
             {
                 Current.Gui.FindAndAttachControlTo(mvcPadContent);
             }
         }
         catch (Exception ex)
         {
             MessageService.ShowException(ex, "Error creating pad instance");
         }
     }
 }
コード例 #4
0
 public virtual void ShowPad(IPadContent content)
 {
     if (layout != null)
     {
         layout.ShowPad(content);
     }
 }
コード例 #5
0
 void CreateContent()
 {
     if (this.content == null)
     {
         this.content = codon.InitializePadContent(this);
     }
 }
コード例 #6
0
 void ActivateContent()
 {
     if (!allowInitialize)
     {
         return;
     }
     if (!isInitialized)
     {
         isInitialized = true;
         IPadContent content = padDescriptor.PadContent;
         if (content == null)
         {
             return;
         }
         try
         {
             Control control = content.Control;
             control.Dock = DockStyle.Fill;
             Controls.Add(control);
         }
         catch (Exception ex)
         {
             MessageService.ShowError(ex, "Error in IPadContent.Control");
         }
     }
 }
コード例 #7
0
        /// <summary>
        /// 将动画面板清空
        /// </summary>
        public Graphics ClearAnimationPad()
        {
            IPadContent animationPad = WorkbenchSingleton.Workbench.GetPad(typeof(NetFocus.DataStructure.Gui.Pads.AnimationPad));

            if (animationPad == null)
            {
                Bitmap   bmp1 = new Bitmap(1, 1);
                Graphics g1   = Graphics.FromImage(bmp1);
                return(g1);
            }
            int x      = animationPad.Control.Left > 0 ? animationPad.Control.Left : 0;
            int y      = animationPad.Control.Top > 0 ? animationPad.Control.Top : 0;
            int width  = animationPad.Control.Width > 0 ? animationPad.Control.Width : 1;
            int height = animationPad.Control.Height > 0 ? animationPad.Control.Height : 1;

            Bitmap   bmp = new Bitmap(width, height);
            Graphics g   = Graphics.FromImage(bmp);

            g.DrawRectangle(new Pen(Color.Gray, 1), x, y, width - 1, height - 1);
            ((PictureBox)animationPad.Control).BackgroundImage = bmp;

            PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
            Color           c = ParseColor(propertyService.GetProperty("NetFocus.DataStructure.AnimationPadPanel.BackColor", "White"));

            animationPad.Control.BackColor = c;

            return(g);             //这里,最后要把Graphics对象返回,因为一个特定的算法对象还要借助这个对象画一些特定的动画信息
        }
コード例 #8
0
        public void CreatePad()
        {
#if DEBUG
            if (WorkbenchSingleton.InvokeRequired)
            {
                throw new InvalidOperationException("This action could trigger pad creation and is only valid on the main thread!");
            }
#endif
            if (!padContentCreated)
            {
                padContentCreated = true;
                try
                {
                    if (addIn != null)
                    {
                        LoggingService.Debug("Creating pad " + Class + "...");
                        padContent = (IPadContent)addIn.CreateObject(Class);
                    }
                    else
                    {
                        padContent = (IPadContent)Activator.CreateInstance(padType);
                    }
                }
                catch (Exception ex)
                {
                    MessageService.ShowError(ex, "Error creating pad instance");
                }
            }
        }
コード例 #9
0
 /// <summary>
 ///    <para>Adds a <see cref='.IPadContent'/> with the specified value to the
 ///    <see cref='.PadContentCollection'/> .</para>
 /// </summary>
 /// <param name='value'>The <see cref='.IPadContent'/> to add.</param>
 /// <returns>
 ///    <para>The index at which the new element was inserted.</para>
 /// </returns>
 /// <seealso cref='.PadContentCollection.AddRange'/>
 public int Add(IPadContent value)
 {
     if (!List.Contains(value))
     {
         return(List.Add(value));
     }
     return(List.IndexOf(value));
 }
コード例 #10
0
		/// <summary>
		///    <para>Adds a <see cref='.IPadContent'/> with the specified value to the
		///    <see cref='.PadContentCollection'/> .</para>
		/// </summary>
		/// <param name='value'>The <see cref='.IPadContent'/> to add.</param>
		/// <returns>
		///    <para>The index at which the new element was inserted.</para>
		/// </returns>
		/// <seealso cref='.PadContentCollection.AddRange'/>
		public int Add(IPadContent value) {
			if(!List.Contains(value))
			{
				return List.Add(value);
			}
			return List.IndexOf(value);
			
		}
コード例 #11
0
 public PadCodon(IPadContent content, string id, string label, string defaultPlacement, string icon)
 {
     this.id               = id;
     this.content          = content;
     this.label            = label;
     this.defaultPlacement = defaultPlacement;
     this.icon             = icon;
 }
コード例 #12
0
 public void Dispose()
 {
     if (padContent != null)
     {
         padContent.Dispose();
         padContent = null;
     }
 }
コード例 #13
0
ファイル: PadDescriptor.cs プロジェクト: figwh/VisualMap
 public void CreatePad()
 {
     if (!padContentCreated)
     {
         padContentCreated = true;
         padContent        = (IPadContent)codon.AddIn.CreateObject(Class);
     }
 }
コード例 #14
0
ファイル: PadCodon.cs プロジェクト: gAdrev/monodevelop
 public PadCodon(IPadContent content, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, string icon)
 {
     this.id               = id;
     this.content          = content;
     this.label            = label;
     this.defaultPlacement = defaultPlacement;
     this.icon             = icon;
     this.defaultStatus    = defaultStatus;
 }
コード例 #15
0
        private void muneProperty_Click(object sender, EventArgs e)
        {
            IPadContent padContent = GetPad(typeof(FormProperties));

            if (padContent != null)
            {
                ((DockContent)padContent).DockHandler.Activate();
            }
        }
コード例 #16
0
        public void ActivatePad(IPadContent padContent)
        {
            Content content = (Content)contentHash[padContent];

            if (content != null)
            {
                content.BringToFront();
            }
        }
コード例 #17
0
        public void HidePad(IPadContent padContent)
        {
            Content content = (Content)contentHash[padContent];

            if (content != null)
            {
                dockManager.HideContent(content);
            }
        }
コード例 #18
0
        /// <summary>
        /// 清空属性面板
        /// </summary>
        public void ClearPropertyPad()
        {
            IPadContent propertyPad = WorkbenchSingleton.Workbench.GetPad(typeof(PropertyPad));

            if (propertyPad != null)
            {
                ((PropertyGrid)propertyPad.Control).SelectedObject = null;
            }
        }
コード例 #19
0
        private void menuToolBox_Click(object sender, EventArgs e)
        {
            IPadContent padContent = GetPad(typeof(FormToolBox));

            if (padContent != null)
            {
                ((DockContent)padContent).DockHandler.Activate();
            }
        }
コード例 #20
0
        public override object BuildItem(object owner, ArrayList subItems, ConditionCollection conditions)
        {
            Debug.Assert(Class != null && Class.Length > 0);
            IPadContent pad = AddIn.CreateObject(Class) as IPadContent;

            pad.Shortcut = shortcut;

            return(pad);
        }
コード例 #21
0
        public void ShowPad(IPadContent content)
        {
            if (contentHash[content] == null)
            {
                IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties());
                string      type       = content.GetType().ToString();
                content.Control.Dock = DockStyle.None;
                Content c1;
                if (content.Icon != null)
                {
                    ImageList imgList = new ImageList();
                    imgList.Images.Add(content.Icon);
                    c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0);
                }
                else
                {
                    c1 = dockManager.Contents.Add(content.Control, content.Title);
                }

                c1.DisplaySize = new Size(270, 200);

                contentHash[content] = c1;


                if (properties.GetProperty(type, "Left") == "Left")
                {
                    if (leftContent == null)
                    {
                        leftContent = dockManager.AddContentWithState(c1, State.DockLeft);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, leftContent);
                    }
                }
                else if (properties.GetProperty(type, "Left") == "Bottom")
                {
                    if (bottomContent == null)
                    {
                        bottomContent = dockManager.AddContentWithState(c1, State.DockBottom);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, bottomContent);
                    }
                }
            }
            else
            {
                Content c = (Content)contentHash[content];
                if (c != null)
                {
                    dockManager.ShowContent(c);
                }
            }
        }
コード例 #22
0
        public bool IsVisible(IPadContent padContent)
        {
            Content content = (Content)contentHash[padContent];

            if (content != null)
            {
                return(content.Visible);
            }
            return(false);
        }
コード例 #23
0
 internal Pad FindPad(IPadContent padContent)
 {
     foreach (Pad pad in Pads)
     {
         if (pad.Content == padContent)
         {
             return(pad);
         }
     }
     return(null);
 }
コード例 #24
0
        public void UpdatePropertyPad()
        {
            IPadContent propertyPad = WorkbenchSingleton.Workbench.GetPad(typeof(PropertyPad));

            if (propertyPad != null)
            {
                ((PropertyGrid)propertyPad.Control).SelectedObject = null;
                if (AlgorithmManager.Algorithms.CurrentAlgorithm != null)
                {
                    ((PropertyGrid)propertyPad.Control).SelectedObject = AlgorithmManager.Algorithms.CurrentAlgorithm.Status;
                }
            }
        }
コード例 #25
0
        public IPadContent InitializePadContent(IPadWindow window)
        {
            if (content == null)
            {
                content = CreatePad();
                content.Initialize(window);
            }
            else if (!initializeCalled)
            {
                content.Initialize(window);
            }

            initializeCalled = true;
            return(content);
        }
コード例 #26
0
ファイル: PadDoozer.cs プロジェクト: wwcc19870805/DIFGIS
        public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems)
        {
            IPadContent pc = (IPadContent)codon.AddIn.CreateObject(codon.Properties["class"]);

            if (pc == null)
            {
                return(null);
            }
            pc.Title = codon.Properties["title"].ToString();
            pc.ID    = codon.Properties["id"].ToString();
            pc.Pos   = codon.Properties["pos"].ToString();
            if (codon.Properties.Contains("active") && codon.Properties["active"].ToLower() == "true")
            {
                pc.IsActive = true;
            }
            else
            {
                pc.IsActive = false;
            }
            if (codon.Properties.Contains("ShowCloseButton") && codon.Properties["ShowCloseButton"].ToLower() == "true")
            {
                pc.ShowCloseButton = true;
            }
            else
            {
                pc.ShowCloseButton = false;
            }
            if (codon.Properties.Contains("AutoHide") && codon.Properties["AutoHide"].ToLower() == "true")
            {
                pc.AutoHide = true;
            }
            else
            {
                pc.AutoHide = false;
            }
            if (codon.Properties.Contains("height"))
            {
                int  height  = 500;
                bool bHeight = int.TryParse(codon.Properties["height"].ToString(), out height);
                pc.PHeight = height;
            }
            else
            {
                pc.PHeight = 500;
            }

            return(pc);
        }
コード例 #27
0
ファイル: AltaxoWorkbench.cs プロジェクト: olesar/Altaxo
        /// <summary>
        /// Closes the pad.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <exception cref="ArgumentNullException">content</exception>
        public void ClosePad(IPadContent content)
        {
            if (null == content)
            {
                throw new ArgumentNullException(nameof(content));
            }

            if (content.PadDescriptor is null) // this is a document in the pad area
            {
                _padContentCollection.Remove(content);
                (content as IDisposable)?.Dispose();
            }
            else
            {
                content.IsVisible = false;
            }
        }
コード例 #28
0
        IGlyph CreateVisitedGlyph(IGlyph glyph)
        {
            int         count        = ((ArrayIterator)visitedIterator).Count;
            int         diameter     = 35;
            int         x            = 1;
            int         y            = 1;
            IPadContent animationPad = WorkbenchSingleton.Workbench.GetPad(typeof(NetFocus.DataStructure.Gui.Pads.AnimationPad));

            if (animationPad != null)
            {
                x = 10 + count * (diameter + 5);
                y = animationPad.Control.Height - diameter - 10;
            }
            string text = ((IBiTreeNode)glyph).Text;

            return(new BiTreeNode(x, y, diameter, status.遍历过结点颜色, text));
        }
コード例 #29
0
        IGlyph CreateStackItem(IGlyph nodeGlyph)
        {
            int         itemCount = ((StackIterator)stackIterator).ItemCount;
            int         x         = 2;
            int         y         = 10;
            int         width     = 1;
            int         height    = 28;
            IPadContent stackPad  = WorkbenchSingleton.Workbench.GetPad(typeof(NetFocus.DataStructure.Gui.Pads.StackPad));

            if (stackPad != null)
            {
                y     = stackPad.Control.Height - (itemCount + 1) * (2 + 28) - 1;
                width = stackPad.Control.Width - 6;
            }
            string text = ((IBiTreeNode)nodeGlyph).Text;

            return(new StackItem(x, y, width, height, SystemColors.Control, GlyphAppearance.Popup, text));
        }
コード例 #30
0
 void ActivateContent()
 {
     if (!allowInitialize)
     {
         return;
     }
     if (!isInitialized)
     {
         isInitialized = true;
         IPadContent content = padDescriptor.PadContent;
         if (content == null)
         {
             return;
         }
         Control control = content.Control;
         control.Dock = DockStyle.Fill;
         Controls.Add(control);
     }
 }
コード例 #31
0
ファイル: AvalonPadContent.cs プロジェクト: Altaxo/Altaxo
		internal void LoadPadContentIfRequired()
		{
			bool dockingManagerIsInitializing = layout.Busy || !layout.DockingManager.IsLoaded;
			if (placeholder != null && placeholder.IsVisible && !dockingManagerIsInitializing) {
				placeholder.IsVisibleChanged -= AvalonPadContent_IsVisibleChanged;
				padInstance = descriptor.PadContent;
				if (padInstance != null) {
					bool isFocused = this.IsKeyboardFocused;
					this.SetContent(padInstance.Control, padInstance);
					placeholder = null;
					
					if (isFocused) {
						IInputElement initialFocus = padInstance.InitiallyFocusedControl as IInputElement;
						if (initialFocus != null) {
							Dispatcher.BeginInvoke(DispatcherPriority.Background,
							                       new Action(delegate { Keyboard.Focus(initialFocus); }));
						}
					}
				}
			}
		}
コード例 #32
0
ファイル: PadDescriptor.cs プロジェクト: carlhuth/GenXSource
 public void CreatePad()
 {
                 #if DEBUG
     if (WorkbenchSingleton.InvokeRequired)
     {
         throw new InvalidOperationException("This action could trigger pad creation and is only valid on the main thread!");
     }
                 #endif
     if (!padContentCreated)
     {
         padContentCreated = true;
         if (addIn != null)
         {
             padContent = (IPadContent)addIn.CreateObject(Class);
         }
         else
         {
             padContent = (IPadContent)Activator.CreateInstance(padType);
         }
     }
 }
コード例 #33
0
		/// <summary>
		/// <para>Inserts a <see cref='.IPadContent'/> into the <see cref='.PadContentCollection'/> at the specified index.</para>
		/// </summary>
		/// <param name='index'>The zero-based index where <paramref name='value'/> should be inserted.</param>
		/// <param name=' value'>The <see cref='.IPadContent'/> to insert.</param>
		/// <returns><para>None.</para></returns>
		/// <seealso cref='.PadContentCollection.Add'/>
		public void Insert(int index, IPadContent value) {
			List.Insert(index, value);
		}
コード例 #34
0
 public void Dispose()
 {
     if (this.padContent != null)
     {
         this.padContent.Dispose();
         this.padContent = null;
     }
 }
コード例 #35
0
 public void Dispose()
 {
     if (padContent != null) {
         padContent.Dispose();
         padContent = null;
     }
 }
コード例 #36
0
 public bool IsVisible(IPadContent padContent)
 {
     DockItem item = GetDockItem (padContent);
     if (item != null)
         return item.IsAttached;
     return false;
 }
コード例 #37
0
        void AddPad(IPadContent content, string placement)
        {
            DockItem item = new DockItem (content.Id,
                                 content.Title,
                                 content.Icon,
                                 DockItemBehavior.Normal);

            Gtk.Label label = item.TabLabel as Gtk.Label;
            label.UseMarkup = true;

            if (content is Widget)
                item.Add (content.Control);
            else {
                CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
                crc.Show ();
                item.Add (crc);
            }

            item.Show ();
            item.HideItem ();

            content.TitleChanged += new EventHandler (UpdatePad);
            content.IconChanged += new EventHandler (UpdatePad);

            DockPad (item, placement);

            if (!activePadCollection.Contains (content))
                activePadCollection.Add (content);
        }
コード例 #38
0
 public void CreatePad()
 {
     if (!this.padContentCreated)
     {
         this.padContentCreated = true;
         this.padContent = (IPadContent) this.codon.AddIn.CreateObject(this.Class);
     }
 }
コード例 #39
0
 public void ActivatePad(IPadContent padContent)
 {
     DockItem item = GetDockItem (padContent);
     if (item != null)
         item.Present (null);
 }
コード例 #40
0
		public void HidePad(IPadContent padContent)
		{
			Content content = (Content)contentHash[padContent];
			if (content != null) 
			{
				dockManager.HideContent(content);
			}
		}
コード例 #41
0
		public PadCodon (IPadContent content, string id, string label, string defaultPlacement, string icon)
		{
			this.id               = id;
			this.content          = content;
			this.label            = label;
			this.defaultPlacement = defaultPlacement;
			this.icon             = icon;
		}
コード例 #42
0
		public void ActivatePad(IPadContent padContent)
		{
			Content content = (Content)contentHash[padContent];
			if (content != null) 
			{
				content.BringToFront();
			}
		}
コード例 #43
0
		public bool IsVisible(IPadContent padContent)
		{
			Content content = (Content)contentHash[padContent];
			if (content != null) 
			{
				return content.Visible;
			}
			return false;
		}
コード例 #44
0
		public void ShowPad(IPadContent content)
		{
			if (contentHash[content] == null) 
			{
				IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties());
				string type = content.GetType().ToString();
				content.Control.Dock = DockStyle.None;
				Content c1;
				if (content.Icon != null) 
				{
					ImageList imgList = new ImageList();
					imgList.Images.Add(content.Icon);
					c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0);
				} 
				else 
				{
					c1 = dockManager.Contents.Add(content.Control, content.Title);
				}

                c1.DisplaySize = new Size(270, 200);

				contentHash[content] = c1;


                if (properties.GetProperty(type, "Left") == "Left")
                {
                    if (leftContent == null)
                    {
                        leftContent = dockManager.AddContentWithState(c1, State.DockLeft);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, leftContent);
                    }
                }
                else if (properties.GetProperty(type, "Left") == "Bottom")
                {
                    if (bottomContent == null)
                    {
                        bottomContent = dockManager.AddContentWithState(c1, State.DockBottom);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, bottomContent);
                    }
                }
			} 
			else 
			{
				Content c = (Content)contentHash[content];
				if (c != null) 
				{
					dockManager.ShowContent(c);
				}
			}
		}
コード例 #45
0
 public override object BuildItem(object owner, ArrayList subItems, ConditionCollection conditions)
 {
     content = CreatePad ();
     return this;
 }
コード例 #46
0
 public void CreatePad()
 {
     if (SD.MainThread.InvokeRequired) {
         throw new InvalidOperationException("This action could trigger pad creation and is only valid on the main thread!");
     }
     if (!padContentCreated) {
         padContentCreated = true;
         try {
             if (addIn != null) {
                 LoggingService.Debug("Creating pad " + Class + "...");
                 padContent = (IPadContent)addIn.CreateObject(Class);
             } else {
                 padContent = (IPadContent)Activator.CreateInstance(padType);
             }
         } catch (Exception ex) {
             MessageService.ShowException(ex, "Error creating pad instance");
         }
     }
 }
コード例 #47
0
		/// <summary>
		///    <para> Removes a specific <see cref='.IPadContent'/> from the
		///    <see cref='.PadContentCollection'/> .</para>
		/// </summary>
		/// <param name='value'>The <see cref='.IPadContent'/> to remove from the <see cref='.PadContentCollection'/> .</param>
		/// <returns><para>None.</para></returns>
		/// <exception cref='System.ArgumentException'><paramref name='value'/> is not found in the Collection. </exception>
		public void Remove(IPadContent value) {
			List.Remove(value);
		}
コード例 #48
0
		void CreateContent ()
		{
			if (this.content == null) {
				this.content = codon.InitializePadContent (this);
			}
		}
コード例 #49
0
		/// <summary>
		///     <para>
		///       Initializes a new instance of <see cref='.PadContentCollection'/> containing any array of <see cref='.IPadContent'/> objects.
		///    </para>
		/// </summary>
		/// <param name='value'>
		///       A array of <see cref='.IPadContent'/> objects with which to intialize the collection
		/// </param>
		public PadContentCollection(IPadContent[] value) {
			this.AddRange(value);
		}
コード例 #50
0
 /// <summary>
 ///    <para>Adds a <see cref='.IPadContent'/> with the specified value to the
 ///    <see cref='.PadContentCollection'/> .</para>
 /// </summary>
 /// <param name='value'>The <see cref='.IPadContent'/> to add.</param>
 /// <returns>
 ///    <para>The index at which the new element was inserted.</para>
 /// </returns>
 /// <seealso cref='.PadContentCollection.AddRange'/>
 public int Add(IPadContent value)
 {
     return List.Add(value);
 }
コード例 #51
0
		/// <summary>
		/// <para>Copies the elements of an array to the end of the <see cref='.PadContentCollection'/>.</para>
		/// </summary>
		/// <param name='value'>
		///    An array of type <see cref='.IPadContent'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		///   <para>None.</para>
		/// </returns>
		/// <seealso cref='.PadContentCollection.Add'/>
		public void AddRange(IPadContent[] value) {
			for (int i = 0; (i < value.Length); i = (i + 1)) {
				this.Add(value[i]);
			}
		}
コード例 #52
0
		public PadCodon (IPadContent content, string id, string label, string defaultPlacement, string icon)
			: this (content, id, label, defaultPlacement, DockItemStatus.Dockable, icon)
		{
		}
コード例 #53
0
 public void HidePad(IPadContent padContent)
 {
     DockItem item = GetDockItem (padContent);
     if (item != null)
         item.HideItem();
 }
コード例 #54
0
		/// <summary>
		/// <para>Gets a value indicating whether the
		///    <see cref='.PadContentCollection'/> contains the specified <see cref='.IPadContent'/>.</para>
		/// </summary>
		/// <param name='value'>The <see cref='.IPadContent'/> to locate.</param>
		/// <returns>
		/// <para><see langword='true'/> if the <see cref='.IPadContent'/> is contained in the collection;
		///   otherwise, <see langword='false'/>.</para>
		/// </returns>
		/// <seealso cref='.PadContentCollection.IndexOf'/>
		public bool Contains(IPadContent value) {
			return List.Contains(value);
		}
コード例 #55
0
        public void ShowPad(IPadContent content)
        {
            DockItem item = GetDockItem (content);
            if (item != null) {

                // TODO: ShowItem is not working properly in the
                // managed Gdl.
            /*				if (item.DefaultPosition != null)
                    item.ShowItem();
                else
            */					DockPad (item, content.DefaultPlacement);
            }
            else
                AddPad (content, content.DefaultPlacement);
        }
コード例 #56
0
		/// <summary>
		/// <para>Copies the <see cref='.PadContentCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
		///    specified index.</para>
		/// </summary>
		/// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='.PadContentCollection'/> .</para></param>
		/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
		/// <returns>
		///   <para>None.</para>
		/// </returns>
		/// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='.PadContentCollection'/> is greater than the available space between <paramref name='arrayIndex'/> and the end of <paramref name='array'/>.</para></exception>
		/// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
		/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='arrayIndex'/> is less than <paramref name='array'/>'s lowbound. </exception>
		/// <seealso cref='System.Array'/>
		public void CopyTo(IPadContent[] array, int index) {
			List.CopyTo(array, index);
		}
コード例 #57
0
 DockItem GetDockItem(IPadContent content)
 {
     if (activePadCollection.Contains (content))
     {
         DockItem item = dock.GetItemByName (content.Id);
         return item;
     }
     return null;
 }
コード例 #58
0
		/// <summary>
		///    <para>Returns the index of a <see cref='.IPadContent'/> in
		///       the <see cref='.PadContentCollection'/> .</para>
		/// </summary>
		/// <param name='value'>The <see cref='.IPadContent'/> to locate.</param>
		/// <returns>
		/// <para>The index of the <see cref='.IPadContent'/> of <paramref name='value'/> in the
		/// <see cref='.PadContentCollection'/>, if found; otherwise, -1.</para>
		/// </returns>
		/// <seealso cref='.PadContentCollection.Contains'/>
		public int IndexOf(IPadContent value) {
			return List.IndexOf(value);
		}
コード例 #59
0
		public PadCodon (IPadContent content, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, string icon)
		{
			this.id               = id;
			this.content          = content;
			this.label            = label;
			this.defaultPlacement = defaultPlacement;
			this.icon             = icon;
			this.defaultStatus    = defaultStatus;
		}
コード例 #60
0
		public IPadContent InitializePadContent (IPadWindow window)
		{
			if (content == null) {
				content = CreatePad ();
				content.Initialize (window);
			} else if (!initializeCalled)
				content.Initialize (window);
			
			initializeCalled = true;
			return content;
		}