Beispiel #1
0
 /// <summary>
 /// Creates an <see cref="IReadableColumnProxy"/> from a given column.
 /// </summary>
 /// <param name="column">The column.</param>
 /// <returns>An instance of <see cref="IReadableColumnProxy"/>. The type of instance returned depends on the type of the provided column (e.g. whether the column is part of the document or not).</returns>
 public static IReadableColumnProxy FromColumn(IReadableColumn column)
 {
     if (column is ITransformedReadableColumn)
     {
         var tcolumn = (ITransformedReadableColumn)column;
         if (tcolumn.UnderlyingReadableColumn is IDocumentLeafNode)
         {
             return(TransformedReadableColumnProxy.FromColumn(tcolumn));
         }
         else
         {
             return(TransformedReadableColumnProxyForStandaloneColumns.FromColumn(tcolumn));
         }
     }
     else
     {
         if (column is IDocumentLeafNode)
         {
             return(ReadableColumnProxy.FromColumn(column));
         }
         else
         {
             return(ReadableColumnProxyForStandaloneColumns.FromColumn(column));
         }
     }
 }
Beispiel #2
0
            public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = (ReadableColumnProxy)o ?? new ReadableColumnProxy(info);

                object baseobj = info.GetBaseValueEmbedded(s, "AltaxoBase,Altaxo.Main.DocNodeProxy,0", parent); // deserialize the base class

                if (!object.ReferenceEquals(s, baseobj))
                {
                    return(ReadableColumnProxyForStandaloneColumns.FromColumn((IReadableColumn)baseobj));
                }
                else
                {
                    return(s);
                }
            }