Пример #1
0
 private static PSControl RehydratePSControl(PSObject deserializedControl)
 {
     if (Deserializer.IsDeserializedInstanceOfType((object)deserializedControl, typeof(TableControl)))
     {
         return (PSControl) new TableControl()
                {
                    Headers = DeserializingTypeConverter.RehydrateList <List <TableControlColumnHeader>, TableControlColumnHeader>(deserializedControl, "Headers", DeserializingTypeConverter.RehydrationFlags.NullValueBad),
                    Rows    = DeserializingTypeConverter.RehydrateList <List <TableControlRow>, TableControlRow>(deserializedControl, "Rows", DeserializingTypeConverter.RehydrationFlags.NullValueBad)
                }
     }
     ;
     if (Deserializer.IsDeserializedInstanceOfType((object)deserializedControl, typeof(ListControl)))
     {
         return (PSControl) new ListControl()
                {
                    Entries = DeserializingTypeConverter.RehydrateList <List <ListControlEntry>, ListControlEntry>(deserializedControl, "Entries", DeserializingTypeConverter.RehydrationFlags.NullValueBad)
                }
     }
     ;
     return(Deserializer.IsDeserializedInstanceOfType((object)deserializedControl, typeof(WideControl)) ? (PSControl) new WideControl()
     {
         Alignment = DeserializingTypeConverter.GetPropertyValue <Alignment>(deserializedControl, "Alignment"),
         Columns = DeserializingTypeConverter.GetPropertyValue <uint>(deserializedControl, "Columns"),
         Entries = DeserializingTypeConverter.RehydrateList <List <WideControlEntryItem>, WideControlEntryItem>(deserializedControl, "Entries", DeserializingTypeConverter.RehydrationFlags.NullValueBad)
     } : throw DeserializingTypeConverter._trace.NewArgumentException("pso"));
 }
Пример #2
0
 private static ListControlEntry RehydrateListControlEntry(
     PSObject deserializedEntry)
 {
     return(new ListControlEntry()
     {
         Items = DeserializingTypeConverter.RehydrateList <List <ListControlEntryItem>, ListControlEntryItem>(deserializedEntry, "Items", DeserializingTypeConverter.RehydrationFlags.NullValueBad),
         SelectedBy = DeserializingTypeConverter.RehydrateList <List <string>, string>(deserializedEntry, "SelectedBy", DeserializingTypeConverter.RehydrationFlags.NullValueOk)
     });
 }
Пример #3
0
 private static WideControlEntryItem RehydrateWideControlEntryItem(
     PSObject deserializedEntryItem)
 {
     return(new WideControlEntryItem()
     {
         DisplayEntry = DeserializingTypeConverter.GetPropertyValue <DisplayEntry>(deserializedEntryItem, "DisplayEntry"),
         SelectedBy = DeserializingTypeConverter.RehydrateList <List <string>, string>(deserializedEntryItem, "SelectedBy", DeserializingTypeConverter.RehydrationFlags.NullValueOk)
     });
 }
Пример #4
0
 private static ExtendedTypeDefinition RehydrateExtendedTypeDefinition(
     PSObject deserializedTypeDefinition)
 {
     return(new ExtendedTypeDefinition(DeserializingTypeConverter.GetPropertyValue <string>(deserializedTypeDefinition, "TypeName"), DeserializingTypeConverter.RehydrateList <List <FormatViewDefinition>, FormatViewDefinition>(deserializedTypeDefinition, "FormatViewDefinition", DeserializingTypeConverter.RehydrationFlags.NullValueBad)));
 }
Пример #5
0
 private static TableControlRow RehydrateTableControlRow(PSObject deserializedRow) => new TableControlRow()
 {
     Columns = DeserializingTypeConverter.RehydrateList <List <TableControlColumn>, TableControlColumn>(deserializedRow, "Columns", DeserializingTypeConverter.RehydrationFlags.NullValueBad)
 };