コード例 #1
0
 private void BuildVersionLive(BuildVersionData data)
 {
     Dispatcher.Invoke(() =>
     {
         LiveBuildVersions.Add(data);
     });
 }
コード例 #2
0
 private void BuildVersionStaging(BuildVersionData data)
 {
     Dispatcher.Invoke(() =>
     {
         StagingBuildVersions.Add(data);
     });
 }
コード例 #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));
        }
コード例 #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();
        }
コード例 #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());
        }