示例#1
0
 public void Invoke(object data)
 {
     for (int i = this.m_Receivers.Count - 1; i >= 0; i--)
     {
         ReceiverInformation receiver = this.m_Receivers[i];
         if (receiver.Receiver == null)
         {
             this.RemoveReceiver(receiver);
         }
         else if (receiver.IsListenOnce)
         {
             if (data == null)
             {
                 receiver.Receiver.SendMessage(receiver.MethodName, SendMessageOptions.DontRequireReceiver);
             }
             else
             {
                 receiver.Receiver.SendMessage(receiver.MethodName, data, SendMessageOptions.DontRequireReceiver);
             }
             this.RemoveReceiver(receiver);
         }
         else
         {
             if (data == null)
             {
                 receiver.Receiver.SendMessage(receiver.MethodName, SendMessageOptions.DontRequireReceiver);
             }
             else
             {
                 receiver.Receiver.SendMessage(receiver.MethodName, data, SendMessageOptions.DontRequireReceiver);
             }
         }
     }
 }
 public void EventReceiver(EventData data)
 {
     if (this.m_ReceiverDict.ContainsKey(data.Code))
     {
         List <ReceiverInformation> receivers = this.m_ReceiverDict[data.Code];
         for (int i = receivers.Count - 1; i >= 0; i--)
         {
             ReceiverInformation receiver = receivers[i];
             if (receiver.Receiver == null)
             {
                 receivers.Remove(receiver);
             }
             else
             {
                 if (data.Parameters == null || data.Parameters.Count == 0)
                 {
                     receiver.Receiver.SendMessage(receiver.MethodName, new Hashtable(), SendMessageOptions.DontRequireReceiver);
                 }
                 else
                 {
                     receiver.Receiver.SendMessage(receiver.MethodName,
                                                   (Hashtable)data.Parameters[CommunicationConsts.EXTERNAL_SURFACE_KEY], SendMessageOptions.DontRequireReceiver);
                 }
                 if (receiver.IsListenOnce)
                 {
                     receivers.Remove(receiver);
                 }
             }
         }
     }
 }
    public void RemoveInvalidReceiver()
    {
        List <byte> invalidReceiverList = new List <byte>();

        foreach (byte eventCode in this.m_ReceiverDict.Keys)
        {
            List <ReceiverInformation> receivers = this.m_ReceiverDict[eventCode];
            for (int i = receivers.Count - 1; i >= 0; i--)
            {
                ReceiverInformation receiver = receivers[i];
                if (receiver.Receiver == null)
                {
                    receivers.Remove(receiver);
                }
            }

            if (receivers.Count == 0)
            {
                invalidReceiverList.Add(eventCode);
            }
        }

        foreach (byte invalidReceiver in invalidReceiverList)
        {
            this.m_ReceiverDict.Remove(invalidReceiver);
        }
    }
示例#4
0
    public void RegisterStateChangeListener(Component comp, string methodName)
    {
        ReceiverInformation receiverInfo = new ReceiverInformation()
        {
            Receiver = comp, MethodName = methodName, IsListenOnce = false
        };

        this.m_ContextChangeListeners.AddReceiver(receiverInfo);
    }
示例#5
0
    public void RegisterRequestFailedListener(Component comp, string methodName)
    {
        ReceiverInformation receiverInfo = new ReceiverInformation()
        {
            Receiver = comp, MethodName = methodName, IsListenOnce = false
        };

        this.m_RequestFailedListeners.AddReceiver(receiverInfo);
    }
示例#6
0
    public void RegisterLogoutFailReceiver(Component receiver, string methodName)
    {
        ReceiverInformation info = new ReceiverInformation()
        {
            Receiver = receiver, MethodName = methodName, IsListenOnce = false
        };

        this.m_LogoutFailListener.AddReceiver(info);
    }
示例#7
0
    public void RegisterMountSuccessReceiver(Component receiver, string methodName)
    {
        ReceiverInformation info = new ReceiverInformation()
        {
            Receiver = receiver, MethodName = methodName, IsListenOnce = false
        };

        this.m_MountSuccessListener.AddReceiver(info);
    }
示例#8
0
    public void RegisterPurchaseSuccessedListener(Component comp, string methodName)
    {
        ReceiverInformation receiverInfo = new ReceiverInformation()
        {
            Receiver = comp, MethodName = methodName, IsListenOnce = false
        };

        this.m_PurchaseSuccessedListeners.AddReceiver(receiverInfo);
    }
示例#9
0
 public void RemoveInvalidReceiver()
 {
     for (int i = this.m_Receivers.Count - 1; i >= 0; i--)
     {
         ReceiverInformation receiver = this.m_Receivers[i];
         if (receiver.Receiver == null)
         {
             this.RemoveReceiver(receiver);
         }
     }
 }
示例#10
0
 internal TextBox GetToggleParent(int uniqueName)
 {
     if (ShowHideReceiverInfo != null)
     {
         ReceiverInformation receiverInformation = ShowHideReceiverInfo[uniqueName];
         if (receiverInformation != null)
         {
             ReportItem reportItem = FindReportItemInBody(receiverInformation.SenderUniqueName);
             Global.Tracer.Assert(reportItem != null);
             Global.Tracer.Assert(reportItem is TextBox);
             return((TextBox)reportItem);
         }
     }
     return(null);
 }
示例#11
0
    public void RegisterServerEventListener(byte serverEventCode, Component receiver, string methodName, bool isListenOnce)
    {
        ReceiverInformation info = new ReceiverInformation()
        {
            Receiver = receiver, MethodName = methodName, IsListenOnce = isListenOnce
        };

        if (!this.m_ReceiverDict.ContainsKey(serverEventCode))
        {
            this.m_ReceiverDict.Add(serverEventCode, new List <ReceiverInformation>());
        }
        if (!this.m_ReceiverDict[serverEventCode].Contains(info))
        {
            this.m_ReceiverDict[serverEventCode].Add(info);
        }
    }
示例#12
0
    private void CommunicateWithServer(Component receiver, string methodName, bool isListenOnce, Hashtable parameter,
                                       byte clientCommandCode, byte serverEventCode)
    {
        this.m_Manager.Communicate(clientCommandCode, parameter);
        ReceiverInformation info = new ReceiverInformation()
        {
            Receiver = receiver, MethodName = methodName, IsListenOnce = isListenOnce
        };

        if (!this.m_ReceiverDict.ContainsKey(serverEventCode))
        {
            this.m_ReceiverDict.Add(serverEventCode, new List <ReceiverInformation>());
        }
        if (!this.m_ReceiverDict[serverEventCode].Contains(info))
        {
            this.m_ReceiverDict[serverEventCode].Add(info);
        }
    }
        private static DeclarationList CreateCurrentDeclarations()
        {
            DeclarationList declarationList = new DeclarationList();
            int             num             = 1;

            declarationList[num++] = IDOwner.GetDeclaration();
            declarationList[num++] = ReportItem.GetDeclaration();
            num++;
            declarationList[num++] = Report.GetDeclaration();
            declarationList[num++] = PageSection.GetDeclaration();
            declarationList[num++] = Line.GetDeclaration();
            declarationList[num++] = Rectangle.GetDeclaration();
            declarationList[num++] = Image.GetDeclaration();
            num++;
            declarationList[num++] = CheckBox.GetDeclaration();
            declarationList[num++] = TextBox.GetDeclaration();
            declarationList[num++] = SubReport.GetDeclaration();
            declarationList[num++] = ActiveXControl.GetDeclaration();
            declarationList[num++] = DataRegion.GetDeclaration();
            num++;
            declarationList[num++] = ReportHierarchyNode.GetDeclaration();
            declarationList[num++] = Grouping.GetDeclaration();
            declarationList[num++] = Sorting.GetDeclaration();
            declarationList[num++] = List.GetDeclaration();
            declarationList[num++] = Pivot.GetDeclaration();
            declarationList[num++] = Matrix.GetDeclaration();
            declarationList[num++] = PivotHeading.GetDeclaration();
            declarationList[num++] = MatrixHeading.GetDeclaration();
            declarationList[num++] = MatrixColumn.GetDeclaration();
            num++;
            declarationList[num++] = MatrixRow.GetDeclaration();
            num++;
            declarationList[num++] = Subtotal.GetDeclaration();
            declarationList[num++] = Table.GetDeclaration();
            declarationList[num++] = TableColumn.GetDeclaration();
            num++;
            declarationList[num++] = TableGroup.GetDeclaration();
            declarationList[num++] = TableRow.GetDeclaration();
            num++;
            declarationList[num++] = OWCChart.GetDeclaration();
            declarationList[num++] = ChartColumn.GetDeclaration();
            num++;
            declarationList[num++] = ReportItemCollection.GetDeclaration();
            declarationList[num++] = ReportItemIndexer.GetDeclaration();
            num++;
            declarationList[num++] = Style.GetDeclaration();
            num++;
            declarationList[num++] = AttributeInfo.GetDeclaration();
            declarationList[num++] = Visibility.GetDeclaration();
            declarationList[num++] = ExpressionInfo.GetDeclaration();
            num++;
            declarationList[num++] = DataAggregateInfo.GetDeclaration();
            num++;
            declarationList[num++] = RunningValueInfo.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = Filter.GetDeclaration();
            num++;
            declarationList[num++] = DataSource.GetDeclaration();
            num++;
            declarationList[num++] = DataSet.GetDeclaration();
            num++;
            declarationList[num++] = ReportQuery.GetDeclaration();
            declarationList[num++] = Field.GetDeclaration();
            num++;
            declarationList[num++] = ParameterValue.GetDeclaration();
            num++;
            num++;
            num++;
            num++;
            declarationList[num++] = ReportSnapshot.GetDeclaration();
            declarationList[num++] = SenderInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = ReceiverInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = DocumentMapNode.GetDeclaration();
            declarationList[num++] = InfoBase.GetDeclaration();
            declarationList[num++] = OffsetInfo.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = ReportItemInstanceInfo.GetDeclaration();
            declarationList[num++] = ReportInstanceInfo.GetDeclaration();
            declarationList[num++] = ReportItemColInstanceInfo.GetDeclaration();
            declarationList[num++] = LineInstanceInfo.GetDeclaration();
            declarationList[num++] = TextBoxInstanceInfo.GetDeclaration();
            declarationList[num++] = RectangleInstanceInfo.GetDeclaration();
            declarationList[num++] = CheckBoxInstanceInfo.GetDeclaration();
            declarationList[num++] = ImageInstanceInfo.GetDeclaration();
            declarationList[num++] = SubReportInstanceInfo.GetDeclaration();
            declarationList[num++] = ActiveXControlInstanceInfo.GetDeclaration();
            declarationList[num++] = ListInstanceInfo.GetDeclaration();
            declarationList[num++] = ListContentInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixHeadingInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixCellInstanceInfo.GetDeclaration();
            declarationList[num++] = TableInstanceInfo.GetDeclaration();
            declarationList[num++] = TableGroupInstanceInfo.GetDeclaration();
            declarationList[num++] = TableRowInstanceInfo.GetDeclaration();
            declarationList[num++] = OWCChartInstanceInfo.GetDeclaration();
            declarationList[num++] = ChartInstanceInfo.GetDeclaration();
            declarationList[num++] = NonComputedUniqueNames.GetDeclaration();
            declarationList[num++] = InstanceInfoOwner.GetDeclaration();
            declarationList[num++] = ReportItemInstance.GetDeclaration();
            num++;
            declarationList[num++] = ReportInstance.GetDeclaration();
            declarationList[num++] = ReportItemColInstance.GetDeclaration();
            declarationList[num++] = LineInstance.GetDeclaration();
            declarationList[num++] = TextBoxInstance.GetDeclaration();
            declarationList[num++] = RectangleInstance.GetDeclaration();
            declarationList[num++] = CheckBoxInstance.GetDeclaration();
            declarationList[num++] = ImageInstance.GetDeclaration();
            declarationList[num++] = SubReportInstance.GetDeclaration();
            declarationList[num++] = ActiveXControlInstance.GetDeclaration();
            declarationList[num++] = ListInstance.GetDeclaration();
            declarationList[num++] = ListContentInstance.GetDeclaration();
            num++;
            declarationList[num++] = MatrixInstance.GetDeclaration();
            declarationList[num++] = MatrixHeadingInstance.GetDeclaration();
            num++;
            declarationList[num++] = MatrixCellInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = TableInstance.GetDeclaration();
            declarationList[num++] = TableRowInstance.GetDeclaration();
            declarationList[num++] = TableColumnInstance.GetDeclaration();
            declarationList[num++] = TableGroupInstance.GetDeclaration();
            num++;
            declarationList[num++] = OWCChartInstance.GetDeclaration();
            declarationList[num++] = ParameterInfo.GetDeclaration();
            num++;
            num++;
            num++;
            declarationList[num++] = InstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = RecordSetInfo.GetDeclaration();
            declarationList[num++] = RecordRow.GetDeclaration();
            declarationList[num++] = RecordField.GetDeclaration();
            declarationList[num++] = ValidValue.GetDeclaration();
            num++;
            declarationList[num++] = ParameterDataSource.GetDeclaration();
            declarationList[num++] = ParameterDef.GetDeclaration();
            num++;
            declarationList[num++] = ParameterBase.GetDeclaration();
            num++;
            declarationList[num++] = ProcessingMessage.GetDeclaration();
            declarationList[num++] = MatrixSubtotalHeadingInstanceInfo.GetDeclaration();
            declarationList[num++] = MatrixSubtotalCellInstance.GetDeclaration();
            declarationList[num++] = CodeClass.GetDeclaration();
            num++;
            declarationList[num++] = TableDetail.GetDeclaration();
            declarationList[num++] = TableDetailInstance.GetDeclaration();
            num++;
            declarationList[num++] = TableDetailInstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = Action.GetDeclaration();
            declarationList[num++] = ActionInstance.GetDeclaration();
            declarationList[num++] = Chart.GetDeclaration();
            declarationList[num++] = ChartHeading.GetDeclaration();
            declarationList[num++] = ChartDataPoint.GetDeclaration();
            num++;
            declarationList[num++] = MultiChart.GetDeclaration();
            declarationList[num++] = MultiChartInstance.GetDeclaration();
            num++;
            declarationList[num++] = Axis.GetDeclaration();
            declarationList[num++] = AxisInstance.GetDeclaration();
            declarationList[num++] = ChartTitle.GetDeclaration();
            declarationList[num++] = ChartTitleInstance.GetDeclaration();
            declarationList[num++] = ThreeDProperties.GetDeclaration();
            declarationList[num++] = PlotArea.GetDeclaration();
            declarationList[num++] = Legend.GetDeclaration();
            declarationList[num++] = GridLines.GetDeclaration();
            declarationList[num++] = ChartDataLabel.GetDeclaration();
            declarationList[num++] = ChartInstance.GetDeclaration();
            declarationList[num++] = ChartHeadingInstance.GetDeclaration();
            declarationList[num++] = ChartHeadingInstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = ChartDataPointInstance.GetDeclaration();
            declarationList[num++] = ChartDataPointInstanceInfo.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = RenderingPagesRanges.GetDeclaration();
            num++;
            declarationList[num++] = IntermediateFormatVersion.GetDeclaration();
            declarationList[num++] = ImageInfo.GetDeclaration();
            declarationList[num++] = ActionItem.GetDeclaration();
            declarationList[num++] = ActionItemInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = DataValue.GetDeclaration();
            declarationList[num++] = DataValueInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = Tablix.GetDeclaration();
            declarationList[num++] = TablixHeading.GetDeclaration();
            declarationList[num++] = CustomReportItem.GetDeclaration();
            declarationList[num++] = CustomReportItemInstance.GetDeclaration();
            declarationList[num++] = CustomReportItemHeading.GetDeclaration();
            declarationList[num++] = CustomReportItemHeadingInstance.GetDeclaration();
            num++;
            num++;
            num++;
            num++;
            declarationList[num++] = CustomReportItemCellInstance.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = DataValueCRIList.GetDeclaration();
            declarationList[num++] = BookmarkInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = DrillthroughInformation.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            num++;
            declarationList[num++] = CustomReportItemInstanceInfo.GetDeclaration();
            declarationList[num++] = ImageMapAreaInstanceList.GetDeclaration();
            declarationList[num++] = ImageMapAreaInstance.GetDeclaration();
            num++;
            declarationList[num++] = InstanceInfo.GetDeclaration();
            declarationList[num++] = SortFilterEventInfo.GetDeclaration();
            declarationList[num++] = EndUserSort.GetDeclaration();
            num++;
            num++;
            declarationList[num++] = RecordSetPropertyNames.GetDeclaration();
            num++;
            num++;
            num++;
            declarationList[num++] = PageSectionInstance.GetDeclaration();
            num++;
            declarationList[num++] = PageSectionInstanceInfo.GetDeclaration();
            declarationList[num++] = SimpleTextBoxInstanceInfo.GetDeclaration();
            declarationList[num++] = ScopeLookupTable.GetDeclaration();
            num++;
            declarationList[num++] = ReportDrillthroughInfo.GetDeclaration();
            declarationList[num++] = InstanceInfo.GetDeclaration();
            Global.Tracer.Assert(declarationList.Count == num, "(current.Count == index)");
            return(declarationList);
        }
示例#14
0
        public ActionResult PaymentWithPaypal(ReceiverInformation receiverInformation)
        {
            if (TryValidateModel(receiverInformation))
            {
                _receiverInformation = new ReceiverInformation
                {
                    Address      = receiverInformation.Address,
                    FullName     = receiverInformation.FullName,
                    Street       = receiverInformation.Street,
                    MobileNumber = receiverInformation.MobileNumber
                };
            }

            //getting the apiContext as earlier
            APIContext apiContext = Configuration.GetAPIContext();

            try
            {
                string payerId = Request.Params["PayerID"];

                if (string.IsNullOrEmpty(payerId))
                {
                    //this section will be executed first because PayerID doesn't exist
                    //it is returned by the create function call of the payment class

                    // Creating a payment
                    // baseURL is the url on which paypal sendsback the data.
                    // So we have provided URL of this controller only
                    string baseURI = Request.Url.Scheme + "://" + Request.Url.Authority +
                                     "/Paypal/PaymentWithPayPal?";

                    //guid we are generating for storing the paymentID received in session
                    //after calling the create function and it is used in the payment execution

                    var guid = Convert.ToString((new Random()).Next(100000));

                    //CreatePayment function gives us the payment approval url
                    //on which payer is redirected for paypal account payment

                    var createdPayment = this.CreatePayment(apiContext, baseURI + "guid=" + guid);

                    //get links returned from paypal in response to Create function call

                    var links = createdPayment.links.GetEnumerator();

                    string paypalRedirectUrl = null;

                    while (links.MoveNext())
                    {
                        Links lnk = links.Current;

                        if (lnk.rel.ToLower().Trim().Equals("approval_url"))
                        {
                            //saving the payapalredirect URL to which user will be redirected for payment
                            paypalRedirectUrl = lnk.href;
                        }
                    }

                    // saving the paymentID in the key guid
                    Session.Add(guid, createdPayment.id);

                    return(Redirect(paypalRedirectUrl));
                }
                else
                {
                    // This section is executed when we have received all the payments parameters

                    // from the previous call to the function Create

                    // Executing a payment

                    var guid = Request.Params["guid"];

                    var executedPayment = ExecutePayment(apiContext, payerId, Session[guid] as string);

                    if (executedPayment.state.ToLower() != "approved")
                    {
                        return(View("FailureView"));
                    }
                }
            }
            catch (Exception ex)
            {
                return(View("FailureView"));
            }

            InsertOrder();
            return(RedirectToAction("List", "Product", new { categoryId = 1 }));
        }
示例#15
0
 public void RemoveReceiver(ReceiverInformation receiver)
 {
     this.m_Receivers.Remove(receiver);
 }
示例#16
0
        private bool RecursiveIsItemHidden(int uniqueName, bool potentialSender)
        {
            Global.Tracer.Assert(m_processedItems != null);
            if (m_processedItems.ContainsKey(uniqueName))
            {
                return(false);
            }
            m_processedItems.Add(uniqueName, null);
            if (m_cachedHiddenInfo == null)
            {
                m_cachedHiddenInfo = new Hashtable();
            }
            else
            {
                object obj = m_cachedHiddenInfo[uniqueName];
                if (obj != null)
                {
                    return((bool)obj);
                }
            }
            ReceiverInformation receiverInformation = ShowHideReceiverInfo[uniqueName];

            if (receiverInformation != null)
            {
                if (IsHidden(uniqueName, receiverInformation.StartHidden))
                {
                    m_cachedHiddenInfo[uniqueName] = true;
                    return(true);
                }
                if (RecursiveIsItemHidden(receiverInformation.SenderUniqueName, potentialSender: true))
                {
                    m_cachedHiddenInfo[uniqueName] = true;
                    return(true);
                }
            }
            if (potentialSender)
            {
                SenderInformation senderInformation = ShowHideSenderInfo[uniqueName];
                if (senderInformation != null)
                {
                    if (IsHidden(uniqueName, senderInformation.StartHidden))
                    {
                        m_cachedHiddenInfo[uniqueName] = true;
                        return(true);
                    }
                    if (senderInformation.ContainerUniqueNames != null)
                    {
                        for (int num = senderInformation.ContainerUniqueNames.Length - 1; num >= 0; num--)
                        {
                            if (RecursiveIsItemHidden(senderInformation.ContainerUniqueNames[num], potentialSender: false))
                            {
                                m_cachedHiddenInfo[uniqueName] = true;
                                return(true);
                            }
                        }
                    }
                }
            }
            m_cachedHiddenInfo[uniqueName] = false;
            return(false);
        }
示例#17
0
 public void AddReceiver(ReceiverInformation receiver)
 {
     this.m_Receivers.Add(receiver);
 }