public DialGroupEntry(string name, string mask, string number, string comment) { this.name = DialGroupEntryName.Parse(name); this.numberMask = DialGroupEntryNumberMask.Parse(mask); this.dialedNumber = DialGroupEntryDialedNumber.Parse(number); this.comment = DialGroupEntryComment.Parse(comment); this.Validate(); }
public DialGroupEntry(PSObject importedObject) { try { this.name = DialGroupEntryName.Parse((string)importedObject.Properties["Name"].Value); this.numberMask = DialGroupEntryNumberMask.Parse((string)importedObject.Properties["NumberMask"].Value); this.dialedNumber = DialGroupEntryDialedNumber.Parse((string)importedObject.Properties["DialedNumber"].Value); this.comment = DialGroupEntryComment.Parse((string)importedObject.Properties["Comment"].Value); } catch (NullReferenceException) { throw new FormatException(DataStrings.InvalidDialGroupEntryCsvFormat); } this.Validate(); }