Exemplo n.º 1
0
        public void SetTableConnectionInterface(IWebPartTable provider)
        {
            if (powerWebPartException != null)
            {
                return;
            }

            tableProviderToConsume = provider;

            provider.GetTableData(delegate(ICollection table)
            {
                if (functions.ContainsKey(FunctionTableConsumer))
                {
                    EnsureChildControls();

                    try
                    {
                        Command cmd = new Command(FunctionTableConsumer);

                        cmd.Parameters.Add(new CommandParameter("collection", table));
                        cmd.Parameters.Add(new CommandParameter("schema", tableProviderToConsume.Schema));

                        Pipeline pipe = runspace.CreatePipeline();
                        pipe.Commands.Add(cmd);
                        InvokePipeline(pipe);
                    }
                    catch (Exception ex)
                    {
                        powerWebPartException = new PowerWebPartException(FunctionTableConsumer, ex);
                    }
                }
            });
        }
Exemplo n.º 2
0
        public void SetTableConnectionInterface(IWebPartTable provider)
        {
            EnsureChildControls();

            if (powerControl == null)
            {
                return;
            }

            powerControl.SetTableConnectionInterface(provider);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Simple way to get data and schema from provider.
 /// </summary>
 /// <param name="provider">IWebPartTable provider</param>
 /// <param name="callback">Callback</param>
 public static void GetTableData(this IWebPartTable provider, Action <ICollection, PropertyDescriptorCollection> callback)
 {
     if (provider != null)
     {
         provider.GetTableData(d =>
         {
             if (d != null && d.Count > 0)
             {
                 callback(d, provider.Schema);
             }
         });
     }
 }
 public void SetConnectionInterface(IWebPartTable provider)
 {
     _provider = provider;
 }
Exemplo n.º 5
0
 public void GetTableProvider(IWebPartTable provider)
 {
     this.provider = provider;
 }
Exemplo n.º 6
0
 public void SetTableConnectionInterface(IWebPartTable provider)
 {
     tableProviderToConsume = provider;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Simple way to get data and schema from provider.
 /// </summary>
 /// <param name="provider">IWebPartTable provider</param>
 /// <param name="callback">Callback</param>
 public static void GetDataTable(this IWebPartTable provider, Action <DataTable> callback)
 {
     provider.GetTableData((d, s) => callback(d.ToDataTable(s)));
 }