public override PresetItem Clone() { FirewallPreset item = new FirewallPreset(); Clone(item); item.ProgSetId = this.ProgSetId; item.OnState = this.OnState; item.OffState = this.OffState; item.Rules = this.Rules.ToDictionary(entry => entry.Key, entry => entry.Value); return(item); }
public void PinProg(Guid ProgSetId, string name) { PresetGroup preset = FindPreset(name); FirewallPreset item = new FirewallPreset(); item.ProgSetId = ProgSetId; item.Sync(); // gets the name and so on preset.Items.Add(item.guid, item); UpdatePreset(preset); }
public static PresetItem New(PresetType Type) { PresetItem item = null; switch (Type) { case PresetType.Tweak: item = new TweakPreset(); break; case PresetType.Firewall: item = new FirewallPreset(); break; case PresetType.Custom: item = new CustomPreset(); break; default: return(null); } item.Type = Type; return(item); }