Exemple #1
0
        protected override void OnStartup()
        {
            base.OnStartup();

            DirectoryInfo dataFolder = new DirectoryInfo(System.Windows.Forms.Application.UserAppDataPath);

            FileInfo[] files = dataFolder.GetFiles("TaskExpanderConfig.xml");
            if (files.Length != 0)
            {
            }
            else
            {
                activitiesToExpand.Add(DescriptionToExpand.Example());

                FileInfo fileToSave = new FileInfo(dataFolder.FullName + @"\" + @"TaskExpanderConfig.xml");
                if (fileToSave != null)
                {
                    using (FileStream fileStream = fileToSave.Open(FileMode.Create, FileAccess.Write))
                    {
                        XmlSerializer s = new XmlSerializer(typeof(List <DescriptionToExpand>));
                        s.Serialize(fileStream, activitiesToExpand);
                    }
                }
            }

            this.Engine.TaskActivitiesProvider.CompletingActivity += new EventHandler <BritishMicro.TaskClerk.TaskActivityEventArgs>(TaskActivitiesProvider_CompletingActivity);
        }
 public static DescriptionToExpand Example()
 {
     DescriptionToExpand example = new DescriptionToExpand();
     example._comment = "Example - Installed to demonstrate the structure of the xml file";
     example._descriptionToExpandId = new Guid("{D0ACD727-5E7A-4e47-BC23-E4FFE7989378}");
     example._descriptionsUsedInExpand.Add(new ExpandDescriptionItem(new Guid("{1562BD81-145B-4a8f-A4B2-680A26C254C2}"), 50));
     example._descriptionsUsedInExpand.Add(new ExpandDescriptionItem(new Guid("{39BD7D47-E1A7-41d5-9B5B-D00C66096376}"), 50));
     return example;
 }
Exemple #3
0
        public static DescriptionToExpand Example()
        {
            DescriptionToExpand example = new DescriptionToExpand
            {
                _comment = "Example - Installed to demonstrate the structure of the xml file",
                _descriptionToExpandId = new Guid("{D0ACD727-5E7A-4e47-BC23-E4FFE7989378}")
            };

            example._descriptionsUsedInExpand.Add(new ExpandDescriptionItem(new Guid("{1562BD81-145B-4a8f-A4B2-680A26C254C2}"), 50));
            example._descriptionsUsedInExpand.Add(new ExpandDescriptionItem(new Guid("{39BD7D47-E1A7-41d5-9B5B-D00C66096376}"), 50));
            return(example);
        }