Example #1
0
        public string GetShareLink()
        {
            if (Type == ProjectType.Xray)
            {
                StringBuilder strBuilder = new StringBuilder();
                XraySettings.Types.ForEach(type =>
                {
                    var link = ShareLink.Build(type, XraySettings);
                    strBuilder.AppendLine(link);
                });
                return(strBuilder.ToString());
            }

            if (Type == ProjectType.TrojanGo)
            {
                return(ShareLink.BuildTrojanGo(TrojanGoSettings));
            }

            if (Type == ProjectType.NaiveProxy)
            {
                return(ShareLink.BuildNaiveProxy(NaiveProxySettings));
            }

            return(string.Empty);
        }
Example #2
0
        private void ExportXraySettings(object sender, RoutedEventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            foreach (var record in Records.Where(x => x.IsChecked))
            {
                record.Settings.Types.ForEach(type =>
                {
                    var link = ShareLink.Build(type, record.Settings);
                    sb.AppendLine(link);
                });
            }
            var tbx = new TextBoxWindow("分享链接", sb.ToString());

            tbx.ShowDialog();
        }