Пример #1
0
 private void AddTaskItem(Expando ep)
 {
     dt.DefaultView.RowFilter = "parentNo = '" + ep.Tag.ToString() + "'";
     for (int i = 0; i < dt.DefaultView.Count; i++)
     {
         TaskItem taskItem = new TaskItem();
         taskItem.Name = dt.DefaultView[i]["formName"].ToString();
         taskItem.Text = dt.DefaultView[i]["menuName"].ToString();
         taskItem.Tag = dt.DefaultView[i]["menuNo"];
         //taskItem.Click += new EventHandler(taskItem_Click);
         ep.Items.Add(taskItem);
     }
 }
Пример #2
0
        private void frmMenuExplorer_Load(object sender, EventArgs e)
        {
            //Create the Group Vible Panel Commands          
            foreach (PluginGroup mg in ContextManager.Context.GetPluginManager().Groups)
            {
                if (mg.Visible == 1)
                {
                    Expando _Expando = new Expando();
                    _Expando.Text = mg.Name;
                    _Expando.TitleImage = mg.Image;
                    _Expando.Animate = true;
                    _Expando.AutoLayout = true;
                    _Expando.SpecialGroup = true;
                    _Expando.ForeColor = Color.Black;

                    _tpKonekti.Expandos.Add(_Expando);

                    foreach (PluginCommand cm in mg.Commands)
                    {
                        if (cm.Visible == 1)
                        {
                            TaskItem _CurrentTaskItem = new TaskItem();

                            _CurrentTaskItem.Text = cm.Name;                            
                            _CurrentTaskItem.Image = cm.Image;                            
                            _CurrentTaskItem.Tag = cm.Id; //Save the plugin                    
                            _CurrentTaskItem.Click += new EventHandler(_CurrentGroupMenu_Click);

                            _Expando.Items.Add(_CurrentTaskItem);
                        }
                    }
                }
            }

            // foreverblue.dll is a cut down version of the the 
            // forever blue theme. do not attempt to use this as 
            // a proper theme for XP as Windows may crash due to 
            // several images being removed from the dll to keep
            // file sizes down.  the original forever blue theme 
            // can be found at http://www.themexp.org/
            this._tpKonekti.UseCustomTheme(ContextManager.Context.GetAppPath() + "foreverblue.dll");
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the TaskLinkInfo class with default settings
        /// </summary>
        public TaskItemInfo()
        {
            // set padding values
            this.padding = new Padding(6, 0, 4, 0);

            // set margin values
            this.margin = new Margin(0, 4, 0, 0);

            // set Text values
            this.linkNormal = SystemColors.ControlText;
            this.linkHot = SystemColors.ControlText;

            this.fontDecoration = FontStyle.Underline;

            this.owner = null;
        }
Пример #4
0
        /// <summary>
        /// Loads the recent learning modules into GUI.
        /// </summary>
        /// <remarks>Documented by Dev08, 2009-03-04</remarks>
        private void LoadRecentLearningModulesIntoGUI()
        {
            expandoRecent.Items.Clear();

            int numberRecentFiles = RecentLearningModules.GetRecentModules().Count;
            if (numberRecentFiles == 0)
            {
                expandoRecent.Hide();
                return;
            }
            else
            {
                if (numberRecentFiles > MLifter.Controls.Properties.Settings.Default.MaxRecentFilesInExpander)
                    numberRecentFiles = MLifter.Controls.Properties.Settings.Default.MaxRecentFilesInExpander;

                int height = 35 + numberRecentFiles * ((new TaskItem().Height) + 5);
                expandoRecent.ExpandedHeight = height;
                //expandoRecent.Height = height;
            }

            int counter = 0;
            ToolTip tTip = new ToolTip();
            Point startPos = new Point(12, 35);
            foreach (LearningModulesIndexEntry entry in RecentLearningModules.GetRecentModules())
            {
                if (counter >= MLifter.Controls.Properties.Settings.Default.MaxRecentFilesInExpander)
                    break;

                TaskItem taskItem = new TaskItem();
                taskItem.Location = new Point(startPos.X, startPos.Y + ((taskItem.Height + 5) * counter));
                taskItem.Text = (entry.DisplayName == null || entry.DisplayName == string.Empty ? Resources.ERROR_LEARNINGMODULE_NONAME : entry.DisplayName) +
                    (entry.ConnectionName != null || entry.ConnectionName == string.Empty ? " (" + entry.ConnectionName + ")" : string.Empty);

                tTip.SetToolTip(taskItem, taskItem.Text);

                while (taskItem.PreferredWidth > expandoRecent.ClientSize.Width - startPos.X) taskItem.Text = taskItem.Text.Substring(0, taskItem.Text.Length - 4) + "...";
                taskItem.Width = expandoRecent.ClientSize.Width - startPos.X;

                taskItem.Tag = entry;
                taskItem.Click += new EventHandler(RecentItem_Click);
                if (entry.ConnectionString.Typ == DatabaseType.MsSqlCe || entry.ConnectionString.Typ == DatabaseType.Xml)
                    taskItem.Image = Resources.learning_16;
                else
                    taskItem.Image = Resources.world_16;
                taskItem.TextAlign = ContentAlignment.MiddleLeft;
                expandoRecent.Items.Add(taskItem);

                counter++;
            }
        }
Пример #5
0
            /// <summary>
            /// Returns a TaskItem that contains the deserialized TaskItemSurrogate data
            /// </summary>
            /// <returns>A TaskItem that contains the deserialized TaskItemSurrogate data</returns>
            public TaskItem Save()
            {
                TaskItem taskItem = new TaskItem();

                taskItem.Name = this.Name;
                taskItem.Size = this.Size;
                taskItem.Location = this.Location;

                taskItem.BackColor = ThemeManager.ConvertStringToColor(this.BackColor);

                taskItem.customSettings = this.CustomSettings.Save();
                taskItem.customSettings.TaskItem = taskItem;

                taskItem.Text = this.Text;
                taskItem.ShowFocusCues = this.ShowFocusCues;
                taskItem.Image = ThemeManager.ConvertByteArrayToImage(this.Image);

                taskItem.Enabled = this.Enabled;
                taskItem.Visible = this.Visible;

                taskItem.Anchor = this.Anchor;
                taskItem.Dock = this.Dock;

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

                taskItem.Tag = ThemeManager.ConvertByteArrayToObject(this.Tag);

                return taskItem;
            }
Пример #6
0
            /// <summary>
            /// Populates the TaskItemSurrogate with data that is to be 
            /// serialized from the specified TaskItem
            /// </summary>
            /// <param name="taskItem">The TaskItem that contains the data 
            /// to be serialized</param>
            public void Load(TaskItem taskItem)
            {
                this.Name = taskItem.Name;
                this.Size = taskItem.Size;
                this.Location = taskItem.Location;

                this.BackColor = ThemeManager.ConvertColorToString(taskItem.BackColor);

                this.CustomSettings = new TaskItemInfo.TaskItemInfoSurrogate();
                this.CustomSettings.Load(taskItem.CustomSettings);

                this.Text = taskItem.Text;
                this.ShowFocusCues = taskItem.ShowFocusCues;
                this.Image = ThemeManager.ConvertImageToByteArray(taskItem.Image);

                this.Enabled = taskItem.Enabled;
                this.Visible = taskItem.Visible;

                this.Anchor = taskItem.Anchor;
                this.Dock = taskItem.Dock;

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

                this.Tag = ThemeManager.ConvertObjectToByteArray(taskItem.Tag);
            }