Example #1
0
        private void OnLoaded()
        {
            GlobalHelper.DeleteTemp();

            if (!File.Exists(GlobalHelper.AddInManagerAssemblyFile))
            {
                return;
            }

            var xml = File.ReadAllText(GlobalHelper.AddInManagerAssemblyFile);

            if (string.IsNullOrEmpty(xml))
            {
                return;
            }

            var models = DotNet.Json.JsonConvert.DeserializeObject <List <AddinAssemblyModel> >(xml);

            if (models == null || models.Count == 0)
            {
                return;
            }

            this.Models = AddinAssemblyModel.Converter(models);
        }
Example #2
0
        private void OnClosed()
        {
            if (Models.Count == 0)
            {
                return;
            }

            try
            {
                var models = AddinAssemblyModel.Converter(Models);

                var json = DotNet.Json.JsonConvert.SerializeObject(models);

                File.WriteAllText(GlobalHelper.AddInManagerAssemblyFile, json);
            }
            catch (Exception ex)
            {
            }
        }