Exemplo n.º 1
0
        /// <summary>
        /// Метод подписи XML
        /// </summary>
        /// <param name="xml"></param>
        /// <param name="mr"></param>
        /// <param name="thumbprint"></param>
        /// <returns></returns>
        internal string SignSoap(string xml, Mr mr, string thumbprint)
        {
            log.LogDebug($"Пытаемся получить объект для выполнения подписи согласно версии МР: {mr}.");
            var signer = SignerSoapHelper.CreateSigner(mr, loggerFactory);

            var doc = new XmlDocument();

            try
            {
                log.LogDebug("Пытаемся распарсить входящий XML.");
                doc.LoadXml(xml);
            }
            catch (Exception ex)
            {
                log.LogError($"Ошибка при парсинге XML содержимого в запросе. {ex.Message}.");
                throw new CryptographicException($"Ошибка при парсинге XML содержимого в запросе. {ex.Message}.");
            }

            log.LogDebug($"Пытаемся найти сертификат с указанным thumbprint: {thumbprint}.");
            var certHandle = FindCertificate(thumbprint);

            var signedXml = signer.SignMessageAsOv(doc, certHandle);

            return(signedXml.OuterXml);
        }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     audioSource   = gameObject.GetComponent <AudioSource>();
     ataqueScript  = GameObject.Find("ataqueScript").GetComponent <Ataques>();
     MR            = GameObject.Find("MR").GetComponent <Mr>();
     spawnerScript = GameObject.Find("Spawner").GetComponent <Spawner>();
 }
Exemplo n.º 3
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = this;
     Mr.AddNew(new Movie("Star Trek: Beyond", "Sci-Fi", "16:9", true, "Justin Lin", new DateTime(2016, 07, 22), 1));
     Mr.AddNew(new Movie("Star Wars: The Last Jedi", "Epic Space Opera", "3:4", true, "Ryan Johnson", new DateTime(2017, 12, 15), 1));
 }
Exemplo n.º 4
0
        public void IndividualDetails()
        {
            /*Individual details*/
            SetMethods.ImplicitlyWait(10);
            PersalNum.EnterText("061375468");
            TitleArrow.Clicks();
            Thread.Sleep(500);
            Mr.Clicks();
            Surname.EnterText("Tailor");
            Initial.EnterText("D");
            IDNum.EnterText("8710039822081");
            OutSide.Clicks();
            Thread.Sleep(1500);
            Age.EnterText("32");
            Thread.Sleep(1000);
            GenderArrow.Clicks();
            Thread.Sleep(500);
            Male.Clicks();

            /*PersalNum.SendKeys("061375468");
             * TitleArrow.Click();
             * Thread.Sleep(500);
             * Mr.Click();
             * Surname.SendKeys("Tailor");
             * Initial.SendKeys("JH");
             * IDNum.SendKeys("8710039822081");
             * OutSide.Click();
             * Age.SendKeys("32");
             * GenderArrow.Click();
             * Thread.Sleep(500);
             * Male.Click();*/
        }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     flechas      = GameObject.Find("flechas");
     puerta       = GameObject.Find("puerta");
     audioSource  = gameObject.GetComponent <AudioSource>();
     vidaScroll   = GameObject.Find("vidafront").GetComponent <Image>();
     ataqueScript = GameObject.Find("ataqueScript").GetComponent <Ataques>();
     MR           = GameObject.Find("MR").GetComponent <Mr>();
 }
Exemplo n.º 6
0
        /// <summary>
        /// Метод выполнения тестов подписи Soap сообщений СМЭВ
        /// </summary>
        /// <param name="csp"></param>
        /// <param name="directory"></param>
        /// <param name="mr"></param>
        /// <param name="thumbprint"></param>
        private void SignSoapExecuteTest(CspType csp, string directory, Mr mr, string thumbprint)
        {
            SignServiceProvider provider = new SignServiceProvider(csp, new LoggerFactory());
            var files = Utils.GetFilesList(directory);

            foreach (var file in files)
            {
                var data      = Utils.GetTextFromFile(file);
                var signedXml = provider.SignSoap(data, mr, thumbprint);

                Assert.IsTrue(!string.IsNullOrEmpty(signedXml));
            }
        }
        public Task ShouldProjectAMatchingStringToAnEnum()
        {
            return(RunTest(async context =>
            {
                await context.StringItems.Add(new PublicString {
                    Value = Mr.ToString()
                });
                await context.SaveChanges();

                var enumItem = context.StringItems.Project().To <PublicTitleDto>().ShouldHaveSingleItem();

                enumItem.Value.ShouldBe(Mr);
            }));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Метод подписи XML
        /// </summary>
        /// <param name="xml"></param>
        /// <param name="mr"></param>
        /// <param name="thumbprint"></param>
        /// <returns></returns>
        public string SignSoap(string xml, Mr mr, string thumbprint)
        {
            string signedXml = string.Empty;

            if (SignServiceUtils.IsUnix)
            {
                log.LogDebug($"Попытка выполнить метод подписания XML под Unix платформой.");
                var unixService = new SignServiceUnix(loggerFactory);
                signedXml = unixService.SignSoap(xml, mr, thumbprint);
            }
            else
            {
                log.LogDebug($"Попытка выполнить метод подписания XML под Windows платформой.");
                var winService = new SignServiceWin(loggerFactory);
                signedXml = winService.SignSoap(xml, mr, thumbprint);
            }

            return(signedXml);
        }
Exemplo n.º 9
0
 internal static ISignerSoap CreateSigner(Mr mr, ILoggerFactory loggerFactory)
 {
     if (mr == Mr.MR244)
     {
         return(new SignerSoap2XX(Mr.MR244, loggerFactory));
     }
     else if (mr == Mr.MR255)
     {
         return(new SignerSoap2XX(Mr.MR255, loggerFactory));
     }
     else if (mr == Mr.MR300)
     {
         return(new SignerSoap3XX(loggerFactory));
     }
     else
     {
         throw new ArgumentException($"Неподдерживаемая версия МР {mr}.");
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Устанавливает значение для тэга с идентификатором, влияет на установку <ds:Reference URI=></Reference>
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="elemName"></param>
        /// <param name="namespaceUri"></param>
        /// <param name="signWithId"></param>
        /// <param name="specId"></param>
        /// <param name="namespaceIdAttr"></param>
        /// <returns></returns>
        internal static string SetElemId(XmlDocument doc, string elemName, string namespaceUri, bool signWithId,
                                         Mr mr,
                                         ref int idCounter,
                                         string specId          = "",
                                         string namespaceIdAttr = ""
                                         )
        {
            string newId   = string.Empty;
            string existId = GetElemId(doc, elemName, namespaceUri, signWithId);

            if (string.IsNullOrEmpty(existId) && signWithId)
            {
                string     lowerName  = elemName.ToLower();
                XmlElement targetElem = (XmlElement)doc.GetElementsByTagName(elemName, namespaceUri)[0] ??
                                        (XmlElement)doc.GetElementsByTagName(lowerName, namespaceUri)[0];

                if (string.IsNullOrEmpty(specId))
                {
                    newId = idCounter.ToString(CultureInfo.InvariantCulture);
                    idCounter++;
                }
                else
                {
                    newId = specId;
                }

                if (mr == Mr.MR300)
                {
                    XmlAttribute idAttr = doc.CreateAttribute("Id");
                    idAttr.Value = newId;
                    targetElem.Attributes.Append((XmlAttribute)doc.ImportNode(idAttr, true));
                }
                else
                {
                    XmlAttribute idAttr = doc.CreateAttribute("u", "Id", namespaceIdAttr);
                    idAttr.Value = newId;
                    targetElem.Attributes.Append((XmlAttribute)doc.ImportNode(idAttr, true));
                }
            }

            return(newId);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Конструктор класса
        /// </summary>
        /// <param name="mr"></param>
        /// <param name="loggerFactory"></param>
        internal SignerSoap2XX(Mr mr, ILoggerFactory loggerFactory)
        {
            this.mrVersion = mr;

            if (mr == Mr.MR244)
            {
                mrNamespace       = NamespaceUri.SmevMR244;
                securityNamespace = NamespaceUri.OasisWSSecurityUtility;
            }
            else if (mr == Mr.MR255)
            {
                mrNamespace       = NamespaceUri.SmevMR255;
                securityNamespace = NamespaceUri.OasisWSSecurityUtility;
            }
            else
            {
                throw new ArgumentException($"Неподдерживаемая версия МР: {mr}.");
            }

            this.log = loggerFactory.CreateLogger <SignerSoap2XX>();
        }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        GameScreen = GameObject.Find("Game");
        slot       = GameObject.Find("slot");
        //Instantiate(bombaPrefab, slot.transform.position,slot.transform.rotation,slot.transform);
        boostCDScroll  = GameObject.Find("boostCD").GetComponent <Image>();
        attackCDScroll = GameObject.Find("ataqueCD").GetComponent <Image>();
        bombaCDScroll  = GameObject.Find("bombaCD").GetComponent <Image>();
        trampaCDScroll = GameObject.Find("trampaCD").GetComponent <Image>();

        audioSource = gameObject.GetComponent <AudioSource>();

        MR          = GameObject.Find("MR").GetComponent <Mr>();
        bombaScript = GameObject.Find("Spawner").GetComponent <Bomba>();
        audioScript = GameObject.Find("Audios").GetComponent <Audios>();

        ataqueNormal = GameObject.Find("ataquenormal");
        ataqueNormal.SetActive(false);
        ataqueDoble = GameObject.Find("ataquedoble");
        ataqueDoble.SetActive(false);
        ataquePolvora = GameObject.Find("ataquepolvora");
        ataquePolvora.SetActive(false);
    }
Exemplo n.º 13
0
        public Vector Solve(Slae <ProfileMatrix> SLAE, Vector Initial, int maxiter, double eps)
        {
            int    iterNum;
            double iner_r, iner_mr, alpha, betta, residual;
            Vector Az, Mr;

            Vector r = new Vector(SLAE.RightPart.Differ(SLAE.Matrix.Multiply(Initial)));

            Vector result = new Vector(Initial);

            residual = r.Norm() / SLAE.RightPart.Norm();
            if (Data.preconditioner == 0)//нет предобуславливания
            {
                Vector z = new Vector(r);
                for (iterNum = 0; iterNum < maxiter && residual >= eps; iterNum++)
                {
                    iner_r = r.Scalar(r);
                    Az     = SLAE.Matrix.Multiply(z);
                    alpha  = r.Scalar(r) / Az.Scalar(z);
                    result = result.Sum(z.Mult(alpha));
                    r      = r.Differ(Az.Mult(alpha));
                    betta  = r.Scalar(r) / iner_r;
                    z      = r.Sum(z.Mult(betta));

                    residual = r.Norm() / SLAE.RightPart.Norm();
                    if (!autotest)
                    {
                        if (!InputOutput.OutputIterationToForm(iterNum, residual, maxiter, false))
                        {
                            MessageBox.Show("Ошибка при выводе данных на форму.", "Опаньки...", MessageBoxButtons.OK);
                        }
                    }
                }
                if (!autotest)
                {
                    if (!InputOutput.OutputIterationToForm(iterNum - 1, residual, maxiter, true))
                    {
                        MessageBox.Show("Ошибка при выводе данных на форму.", "Опаньки...", MessageBoxButtons.OK);
                    }
                }
            }
            else
            if (Data.preconditioner == 1 || Data.preconditioner == 2 || Data.preconditioner == 3 || Data.preconditioner == 4)    //диагональное предобуславливание или Неполное разложение Холесского
            {
                Vector z = new Vector(SLAE.PMatrix.ReverseProgress(SLAE.PMatrix.DirectProgress(r)));
                for (iterNum = 0; iterNum < maxiter && residual >= eps; iterNum++)
                {
                    Mr      = SLAE.PMatrix.ReverseProgress(SLAE.PMatrix.DirectProgress(r)); //M^-1*r(k-1)
                    Az      = SLAE.Matrix.Multiply(z);                                      //A*z(k-1)
                    alpha   = Mr.Scalar(r) / Az.Scalar(z);
                    result  = result.Sum(z.Mult(alpha));
                    iner_mr = Mr.Scalar(r);    //(M^-1*r(k-1),r(k-1))
                    r       = r.Differ(Az.Mult(alpha));
                    Mr      = SLAE.PMatrix.ReverseProgress(SLAE.PMatrix.DirectProgress(r));
                    betta   = Mr.Scalar(r) / iner_mr;
                    z       = Mr.Sum(z.Mult(betta));

                    residual = r.Norm() / SLAE.RightPart.Norm();
                    if (!autotest)
                    {
                        if (!InputOutput.OutputIterationToForm(iterNum, residual, maxiter, false))
                        {
                            MessageBox.Show("Ошибка при выводе данных на форму.", "Опаньки...", MessageBoxButtons.OK);
                        }
                    }
                }
                if (!autotest)
                {
                    if (!InputOutput.OutputIterationToForm(iterNum - 1, residual, maxiter, true))
                    {
                        MessageBox.Show("Ошибка при выводе данных на форму.", "Опаньки...", MessageBoxButtons.OK);
                    }
                }
            }
            return(result);
        }
Exemplo n.º 14
0
        void UpdateSelectionOptions()
        {
            Loading             = true;
            SelectedGameObjects = new List <GameObject>();

            for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
            {
                SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
            }

            for (int s = 0; s < SelectionManager.Current.SymetrySelection.Length; s++)
            {
                for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
                {
                    SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
                }
            }

            Count = SelectedGameObjects.Count;
            if (Count == 0)
            {
                None.SetActive(true);
                Mix.SetActive(false);
                MarkerListControler.UpdateList();
                return;
            }


            None.SetActive(false);
            Mix.SetActive(true);

            bool AllowName = SelectionManager.Current.Selection.Ids.Count == 1;

            if (AllowName)
            {
                ReadNameMarker();
            }


            AllowConnect        = true;
            AllowCamera         = true;
            AllowSize           = true;
            AllowAmount         = true;
            AllowEffectTemplate = true;
            AllowClouds         = true;
            AllowWeather        = true;

            bool[] CheckedTypes = new bool[(int)SaveLua.Marker.MarkerTypes.Count];

            SaveLua.Marker Mr;

            for (int i = 0; i < Count; i++)            // Search for allowed
            {
                Mr = SelectedGameObjects[i].GetComponent <MarkerObject>().Owner;

                if (!CheckedTypes[(int)Mr.MarkerType])
                {
                    CheckedTypes[(int)Mr.MarkerType] = true;

                    if (AllowConnect)
                    {
                        AllowConnect = Mr.AllowByType(SaveLua.Marker.KEY_ADJACENTTO);
                    }
                    if (AllowCamera)
                    {
                        AllowCamera = Mr.AllowByType(SaveLua.Marker.KEY_CANSETCAMERA);
                    }
                    if (AllowSize)
                    {
                        AllowSize = Mr.AllowByType(SaveLua.Marker.KEY_SIZE);
                    }
                    if (AllowAmount)
                    {
                        AllowAmount = Mr.AllowByType(SaveLua.Marker.KEY_AMOUNT);
                    }
                    if (AllowEffectTemplate)
                    {
                        AllowEffectTemplate = Mr.AllowByType(SaveLua.Marker.KEY_EFFECTTEMPLATE);
                    }
                    if (AllowClouds)
                    {
                        AllowClouds = Mr.AllowByType(SaveLua.Marker.KEY_CLOUDCOUNT);
                    }
                    if (AllowWeather)
                    {
                        AllowWeather = Mr.AllowByType(SaveLua.Marker.KEY_WEATHERDRIFTDIRECTION);
                    }

                    if (!AllowConnect && !AllowCamera && !AllowSize && !AllowAmount && !AllowEffectTemplate && !AllowClouds && !AllowWeather)
                    {
                        break;
                    }
                }
            }

            Mr = null;

            NameInput.SetActive(AllowName);

            Connect.SetActive(AllowConnect);

            CameraZoom.SetActive(AllowCamera);
            SetCamera.SetActive(AllowCamera);
            SyncCamera.SetActive(AllowCamera);
            ViewCamera.SetActive(AllowCamera);
            AlignCamera.SetActive(AllowCamera);

            Size.gameObject.SetActive(AllowSize);
            Amount.gameObject.SetActive(AllowAmount);
            Scale.gameObject.SetActive(false);
            EffectTemplate.gameObject.SetActive(AllowEffectTemplate);

            CloudCount.gameObject.SetActive(AllowClouds);
            CloudCountRange.gameObject.SetActive(AllowClouds);
            CloudEmitterScale.gameObject.SetActive(AllowClouds);
            CloudEmitterScaleRange.gameObject.SetActive(AllowClouds);
            CloudHeight.gameObject.SetActive(AllowClouds);
            CloudHeightRange.gameObject.SetActive(AllowClouds);
            CloudSpread.gameObject.SetActive(AllowClouds);
            CloudSpawnChance.gameObject.SetActive(AllowClouds);
            CloudForceType.gameObject.SetActive(AllowClouds);

            WeatherDriftDirection.gameObject.SetActive(AllowWeather);
            MapStyle.gameObject.SetActive(AllowWeather);
            WeatherType01.gameObject.SetActive(AllowWeather);
            WeatherType02.gameObject.SetActive(AllowWeather);
            WeatherType03.gameObject.SetActive(AllowWeather);
            WeatherType04.gameObject.SetActive(AllowWeather);
            WeatherType01Chance.gameObject.SetActive(AllowWeather);
            WeatherType02Chance.gameObject.SetActive(AllowWeather);
            WeatherType03Chance.gameObject.SetActive(AllowWeather);
            WeatherType04Chance.gameObject.SetActive(AllowWeather);

            ReadTypeMarker();

            if (AllowCamera)
            {
                ReadCameraMarker();
            }
            if (AllowSize)
            {
                ReadSizeMarker();
            }
            if (AllowAmount)
            {
                ReadAmountMarker();
            }

            if (AllowConnect)
            {
                ReadAdiacent();
            }
            else
            {
                Markers.MarkerConnected.Clear();
            }

            if (AllowClouds)
            {
                ReadClouds();
            }
            if (AllowWeather)
            {
                ReadWeather();
            }

            MarkerListControler.UpdateList();

            Loading = false;
        }
Exemplo n.º 15
0
        /// <summary>
        /// Метод добавляет в XML тэг <ds:Reference></Reference>
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="signedXml"></param>
        /// <param name="customTag"></param>
        /// <param name="customNamespace"></param>
        /// <param name="precedingSibling"></param>
        /// <returns></returns>
        internal static SignedXml AddReference(XmlDocument doc, SignedXml signedXml, IntPtr certificate, bool signWithId, Mr mr,
                                               SignedTag elemForSign,
                                               ref int idCounter,
                                               string tagForSign,
                                               string tagForSignNamespaceUri,
                                               string namespaceIdAttr = "",
                                               string customTag       = "",
                                               string customNamespace = ""
                                               )
        {
            Reference reference = new Reference();
            string    id        = string.Empty;

            if (elemForSign == SignedTag.CustomTag && string.IsNullOrEmpty(customTag) != true)
            {
                id = SmevXmlHelper.GetElemId(doc, customTag, customNamespace, signWithId);

                if (string.IsNullOrEmpty(id) && signWithId)
                {
                    if (mr == Mr.MR300)
                    {
                        SmevXmlHelper.SetElemId(doc, customTag, NamespaceUri.WSSoap11, signWithId, mr, ref idCounter);
                    }
                    else
                    {
                        id = "#" + SmevXmlHelper.SetElemId(doc, customTag, tagForSignNamespaceUri, signWithId, mr, ref idCounter, "", namespaceIdAttr);
                    }
                }
            }
            else
            {
                id = SmevXmlHelper.GetElemId(doc, tagForSign, tagForSignNamespaceUri, signWithId);

                if (string.IsNullOrEmpty(id) && signWithId)
                {
                    if (mr == Mr.MR300)
                    {
                        id = SmevXmlHelper.SetElemId(doc, tagForSign, tagForSignNamespaceUri, signWithId, mr, ref idCounter);
                    }
                    else
                    {
                        id = "#" + SmevXmlHelper.SetElemId(doc, tagForSign, tagForSignNamespaceUri, signWithId, mr, ref idCounter, "", namespaceIdAttr);
                    }
                }
            }

            reference.Uri          = (signWithId) ? id : string.Empty;
            reference.DigestMethod = SignServiceUtils.GetDigestMethod(SignServiceUtils.GetAlgId(certificate));

            if (string.IsNullOrEmpty(customTag) != true && elemForSign == SignedTag.CustomTag)
            {
                XmlDsigEnvelopedSignatureTransform envelop = new XmlDsigEnvelopedSignatureTransform();
                reference.AddTransform(envelop);
            }

            XmlDsigExcC14NTransform c14 = new XmlDsigExcC14NTransform();

            reference.AddTransform(c14);

            if (mr == Mr.MR300)
            {
                SmevTransformAlg smevTransform = new SmevTransformAlg();
                reference.AddTransform(smevTransform);
            }

            signedXml.AddReference(reference);

            return(signedXml);
        }
Exemplo n.º 16
0
    protected void chkLateFEE_CheckedChanged(object sender, EventArgs e)
    {
        if (chkLateFEE.Checked == true)
        {
            T = Convert.ToInt32(lblGAmt.Text);
            L = Convert.ToInt32(lblTLate.Text);
            R = Convert.ToInt32(lblReqAmt.Text);
            if (R <= T)
            {
                lblMessage1.Text = "Late Fee Not Required";
                lblLTaken.Text   = "0";
                lblLRem.Text     = lblTLate.Text.ToString();

                lblTotalAmtPay.Text = lblReqAmt.Text.ToString();
                btnApprove.Visible  = true;
            }
            else
            {
                Df = R - T;
                if (Df > L)
                {
                    Mr             = Df - L;
                    lblLTaken.Text = L.ToString();
                    L    = L - (Df - Mr);
                    Ltkn = Df - Mr;

                    lblLRem.Text        = "0";
                    Pmt                 = T + Ltkn;
                    lblMessage1.Text    = "Late fee is less, More Required: " + Mr.ToString() + " Rs. for all form approval, and Now Total Amt: We have " + Pmt.ToString();
                    lblTotalAmtPay.Text = Pmt.ToString();
                    btnApprove.Visible  = true;
                }
                else if (Df <= L)
                {
                    Tkn                 = L - Df;
                    L                   = L - Df;
                    lblLTaken.Text      = Df.ToString();
                    lblLRem.Text        = L.ToString();
                    Pmt                 = T + Df;
                    Udr                 = Df;
                    lblMessage1.Text    = "update late fee as: " + L.ToString() + " Rs. ";
                    btnApprove.Visible  = true;
                    lblTotalAmtPay.Text = Pmt.ToString();
                }
            }
        }
        else if (chkLateFEE.Checked == false)
        {
            T = Convert.ToInt32(lblGAmt.Text);
            L = 0;
            R = Convert.ToInt32(lblReqAmt.Text);
            lblLTaken.Text = L.ToString();
            lblLRem.Text   = lblTLate.Text.ToString();
            if (R <= T)
            {
                lblMessage1.Text       = "Amount enough 4 Admission form.";
                lblTotalAmtPay.Text    = lblReqAmt.Text.ToString();
                lblToBeApprovadNo.Text = lblTFromNo.Text.ToString();
                lblToBeAmount.Text     = lblReqAmt.Text.ToString();
                btnApprove.Visible     = true;
            }
            else
            {
                Df = R - T;
                if (Df > L)
                {
                    Mr = Df - L;

                    L                   = L - (Df - Mr);
                    Ltkn                = Df - Mr;
                    Pmt                 = T + Ltkn;
                    lblMessage1.Text    = "Late fee is less, More Required: " + Mr.ToString() + " Rs. for all form approval, and Now Total Amt: We have " + Pmt.ToString();
                    lblTotalAmtPay.Text = T.ToString();

                    btnApprove.Visible = true;
                }
                else if (Df <= L)
                {
                    Tkn = L - Df;
                    L   = L - Df;

                    Pmt = T + Df;
                    Udr = Df;
                    lblMessage1.Text    = "update late fee as: " + L.ToString() + " Rs. ";
                    btnApprove.Visible  = true;
                    lblTotalAmtPay.Text = Pmt.ToString();
                }
            }
        }
    }
Exemplo n.º 17
0
        void UpdateSelectionOptions()
        {
            Loading             = true;
            SelectedGameObjects = new List <GameObject>();

            for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
            {
                SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
            }

            for (int s = 0; s < SelectionManager.Current.SymetrySelection.Length; s++)
            {
                for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
                {
                    SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
                }
            }

            Count = SelectedGameObjects.Count;
            if (Count == 0)
            {
                None.SetActive(true);
                Mix.SetActive(false);
                MarkerListControler.UpdateList();
                return;
            }


            None.SetActive(false);
            Mix.SetActive(true);

            bool AllowName = SelectionManager.Current.Selection.Ids.Count == 1;

            if (AllowName)
            {
                ReadNameMarker();
            }


            AllowConnect = true;
            AllowCamera  = true;
            AllowSize    = true;
            AllowAmount  = true;


            bool[] CheckedTypes = new bool[(int)SaveLua.Marker.MarkerTypes.Count];

            SaveLua.Marker Mr;

            for (int i = 0; i < Count; i++)            // Search for allowed
            {
                Mr = SelectedGameObjects[i].GetComponent <MarkerObject>().Owner;

                if (!CheckedTypes[(int)Mr.MarkerType])
                {
                    CheckedTypes[(int)Mr.MarkerType] = true;

                    if (AllowConnect)
                    {
                        AllowConnect = Mr.AllowByType(SaveLua.Marker.KEY_ADJACENTTO);
                    }

                    if (AllowCamera)
                    {
                        AllowCamera = Mr.AllowByType(SaveLua.Marker.KEY_CANSETCAMERA);
                    }

                    if (AllowSize)
                    {
                        AllowSize = Mr.AllowByType(SaveLua.Marker.KEY_SIZE);
                    }

                    if (AllowAmount)
                    {
                        AllowAmount = Mr.AllowByType(SaveLua.Marker.KEY_AMOUNT);
                    }

                    if (!AllowConnect && !AllowCamera && !AllowSize && !AllowAmount)
                    {
                        break;
                    }
                }
            }

            Mr = null;

            NameInput.SetActive(AllowName);

            Connect.SetActive(AllowConnect);

            CameraZoom.SetActive(AllowCamera);
            SetCamera.SetActive(AllowCamera);
            SyncCamera.SetActive(AllowCamera);
            ViewCamera.SetActive(AllowCamera);

            Size.SetActive(AllowSize);

            Amount.SetActive(AllowAmount);

            ReadTypeMarker();

            if (AllowCamera)
            {
                ReadCameraMarker();
            }
            if (AllowSize)
            {
                ReadSizeMarker();
            }
            if (AllowAmount)
            {
                ReadAmountMarker();
            }

            if (AllowConnect)
            {
                ReadAdiacent();
            }
            else
            {
                Markers.MarkerConnected.Clear();
            }


            MarkerListControler.UpdateList();

            Loading = false;
        }