Beispiel #1
0
        public CSourceConfigData GetConfigData()
        {
            CSourceConfigData configdata = new CSourceConfigData();

            configdata.Name   = Name;
            configdata.URL    = URL;
            configdata.Prefix = Prefix;
            configdata.KeepChannelsIds.AddRange(KeepChannelsIds);
            foreach (var kv in RenameChannelsIds)
            {
                configdata.RenameChannelsIds.Add(kv.Key, kv.Value);
            }
            return(configdata);
        }
Beispiel #2
0
 public void SetConfigData(CSourceConfigData configdata)
 {
     Name   = configdata.Name;
     URL    = configdata.URL;
     Prefix = configdata.Prefix;
     KeepChannelsIds.Clear();
     KeepChannelsIds.AddRange(configdata.KeepChannelsIds);
     RenameChannelsIds.Clear();
     foreach (var kv in configdata.RenameChannelsIds)
     {
         RenameChannelsIds.Add(kv.Key, kv.Value);
     }
     FillKeepChannelsById();
     CheckConfigData();
 }
Beispiel #3
0
        public void AddSource(CSourceConfigData sourceConfigData)
        {
            lock (this)
            {
                CSource source;
                if (SourcesByName.TryGetValue(sourceConfigData.Name, out source))
                {
                    DoError("Duplicate source names");
                    return;
                }
                source = new CSource();
                source.SetConfigData(sourceConfigData);
                Sources.Add(source);
                SourcesByName[sourceConfigData.Name] = source;
                source.SourceEventListener          += OnSourceEvent;

                ConfigHasChenged = true;
            }
        }
Beispiel #4
0
        public CSource CreateSource(string name)
        {
            lock (this)
            {
                CSource source;
                if (SourcesByName.TryGetValue(name, out source))
                {
                    DoError("Duplicate source names");
                    return(null);
                }
                source = new CSource();
                CSourceConfigData sourceConfigData = new CSourceConfigData();
                sourceConfigData.Name = name;
                source.SetConfigData(sourceConfigData);
                Sources.Add(source);
                SourcesByName[sourceConfigData.Name] = source;
                source.SourceEventListener          += OnSourceEvent;

                ConfigHasChenged = true;

                return(source);
            }
        }
        public void AddSource(CSourceConfigData sourceConfigData)
        {
            lock (this)
            {
                CSource source;
                if (SourcesByName.TryGetValue(sourceConfigData.Name, out source))
                {
                    DoError("Duplicate source names");
                    return;
                }
                source = new CSource();
                source.SetConfigData(sourceConfigData);
                Sources.Add(source);
                SourcesByName[sourceConfigData.Name] = source;
                source.SourceEventListener += OnSourceEvent;

                ConfigHasChenged = true;
            }
        }
        public CSource CreateSource(string name)
        {
            lock (this)
            {
                CSource source;
                if (SourcesByName.TryGetValue(name, out source))
                {
                    DoError("Duplicate source names");
                    return null;
                }
                source = new CSource();
                CSourceConfigData sourceConfigData = new CSourceConfigData();
                sourceConfigData.Name = name;
                source.SetConfigData(sourceConfigData);
                Sources.Add(source);
                SourcesByName[sourceConfigData.Name] = source;
                source.SourceEventListener += OnSourceEvent;

                ConfigHasChenged = true;

                return source;
            }
        }
Beispiel #7
0
 public void SetConfigData(CSourceConfigData configdata)
 {
     Name = configdata.Name;
     URL = configdata.URL;
     Prefix = configdata.Prefix;
     KeepChannelsIds.Clear();
     KeepChannelsIds.AddRange(configdata.KeepChannelsIds);
     RenameChannelsIds.Clear();
     foreach (var kv in configdata.RenameChannelsIds)
         RenameChannelsIds.Add(kv.Key, kv.Value);
     FillKeepChannelsById();
     CheckConfigData();
 }
Beispiel #8
0
 public CSourceConfigData GetConfigData()
 {
     CSourceConfigData configdata = new CSourceConfigData();
     configdata.Name = Name;
     configdata.URL = URL;
     configdata.Prefix = Prefix;
     configdata.KeepChannelsIds.AddRange(KeepChannelsIds);
     foreach (var kv in RenameChannelsIds)
         configdata.RenameChannelsIds.Add(kv.Key, kv.Value);
     return configdata;
 }