Esempio n. 1
0
 private void BuildVersionLive(BuildVersionData data)
 {
     Dispatcher.Invoke(() =>
     {
         LiveBuildVersions.Add(data);
     });
 }
Esempio n. 2
0
 private void BuildVersionStaging(BuildVersionData data)
 {
     Dispatcher.Invoke(() =>
     {
         StagingBuildVersions.Add(data);
     });
 }
Esempio n. 3
0
        void RunDelete(bool staging)
        {
            ListBox listBox = staging ? stagingBuildList : liveBuildList;

            if (listBox.SelectedValue == null)
            {
                return;
            }
            BuildVersionData buildData = (BuildVersionData)listBox.SelectedValue;

            EpicApi.Run(EpicApi.BuildDeleteCommand(App.saveData, productData, buildData.buildVersion, staging));
        }
Esempio n. 4
0
        void StartLabeler(bool staging, bool add)
        {
            ListBox listBox = staging ? stagingBuildList : liveBuildList;

            if (listBox.SelectedValue == null)
            {
                return;
            }
            BuildVersionData buildData = (BuildVersionData)listBox.SelectedValue;
            LabelData        labelData = new LabelData {
                staging = staging, version = buildData.buildVersion, label = add ? "Live" : "Rollback"
            };

            new Labeler(productData, labelData, add).ShowDialog();
        }
Esempio n. 5
0
        public static void HandleGradleVersion(string gradlePath, BuildVersionData gradleData)
        {
            if (!File.Exists(gradlePath) || gradleData == null)
            {
                return;
            }

            Type type = typeof(BuildVersionData);

            PropertyInfo[] propertyInfos = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);

            StringBuilder writeLines = new StringBuilder();

            using (StreamReader sr = new StreamReader(File.OpenRead(gradlePath)))
            {
                string line = null;
                while ((line = sr.ReadLine()) != null)
                {
                    var infos = propertyInfos.Where(item => { return(line.Contains("ext." + item.Name.Substring(2))); });
                    if (infos != null && infos.FirstOrDefault() != null)
                    {
                        var info = infos.FirstOrDefault();
                        if (info.PropertyType == typeof(string))
                        {
                            writeLines.Append(string.Format("ext.{0} = \"{1}\"\n", info.Name.Substring(2), info.GetValue(gradleData).ToString()));
                        }
                        else
                        {
                            writeLines.Append(string.Format("ext.{0} = {1}\n", info.Name.Substring(2), info.GetValue(gradleData).ToString()));
                        }
                    }
                    else
                    {
                        writeLines.Append(line + "\n");
                    }
                }
            }
            if (File.Exists(gradlePath))
            {
                File.Delete(gradlePath);
            }
            File.WriteAllText(gradlePath, writeLines.ToString());
        }