Beispiel #1
0
        //private void SetupStartMenu()
        //{
        //    this.helper = new StartMenuHelper();
        //    this.helper.Changed += new ChangedEventHandler(helper_Changed);
        //    this.LoadArray();
        //}

        private void LoadArray()
        {
            this.startMenuArray = new ArrayListDataSet();
            foreach (StartMenuItem entryPoint in helper.StartMenuItems)
            {
                StartMenuCommand cmd = new StartMenuCommand(this, this.helper, entryPoint);
                cmd.Description = entryPoint.Title;
                cmd.Invoked    += delegate(object Sender, EventArgs Args)
                {
                    if (Sender is StartMenuCommand)
                    {
                        string       strDelete = string.Format("Are you sure you want to delete {0}?", ((StartMenuCommand)Sender).Name);
                        DialogResult res       = OMLApplication.Current.MediaCenterEnvironment.Dialog(strDelete, "DELETE ITEM", DialogButtons.Yes | DialogButtons.No, -1, true);
                        if (res == DialogResult.Yes)
                        {
                            this.helper.DeleteStartMenuItem(((StartMenuCommand)Sender).EntryPoint);
                        }
                    }
                };
                this.startMenuArray.Add(cmd);
                Guid entryPointGuid = new Guid(entryPoint.ItemId);
                bool isregistered   = AddInHost.Current.ApplicationContext.IsEntryPointRegistered(entryPointGuid);
            }
            FirePropertyChanged("StartMenuArray");
        }
 //private void SetupStartMenu()
 //{
 //    this.helper = new StartMenuHelper();
 //    this.helper.Changed += new ChangedEventHandler(helper_Changed);
 //    this.LoadArray();
 //}
 private void LoadArray()
 {
     this.startMenuArray = new ArrayListDataSet();
     foreach (StartMenuItem entryPoint in helper.StartMenuItems)
     {
         StartMenuCommand cmd = new StartMenuCommand(this, this.helper, entryPoint);
         cmd.Description = entryPoint.Title;
         cmd.Invoked += delegate(object Sender, EventArgs Args)
         {
             if (Sender is StartMenuCommand)
             {
                 string strDelete = string.Format("Are you sure you want to delete {0}?", ((StartMenuCommand)Sender).Name);
                 DialogResult res = OMLApplication.Current.MediaCenterEnvironment.Dialog(strDelete, "DELETE ITEM", DialogButtons.Yes | DialogButtons.No, -1, true);
                 if (res == DialogResult.Yes)
                 {
                     this.helper.DeleteStartMenuItem(((StartMenuCommand)Sender).EntryPoint);
                 }
             }
         };
         this.startMenuArray.Add(cmd);
         Guid entryPointGuid = new Guid(entryPoint.ItemId);
         bool isregistered = AddInHost.Current.ApplicationContext.IsEntryPointRegistered(entryPointGuid);
     }
     FirePropertyChanged("StartMenuArray");
 }