Ejemplo n.º 1
0
 private static bool SyntaxTreeIsInIgoredFile(SyntaxTree syntaxTree, SettingsDetails settings) =>
 settings.IgnorePathsRegex != "" && Regex.Match(syntaxTree.FilePath, settings.IgnorePathsRegex).Success;
Ejemplo n.º 2
0
 public static bool IgnoredFile(SyntaxNode node, SettingsDetails settings) =>
 SyntaxTreeIsInIgoredFile(node.SyntaxTree, settings);
        private void SaveSettings()
        {
            var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);

            si = new Settings ();
            si.SettingsList = new List<SettingsDetails> ();
            SettingsDetails sid = new SettingsDetails ();
            var filename = Path.Combine (documents, "delugemobile_settings.xml");
            sid.host = url.Value;

            int iport;
            int.TryParse (port.Value, out iport);

            sid.port = iport;
            sid.auto = autoupdt.Value;
            sid.pass = password.Value;

            si.SettingsList.Add (sid);

            XmlSerializer serializer = new XmlSerializer (typeof(Settings));
            TextWriter textWriter = new StreamWriter (filename);
            serializer.Serialize (textWriter, si);
            textWriter.Close ();
        }
Ejemplo n.º 4
0
 private static bool IgnoredFile(ISymbol symbol, SettingsDetails settings) =>
 SyntaxTreeIsInIgoredFile(symbol.DeclaringSyntaxReferences[0].SyntaxTree, settings);
        private void SaveSettings()
        {
            var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
            var filename = Path.Combine (documents, "proscanmobile_servers.xml");

            Servers s_tmp = new Servers ();
            s_tmp.ServerList = new List<ServerDetails> ();

            foreach (ServerDetails sd_tmp in s.ServerList) {
                s_tmp.ServerList.Add (new ServerDetails () {
                    host = XmlConvert.EncodeName(sd_tmp.host),
                    port = XmlConvert.EncodeName(sd_tmp.port),
                    desc = XmlConvert.EncodeName(sd_tmp.desc),
                    country = XmlConvert.EncodeName(sd_tmp.country),
                    state = XmlConvert.EncodeName(sd_tmp.state),
                    county = XmlConvert.EncodeName(sd_tmp.county),
                    open = XmlConvert.EncodeName(sd_tmp.open)
                });
            }

            XmlSerializer serializer = new XmlSerializer (typeof(Servers));
            TextWriter textWriter = new StreamWriter (filename);
            serializer.Serialize (textWriter, s_tmp);
            textWriter.Close ();

            s_tmp = null;

            si = new Settings ();
            si.SettingsList = new List<SettingsDetails> ();
            SettingsDetails sid = new SettingsDetails ();
            filename = Path.Combine (documents, "proscanmobile_settings.xml");
            sid.host = _txtServerHost.Text;

            int port;
            int.TryParse (_txtServerPort.Text, out port);

            sid.port = port;
            sid.auto = _swAutoConnect.On;
            #if PLUS_VERSION
            sid.pass = enc.Encrypt(_txtServerPassword.Text);
            #else
            sid.pass = string.Empty;
            #endif
            si.SettingsList.Add (sid);

            serializer = new XmlSerializer (typeof(Settings));
            textWriter = new StreamWriter (filename);
            serializer.Serialize (textWriter, si);
            textWriter.Close ();
        }