void ICellConsumer.CellReady(object sender, CellReadyEventArgs e)
 {
     cellValue = e.Cell;
     if ((--consumersWaiting) == 0)
     {
         PartCommunicationMain();
     }
 }
 void ICellConsumer.CellReady(object sender, CellReadyEventArgs e)
 {
     this.cellValue = e.Cell;
     if (--this.consumersWaiting == 0)
     {
         this.PartCommunicationMain();
     }
 }
        public void CellReady(object sender, CellReadyEventArgs cellReadyArgs)
        {
            RowReadyEventArgs rowArgs = new RowReadyEventArgs();
            BdcView           view    = null;

            cellValue = cellReadyArgs.Cell;
            bool doit = IsEd || !Exed;

            if (_cellConnected && _rowConnected)
            {
                if (rowTable != null)
                {
                    rowTable.Dispose();
                }
                rowTable = new DataTable();
                if (RowArgs.FieldList.Length > 0)
                {
                    foreach (string f in RowArgs.FieldList)
                    {
                        rowTable.Columns.Add(f);
                    }
                    if (doit)
                    {
                        try {
                            view = entity.GetSpecificFinderView();
                            if (entityInstance == null)
                            {
                                entityInstance = GetEntityInstance(view);
                            }
                        } catch {
                        }
                    }
                    rowArgs.Rows = new DataRow [] { rowTable.Rows.Add(new List <string> (RowArgs.FieldList).ConvertAll <object> (delegate(string fieldName) {
                            object val;
                            if (!doit)
                            {
                                return(CellValue);
                            }
                            else if ((entityInstance != null) && (view != null))
                            {
                                try{
                                    foreach (Field f in view.Fields)
                                    {
                                        if (f.Name == fieldName)
                                        {
                                            return(((val = entityInstance [f]) == null) ? string.Empty : val.ToString());
                                        }
                                    }
                                } catch {
                                }
                            }
                            return(string.Empty);
                        }).ToArray()) };
                    OnRowReady(rowArgs);
                }
            }
        }
        /// <summary>Raised when the cell is ready.</summary>
        public void CellReady(object sender, CellReadyEventArgs cellReadyArgs)
        {
            observerRoleLearnerLogin = "";

            // On CellReady, validate and set the learner's login id
            InitializeLearnerKey();
            if (cellReadyArgs.Cell != null)
            {
                observerRoleLearnerLogin = cellReadyArgs.Cell.ToString();
            }
        }
Example #5
0
 public void CellReady(object sender, CellReadyEventArgs cellReadyArgs)
 {
     //Set the label text to the value of the "Cell" that was passed by the Provider
     if (cellReadyArgs.Cell != null)
     {
         userName = cellReadyArgs.Cell.ToString();
         if (userName.Length > 0)
         {
             ViewState["CurrentUser"] = userName;
         }
         else
         {
             if (ViewState["CurrentUser"] != null)
             {
                 userName = ViewState["CurrentUser"].ToString();
             }
         }
         this.ChildControlsCreated = false;
     }
 }
Example #6
0
        public override void PartCommunicationMain()
        {
            //If the connection wasn't actually formed then don't want to send Ready event
            if (_cellConnectedCount > 0)
            {
                //If there is a listener, send CellReady event
                if (CellReady != null)
                {
                    //Need to create the args for the CellProviderInit event
                    CellReadyEventArgs cellReadyArgs = new CellReadyEventArgs();

                    //If user clicked button then send the value
                    if (_cellClicked)
                    {
                        //Set the Cell to the value of the TextBox text
                        //This is the value that will be sent to the Consumer
                        if (this.ViewState["_passedUserName"] != null)
                        {
                            cellReadyArgs.Cell = this.ViewState["_passedUserName"].ToString();
                        }
                        else
                        {
                            cellReadyArgs.Cell = "";
                        }
                    }
                    else
                    {
                        //The user didn't actually click the button
                        //so just send an empty string to the Consumer
                        cellReadyArgs.Cell = "";
                    }


                    //Fire the CellReady event.
                    //The Consumer will then receive the Cell value
                    CellReady(this, cellReadyArgs);
                }
            }
        }
 public void CellReady(object sender, CellReadyEventArgs cellReadyArgs)
 {
 }
Example #8
0
 void ICellConsumer.CellReady(object sender, CellReadyEventArgs cellReadyArgs)
 {
     cellLibFolder = cellReadyArgs.Cell + string.Empty;
 }
Example #9
0
        public void CellReady(object sender, CellReadyEventArgs cellReadyArgs)
        {
            Converter <string, object> converter = null;
            RowReadyEventArgs          e         = new RowReadyEventArgs();

            Microsoft.Office.Server.ApplicationRegistry.MetadataModel.View view = null;
            this.cellValue = cellReadyArgs.Cell;
            bool doit = base.LicEd(4) || !this.Exed;

            if (this._cellConnected && this._rowConnected)
            {
                if (this.rowTable != null)
                {
                    this.rowTable.Dispose();
                }
                this.rowTable = new DataTable();
                if (this.RowArgs.FieldList.Length > 0)
                {
                    foreach (string str in this.RowArgs.FieldList)
                    {
                        this.rowTable.Columns.Add(str);
                    }
                    if (doit)
                    {
                        try
                        {
                            view = GetView(this.entity);
                            if (this.entityInstance == null)
                            {
                                this.entityInstance = this.GetEntityInstance(view);
                            }
                        }
                        catch
                        {
                        }
                    }
                    DataRow[] rowArray = new DataRow[1];
                    if (converter == null)
                    {
                        converter = delegate(string fieldName)
                        {
                            if (!doit)
                            {
                                return(this.CellValue);
                            }
                            if ((this.entityInstance != null) && (view != null))
                            {
                                try
                                {
                                    foreach (Field field in view.Fields)
                                    {
                                        if (field.Name == fieldName)
                                        {
                                            object obj2;
                                            return(((obj2 = this.entityInstance[field]) == null) ? string.Empty : obj2.ToString());
                                        }
                                    }
                                }
                                catch
                                {
                                }
                            }
                            return(string.Empty);
                        };
                    }
                    rowArray[0] = this.rowTable.Rows.Add(new List <string>(this.RowArgs.FieldList).ConvertAll <object>(converter).ToArray());
                    e.Rows      = rowArray;
                    this.OnRowReady(e);
                }
            }
        }
 public override void PartCommunicationMain()
 {
     if (this.consumersWaiting == 0)
     {
         if (this.CellReady != null)
         {
             CellReadyEventArgs e = new CellReadyEventArgs {
                 Cell = this.Provide(ProviderPreference.SingleValue)
             };
             this.CellReady(this, e);
         }
         if (this.filterClear && (this.ClearFilter != null))
         {
             this.ClearFilter(this, EventArgs.Empty);
         }
         else if (this.filterNone && (this.NoFilter != null))
         {
             this.NoFilter(this, EventArgs.Empty);
         }
         else if (this.SetFilter != null)
         {
             SetFilterEventArgs args2 = new SetFilterEventArgs {
                 FilterExpression = this.Provide(ProviderPreference.FilterString) as string
             };
             this.SetFilter(this, args2);
         }
         if (this.listPartial && (this.PartialListReady != null))
         {
             PartialListReadyEventArgs args3 = new PartialListReadyEventArgs {
                 List = this.Provide(ProviderPreference.Table) as DataTable
             };
             this.PartialListReady(this, args3);
         }
         else if (this.ListReady != null)
         {
             ListReadyEventArgs args4 = new ListReadyEventArgs {
                 List = this.Provide(ProviderPreference.Table) as DataTable
             };
             this.ListReady(this, args4);
         }
         if (this.paramInNone && (this.NoParametersIn != null))
         {
             this.NoParametersIn(this, EventArgs.Empty);
         }
         else if (this.ParametersInReady != null)
         {
             ParametersInReadyEventArgs args5 = new ParametersInReadyEventArgs {
                 ParameterValues = this.Provide(ProviderPreference.Values) as string[]
             };
             this.ParametersInReady(this, args5);
         }
         if (this.paramOutNone && (this.NoParametersOut != null))
         {
             this.NoParametersOut(this, EventArgs.Empty);
         }
         else if (this.ParametersOutReady != null)
         {
             ParametersOutReadyEventArgs args6 = new ParametersOutReadyEventArgs {
                 ParameterValues = this.Provide(ProviderPreference.Values) as string[]
             };
             this.ParametersOutReady(this, args6);
         }
         if (this.RowReady != null)
         {
             RowReadyEventArgs args7 = new RowReadyEventArgs {
                 SelectionStatus = this.rowSel,
                 Rows            = this.Provide(ProviderPreference.Rows) as DataRow[]
             };
             this.RowReady(this, args7);
         }
     }
 }