// Use this for initialization
    void Start()
    {
        instance = this;
        TextAsset temp = Resources.Load<TextAsset>("CopyOfPuzzleAndDragonStringSheet - Sheet1");
        StreamReader re = new StreamReader(new MemoryStream(temp.bytes));
        string line;
        string[] splitLine;

        bool[] a = new bool[sceneCount];

        while ((line = re.ReadLine()) != null)
        {
            splitLine = line.Split(',');
            if (splitLine[0] == "zznone")
                break;

            a[0]= splitLine[4] == "1" ? true : false;
            a[1]= splitLine[5] == "1" ? true : false;

            sTable.Add(splitLine[0], new StringPiece(splitLine[1], splitLine[2], null, splitLine[3],new BitArray(a)));
        }

        //밑에는 임시코드들
        values.AddRange(sTable.Values);
        StartCoroutine(LoadingVoice((int)sceneTag.title));
    }
Exemple #2
0
        public void ChecktDieAnzahlDerStringsNachDemSplitStudent()
        {
            //Arrange
            const string inputString        = "Berthram Bobsen 36489";
            const int    arrayCountExpected = 3;

            //Act
            var stringManager = new StringManager();

            //Assert
            Assert.AreEqual(arrayCountExpected, stringManager.SplitString(inputString).Count);
        }
Exemple #3
0
        public void ChecktDieAnzahlDerStringsNachDemSplitWorker()
        {
            //Arrange
            const string inputString        = "Charlotte Clein 1500 9";
            const int    arrayCountExpected = 4;

            //Act
            var stringManager = new StringManager();

            //Assert
            Assert.AreEqual(arrayCountExpected, stringManager.SplitString(inputString).Count);
        }
Exemple #4
0
        public ActionResult Index()
        {
            Session["a"] = 0;
            html         = null;
            var result = _categoryService.GetCategories();

            foreach (var item in result)
            {
                html += "<li><a href='/" + StringManager.ToSlug(item.Name) + "-" + item.Id + "' style='color:" + item.Color + "!important;'><i class='" + item.Icon + "'></i>" + item.Name + "</a></li>";
            }
            return(View(_postService.GetPostAll(null, 0)));
        }
Exemple #5
0
        private void OnLoginPacket(LoginPacket packet)
        {
            LoginData  = packet.LoginData;
            ClientData = packet.ClientData;

            PlayStatusPacket pk = new PlayStatusPacket();

            if (packet.Protocol > Protocol.ProtocolNumber)
            {
                pk.Status = PlayStatusPacket.LOGIN_FAILED_SERVER;
                SendDataPacket(pk);
                _logger.Info("minecore.login.failedServer", LoginData.DisplayName, ClientPeer.PeerEndPoint);
                return;
            }

            if (packet.Protocol < Protocol.ProtocolNumber)
            {
                pk.Status = PlayStatusPacket.LOGIN_FAILED_CLIENT;
                SendDataPacket(pk);
                _logger.Info("minecore.login.failedClient", LoginData.DisplayName, ClientPeer.PeerEndPoint);
                return;
            }

            if (ServerListData.JoinedPlayer > ServerListData.MaxPlayer)
            {
                pk.Status = PlayStatusPacket.LOGIN_FAILED_SERVER_FULL;
                SendDataPacket(pk);
                _logger.Info("minecore.login.serverFull", LoginData.DisplayName, ClientPeer.PeerEndPoint);
                return;
            }

            if (ServerConfig.UseXboxLiveAuth && !packet.TokenValidated)
            {
                Close("disconnectionScreen.notAuthenticated");
                _logger.Info("minecore.login.faildXbox", LoginData.DisplayName, ClientPeer.PeerEndPoint);
                return;
            }

            _logger.Info(StringManager.GetString("minecore.login", LoginData.DisplayName, EntityId,
                                                 ClientPeer.PeerEndPoint));

            if (ServerConfig.UseEncryption)
            {
                // TODO: Generate Jwt
                ServerToClientHandshakePacket handshake = new ServerToClientHandshakePacket();
                handshake.Token = "";
                SendDataPacket(handshake);
            }
            else
            {
                LoginSuccess();
            }
        }
 public void RandomNameBtn()
 {
     if (currentCharacter.Gender == Gender.Male)
     {
         currentCharacter.Name = TruncateName(StringManager.GetRandomMaleName());
     }
     else
     {
         currentCharacter.Name = TruncateName(StringManager.GetRandomFemaleName());
     }
     RefreshName();
 }
Exemple #7
0
        static void Main(string[] args)
        {
            StringManager stringManager = new StringManager();
            StringBuilder sb            = new StringBuilder();

            stringManager.Concatinate("asd");
            Console.WriteLine(stringManager);
            Console.WriteLine(stringManager.ToString());
            Console.WriteLine(stringManager[0] = 'v');
            Console.WriteLine(stringManager);
            Console.ReadLine();
        }
Exemple #8
0
        private void Server_ConnectPeerEvent(object sender, MineCraftServerConnectPeerEventArgs e)
        {
            IServerPlayer serverPlayer = new ServerPlayer(e.Peer, this);

            e.Peer.HandleBatchPacket = HandleBatchPacket;
            _players.TryAdd(e.Peer.PeerEndPoint, serverPlayer);

            _logger.Info(StringManager.GetString("minecore.connection", e.Peer.PeerEndPoint));

            ServerListData.JoinedPlayer = _players.Count;
            UpdateServerList();
        }
Exemple #9
0
 // Token: 0x06001953 RID: 6483 RVA: 0x002AA81C File Offset: 0x002A8A1C
 public override void UpdateUI(int arg1, int arg2)
 {
     if (this.baseBuild == null)
     {
         return;
     }
     if (arg1 != 1)
     {
         if (arg1 == 2)
         {
             int num = (int)(this.DM.SoldierKind * 4 + this.DM.SoldierRank);
             this.tmpString.Length = 0;
             GameConstants.FormatResourceValue(this.tmpString, this.DM.RoleAttr.m_Soldier[num]);
             for (int i = 0; i < 3; i++)
             {
                 if (this.tmpItem[i].m_BtnID1 == (int)this.DM.SoldierRank)
                 {
                     this.tmpItemtextNum[i * 4 + (int)this.DM.SoldierKind].text = this.tmpString.ToString();
                 }
             }
             this.Cstr_Total.ClearString();
             this.Cstr_Total.IntToFormat(this.DM.SoldierTotal, 1, true);
             this.Cstr_Total.AppendFormat(this.DM.mStringTable.GetStringByID(3873u));
             this.text_Total.text = this.Cstr_Total.ToString();
             this.text_Total.SetAllDirty();
             this.text_Total.cachedTextGenerator.Invalidate();
         }
     }
     else if (this.DM.queueBarData[10].bActive)
     {
         long startTime  = this.DM.queueBarData[10].StartTime;
         long target     = startTime + (long)((ulong)this.DM.queueBarData[10].TotalTime);
         long notifyTime = 0L;
         int  num2       = (int)(this.DM.SoldierKind * 4 + this.DM.SoldierRank);
         this.tmpSD = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
         CString cstring = StringManager.Instance.StaticString1024();
         StringManager.IntToStr(cstring, (long)((ulong)this.DM.SoldierTrainingQty), 1, true);
         this.tmpString.Length = 0;
         this.tmpString.AppendFormat(this.DM.mStringTable.GetStringByID(4048u), this.DM.mStringTable.GetStringByID((uint)this.tmpSD.Name), cstring.ToString());
         this.GUIM.SetTimerBar(this.timeBar, startTime, target, notifyTime, eTimeBarType.CancelType, this.DM.mStringTable.GetStringByID(4047u), this.tmpString.ToString());
         this.timeBar.gameObject.SetActive(true);
         this.text_Training.gameObject.SetActive(false);
         this.bTraining = true;
     }
     else
     {
         this.GUIM.RemoverTimeBaarToList(this.timeBar);
         this.timeBar.gameObject.SetActive(false);
         this.text_Training.gameObject.SetActive(true);
         this.bTraining = false;
     }
 }
Exemple #10
0
    public Server(StringManager stringManager, Ide.Config config, IServiceProvider serviceProvider)
    {
      Contract.Requires(ServiceProvider != null);

      ServiceProvider = serviceProvider;

      var client = new NitraClient(stringManager);
      client.Send(new ClientMessage.CheckVersion(M.Constants.AssemblyVersionGuid));
      var responseMap = client.ResponseMap;
      responseMap[-1] = Response;
      _config = config;
      Client = client;
    }
Exemple #11
0
 void ShowString()
 {
     if (StringManager.Instance.showStringIndex)
     {
         strText.horizontalOverflow = HorizontalWrapMode.Overflow;
         strText.text = string.Format("{0} ({1})", StringManager.GetStr(stringIndex), stringIndex);
     }
     else
     {
         strText.horizontalOverflow = HorizontalWrapMode.Wrap;
         strText.text = StringManager.GetStr(stringIndex);
     }
 }
Exemple #12
0
 // Token: 0x060017A3 RID: 6051 RVA: 0x00285E04 File Offset: 0x00284004
 private void SetSlider(ushort SetCount)
 {
     if (this.m_Slider != null)
     {
         this.m_Slider.m_slider.value = (double)SetCount;
         this.m_Slider.Value          = (long)SetCount;
         this.ResourcesStr.Length     = 0;
         StringManager.IntToStr(this.ResourcesStr, (long)SetCount, 1, true);
         this.m_Slider.m_inputText.text = this.ResourcesStr.ToString();
         this.m_Slider.m_inputText.SetAllDirty();
         this.m_Slider.m_inputText.cachedTextGenerator.Invalidate();
     }
 }
Exemple #13
0
 public ActionResult Update(EPostDTO post)
 {
     post.Slug        = _postService.GetSlugAnyPost(StringManager.ToSlug(post.Title));
     post.UserId      = ((SessionContext)Session["SessionContext"]).Id;
     post.PostContent = HttpUtility.HtmlEncode(post.PostContent);
     if (Session["TempImage"] != null)
     {
         post.Image = (byte[])Session["TempImage"];
     }
     _postService.Update(post);
     _uow.SaveChanges();
     return(Json(true, JsonRequestBehavior.AllowGet));
 }
Exemple #14
0
        public void Test_Sort_When_Valid_Strings_Then_Returns_Expected_Descending_Unique_Sorted_Results(ISort sortingLogic)
        {
            string[] string1       = { "def", "jkl" };
            string[] string2       = { "abc", "ghi" };
            var      stringManager = new StringManager(sortingLogic);
            var      sortedDescendingUniqueStrings = stringManager.Sort(new string[][] { string1, string2 }, SortOrder.Descending).SortedUniqueStrings;

            var expectedResult = new string[] { "jkl", "ghi", "def", "abc" };

            Assert.AreEqual(expectedResult[0], sortedDescendingUniqueStrings[0]);
            Assert.AreEqual(expectedResult[1], sortedDescendingUniqueStrings[1]);
            Assert.AreEqual(expectedResult[2], sortedDescendingUniqueStrings[2]);
            Assert.AreEqual(expectedResult[3], sortedDescendingUniqueStrings[3]);
        }
Exemple #15
0
 // Token: 0x06001AA4 RID: 6820 RVA: 0x002D53B8 File Offset: 0x002D35B8
 public void OnVauleChang(UnitResourcesSlider sender)
 {
     if (sender.Value < 10000L)
     {
         sender.Value = 10000L;
     }
     this.funds  = (ushort)sender.Value;
     this.profit = (uint)Math.Floor((double)this.funds * this.interest);
     this.SetNumbers();
     StringManager.IntToStr(this.fundsText, (long)this.funds, 1, true);
     sender.m_inputText.text = this.fundsText.ToString();
     sender.m_inputText.SetAllDirty();
     sender.m_inputText.cachedTextGenerator.Invalidate();
 }
        public void ChangeSignOfOperand()
        {
            StringManager stringManager = new StringManager();

            stringManager.AddDigitToOperand("1");
            stringManager.ChangeSignOfOperand();
            Assert.AreEqual("-1", stringManager.FirstOperand.ToString());

            StringManager stringManager2 = new StringManager();

            stringManager2.AddDigitToOperand("-5");
            stringManager2.ChangeSignOfOperand();
            Assert.AreEqual("5", stringManager2.FirstOperand.ToString());
        }
Exemple #17
0
    // Token: 0x06001E9A RID: 7834 RVA: 0x003A7B40 File Offset: 0x003A5D40
    public void OnTextChang(UnitResourcesSlider sender)
    {
        int id = sender.m_ID;

        if (!this.CheckResourceMax(id, sender))
        {
            return;
        }
        StringManager.IntToStr(this.ResourcesStr[id], sender.Value, 1, true);
        this.m_Slider[id].m_inputText.text = this.ResourcesStr[id].ToString();
        this.m_Slider[id].m_inputText.SetAllDirty();
        this.m_Slider[id].m_inputText.cachedTextGenerator.Invalidate();
        this.CheckResource(id, sender.Value);
    }
Exemple #18
0
    // Token: 0x060028A9 RID: 10409 RVA: 0x004481FC File Offset: 0x004463FC
    public unsafe static int IntToStr(CString s, long x, int digits = 1, bool bNumber = false)
    {
        if (s == null)
        {
            return(-1);
        }
        int i    = 0;
        int num  = 0;
        int num2 = (x >= 0L) ? 1 : -1;

        if (num2 < 0)
        {
            x *= -1L;
        }

        fixed(string text = s.ToString())
        {
            fixed(char *ptr = text + RuntimeHelpers.OffsetToStringData / 2)
            {
                while (x != 0L)
                {
                    if (bNumber && num == 3)
                    {
                        ptr[i++ *2] = ',';
                        num         = 0;
                    }
                    ptr[i++ *2] = GameConstants.numChar[(int)(checked ((IntPtr)(x % 10L)))];
                    x           = (long)((double)x * 0.1);
                    if (bNumber)
                    {
                        num++;
                    }
                }
                while (i < digits)
                {
                    ptr[i++ *2] = GameConstants.numChar[0];
                }
                if (num2 < 0)
                {
                    ptr[i++ *2] = '-';
                }
                StringManager.reverse(s, i);
                ptr[i]   = '\0';
                s.Length = i;
                text     = null;
                return(i);
            }
        }
    }
Exemple #19
0
        private void TableViewer_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                Close();
            }
            if (tableBrowser.CurrentCell == null)
            {
                return;
            }

            // Open Table
            var ex = new DataGridViewCellEventArgs(tableBrowser.CurrentCell.ColumnIndex, tableBrowser.CurrentCell.RowIndex);

            if (e.KeyData == Keys.Enter || e.KeyCode == Keys.Enter && e.Control == true)
            {
                tableBrowser_CellClick(sender, ex);
                tableBrowser_CellDoubleClick(sender, ex);

                e.Handled = true;
            }

            // ShowColumns
            if (e.KeyCode == Keys.Right || e.KeyCode == Keys.Left)
            {
                tableBrowser_CellClick(sender, ex);

                e.Handled = true;
            }

            // Jump TableNames
            if (e.KeyData.ToString().Length == 1 && StringManager.IsUpperLatin(e.KeyData.ToString()[0]))
            {
                foreach (DataGridViewRow r in tableBrowser.Rows)
                {
                    if (r.Index <= tableBrowser.CurrentRow.Index)
                    {
                        continue;
                    }
                    if (r.Cells[0].Value.ToString().ToUpper().Substring(0, 1).Equals(e.KeyData.ToString().Substring(0, 1)))
                    {
                        tableBrowser.FirstDisplayedScrollingRowIndex = r.Index;
                        tableBrowser.CurrentCell = r.Cells[0];
                        break;
                    }
                }
                e.Handled = true;
            }
        }
Exemple #20
0
        public void CalculateCondition(BusinessFlow BusinessFlow, Environments.ProjEnvironment ProjEnvironment, Act act, Activity LastExecutedActivity, ObservableList <DataSourceBase> DSList)
        {
            if (Condition == null)
            {
                ConditionCalculated = "";
                return;
            }
            // We changed enum name from Pass to Passed. Below is to support existing users flow control having pass.
            // To be removed later
            if (Condition.Equals("\"{ActionStatus}\" = \"Pass\""))
            {
                Condition = Condition.Replace("Pass", "Passed");
            }
            else if (Condition.Equals("\"{ActionStatus}\" = \"Fail\""))
            {
                Condition = Condition.Replace("Fail", "Failed");
            }

            IValueExpression VE = RepositoryItemHelper.RepositoryItemFactory.CreateValueExpression(ProjEnvironment, BusinessFlow, DSList);

            VE.Value = Condition;

            foreach (ActReturnValue ARC in act.ReturnValues)
            {
                if (!string.IsNullOrEmpty(ARC.Actual))
                {
                    if (VE.Value.Contains("{Actual}"))
                    {
                        if ((ARC.Actual != null) && StringManager.IsNumeric(ARC.Actual))
                        {
                            VE.Value = VE.Value.Replace("{Actual}", ARC.Actual.ToString());
                        }
                        else
                        {
                            VE.Value = VE.Value.Replace("{Actual}", "\"" + ARC.Actual + "\"");
                        }
                    }
                }
            }
            if (VE.Value.Contains("{ActionStatus}"))
            {
                VE.Value = VE.Value.Replace("{ActionStatus}", (act.Status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.FailIgnored ? Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed : act.Status).ToString());
            }
            else if (VE.Value.Contains("{LastActivityStatus}"))
            {
                VE.Value = VE.Value.Replace("{LastActivityStatus}", LastExecutedActivity != null ? LastExecutedActivity.Status.ToString() : "Last executed Activity Status not available");
            }
            ConditionCalculated = VE.ValueCalculated;
        }
Exemple #21
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            // check if this is the first time the home page has been loaded
            if (FirstLoad == true)
            {
                // first time home page has been loaded, check if the welcome dialog has been shown or not

                // store localized strings temp
                string didShowWelcomeDialogCompositeKey = StringManager.GetLocalizedString("DidShowWelcomeDialogCompositeKey");
                string didShowWelcomeDialogValueKey     = StringManager.GetLocalizedString("DidShowWelcomeDialogCompositeKeyValueKey");

                // get the composite
                ApplicationDataCompositeValue welcomeDialogComposite = SettingsManager.GetComposite(didShowWelcomeDialogCompositeKey);

                bool alreadyShown = !Dialogs.WelcomeDialog.AlwaysShow;

                if (welcomeDialogComposite == null)
                {
                    // not previously set, so set it
                    SettingsManager.SetComposite(new ApplicationDataCompositeValue {
                        [didShowWelcomeDialogValueKey] = true
                    }, didShowWelcomeDialogCompositeKey);
                }
                else
                {
                    // composite existed
                    if (Dialogs.WelcomeDialog.AlwaysShow == false)
                    {
                        // AlwaysShow was false, so just get the composite value
                        alreadyShown = (bool)welcomeDialogComposite[StringManager.GetLocalizedString(didShowWelcomeDialogValueKey)];
                    }
                    // else
                    // AlwaysShow was true, therefore show the welcome dialog regardless of the composite value
                }

                if (alreadyShown == false)
                {
                    // dialog has either not been shown, or AlwaysShow was true
                    // show dialog
                    await new Dialogs.WelcomeDialog().ShowAsync();
                }

                // prevent this from running again if the home page is ever loaded again
                FirstLoad = false;
            }

            // load list items
            // TODO
        }
        public void CreatingFloatingPointNumber()
        {
            StringManager stringManager = new StringManager();

            stringManager.AddDigitToOperand("1");
            Assert.AreEqual("1", stringManager.FirstOperand.ToString());
            stringManager.AddDigitToOperand("0");
            Assert.AreEqual("10", stringManager.FirstOperand.ToString());
            stringManager.AddDigitToOperand("0");
            Assert.AreEqual("100", stringManager.FirstOperand.ToString());
            stringManager.AddDigitToOperand(".");
            Assert.AreEqual("100.", stringManager.FirstOperand.ToString());
            //stringManager.ChangeSignOfOperand();
            //Assert.AreEqual("-100", stringManager.FirstOperand.ToString());
        }
Exemple #23
0
        private void InitUI()
        {
            label = new CCLabel("加载中", StringManager.GetText("GlobalFont"), 24)
            {
                Position = new CCPoint(381, 220),
            };
            AddChild(label, 100);

            load = new CCLabel("程序员正在加班写代码", StringManager.GetText("GlobalFont"), 20)
            {
                AnchorPoint = CCPoint.Zero,
                Position    = new CCPoint(250, 150),
            };
            AddChild(load, 100);
        }
Exemple #24
0
        private string getUserName()
        {
            string userName = string.Empty;

            Console.Write(@"Please enter your name ('a'-'z' and 'A'-'Z', Name length up to 25 characters):
>> ");
            userName = Console.ReadLine();

            if ((StringManager.IsOnlyCharacters(userName) == true && StringManager.CheckStringRange(userName, m_MaxInputLength) == false) || StringManager.IsOnlyCharacters(userName) == false)
            {
                throw new FormatException("Input");
            }

            return(userName);
        }
Exemple #25
0
        private string getVehicleModel()
        {
            string userInput = string.Empty;

            Console.Write(@"What is your vehicle model? (Name length up to 25 characters)
>> ");
            userInput = Console.ReadLine();

            if (StringManager.CheckStringRange(userInput, m_MaxInputLength) == false)
            {
                throw new ValueOutOfRangeException("Input length", m_MinInputLength, m_MaxInputLength);
            }

            return(userInput);
        }
Exemple #26
0
    //supposing that
    public static string generateCounting(long now, long to, StringManager strConfig)
    {
        if (now <= to)
        {
            DateTime dt_now = UnixTimeStampToDateTime(now);
            DateTime dt_to  = UnixTimeStampToDateTime(to);

            TimeSpan diff = dt_to - dt_now;
            return(generateLeftTiming(diff, strConfig));
        }
        else
        {
            return(string.Empty);
        }
    }
Exemple #27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            obslugaStringow = new StringManager();
            disp            = FindViewById <TextView>(Resource.Id.disp);
            Button btn0          = FindViewById <Button>(Resource.Id.button0);
            Button btn1          = FindViewById <Button>(Resource.Id.button1);
            Button btn2          = FindViewById <Button>(Resource.Id.button2);
            Button btn3          = FindViewById <Button>(Resource.Id.button3);
            Button btn4          = FindViewById <Button>(Resource.Id.button4);
            Button btn5          = FindViewById <Button>(Resource.Id.button5);
            Button btn6          = FindViewById <Button>(Resource.Id.button6);
            Button btn7          = FindViewById <Button>(Resource.Id.button7);
            Button btn8          = FindViewById <Button>(Resource.Id.button8);
            Button btn9          = FindViewById <Button>(Resource.Id.button9);
            Button btnDot        = FindViewById <Button>(Resource.Id.buttonDot);
            Button btnClr        = FindViewById <Button>(Resource.Id.buttonClear);
            Button btnAdd        = FindViewById <Button>(Resource.Id.buttonAdd);
            Button btnExec       = FindViewById <Button>(Resource.Id.buttonEqualSign);
            Button btnPercentage = FindViewById <Button>(Resource.Id.buttonPercentage);
            Button btnPlusMinus  = FindViewById <Button>(Resource.Id.buttonPlusMinus);
            Button btnMult       = FindViewById <Button>(Resource.Id.buttonMult);
            Button btnDiv        = FindViewById <Button>(Resource.Id.buttonDivision);
            Button btnSub        = FindViewById <Button>(Resource.Id.buttonSub);

            btn0.Click          += AddDigitByNumeralBtn;
            btn1.Click          += AddDigitByNumeralBtn;
            btn2.Click          += AddDigitByNumeralBtn;
            btn3.Click          += AddDigitByNumeralBtn;
            btn4.Click          += AddDigitByNumeralBtn;
            btn5.Click          += AddDigitByNumeralBtn;
            btn6.Click          += AddDigitByNumeralBtn;
            btn7.Click          += AddDigitByNumeralBtn;
            btn8.Click          += AddDigitByNumeralBtn;
            btn9.Click          += AddDigitByNumeralBtn;
            btnDot.Click        += AddDigitByNumeralBtn;
            btnClr.Click        += BtnClr_Click;
            btnAdd.Click        += SwitchOperation;
            btnPercentage.Click += SwitchOperation;
            btnMult.Click       += SwitchOperation;
            btnDiv.Click        += SwitchOperation;
            btnSub.Click        += SwitchOperation;
            btnExec.Click       += Execute;
            btnPlusMinus.Click  += ChangeSignOfNumber;
        }
Exemple #28
0
        public JsonResult Ekle(EditKategoriModel model)
        {
            if (ModelState.IsValid)
            {
                var image               = model.ProfilRsm;
                var fileName            = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(image.FileName);
                var imageDirectory      = Server.MapPath("~/Content/Images/uploads/Kategori");
                var imageDirectorySmall = Server.MapPath("~/Content/Images/uploads/Kategori/Küçük");

                // dizin yoksa oluştur.
                if (!Directory.Exists(imageDirectory))
                {
                    Directory.CreateDirectory(imageDirectory);
                    Directory.CreateDirectory(imageDirectorySmall);
                }

                // resmi sunucuya kaydet
                image.SaveAs(Path.Combine(imageDirectory, fileName));

                // resmi küçük boyutta kaydet
                ImageManager.SaveResizedImage(Image.FromFile(Path.Combine(imageDirectory, fileName)), new Size(300, 300), imageDirectorySmall, fileName);

                var kategori = new Kategori
                {
                    Aciklama       = model.Aciklama,
                    ProfilResimUrl = Path.Combine("Content/Images/uploads/Kategori/Küçük/", fileName),
                    IsActive       = model.IsActive,
                    Ad             = model.Ad,
                    DugumYoluIdler = "",
                    DugumYoluMetni = "",
                    Diger          = model.Diger,
                    AltID          = model.AltID,
                    SeoAd          = StringManager.SeoDuzenleme(model.Ad)
                };

                _kategoriService.Ekle(kategori);

                return(Json(new ResultJson {
                    Success = true, Message = "Kategori ekleme işlemi başarıyla gerçekleşti!"
                }));
            }
            model.Kategoriler = _kategoriService.TumKayitlar();
            var error = ModelState.Select(x => x.Value.Errors).Where(y => y.Count > 0).ToList();

            return(Json(new ResultJson {
                Success = false, Message = "Kategori ekleme işlemi başarısız!"
            }));
        }
Exemple #29
0
        public LoginDialog(UIScreen Screen, Vector2 Pos) : base(Screen, Pos, false, true, false, 0.800f)
        {
            m_Font = m_Screen.Font11px;

            m_Cst = StringManager.StrTable(209);

            Vector2 RelativePosition = new Vector2(45, 0);

            m_LblTitle = new UILabel(m_Cst[1], 1, Pos + RelativePosition, m_Font.MeasureString(m_Cst[1]),
                                     m_Screen.StandardTxtColor, 11, m_Screen, this, UIParser.Nodes.TextAlignment.Center_Center);
            m_LblTitle.DrawOrder = (int)DrawOrderEnum.UI;
            RelativePosition     = new Vector2(20, 50);
            m_LblUsername        = new UILabel(m_Cst[4], 2, Pos + RelativePosition, m_Font.MeasureString(m_Cst[4]),
                                               m_Screen.StandardTxtColor, 9, m_Screen, this, UIParser.Nodes.TextAlignment.Center_Center);
            m_LblUsername.DrawOrder = (int)DrawOrderEnum.UI;
            RelativePosition        = new Vector2(20, 110);
            m_LblPassword           = new UILabel(m_Cst[5], 3, Pos + RelativePosition, m_Font.MeasureString(m_Cst[4]),
                                                  m_Screen.StandardTxtColor, 9, m_Screen, this, UIParser.Nodes.TextAlignment.Center_Center);
            m_LblPassword.DrawOrder = (int)DrawOrderEnum.UI;

            RelativePosition = new Vector2(20, 85);
            m_TxtUsername    = new TextBox(new Rectangle((int)(Pos.X + RelativePosition.X),
                                                         (int)(Pos.Y + RelativePosition.Y), 230, 25), 64, "", m_Screen.Manager.Graphics, 9,
                                           Color.Wheat, Color.White, 30, m_Screen, true, true, this);
            m_TxtUsername.DrawOrder = (int)DrawOrderEnum.UI;
            m_TxtUsername.Name      = "TxtUsername";
            RelativePosition        = new Vector2(20, 145);
            m_TxtPassword           = new TextBox(new Rectangle((int)(Pos.X + RelativePosition.X),
                                                                (int)(Pos.Y + RelativePosition.Y), 230, 25), 64, "", m_Screen.Manager.Graphics, 9, Color.Wheat,
                                                  Color.White, 30, m_Screen, true, true, this);
            m_TxtPassword.Name      = "TxPassword";
            m_TxtPassword.DrawOrder = (int)DrawOrderEnum.UI;

            KeyboardInput.Initialize(Screen.Manager, 500f, 20);

            RelativePosition            = new Vector2(120, 175);
            m_BtnLogin                  = new UIButton("BtnLogin", Pos + RelativePosition, m_Screen, null, m_Cst[2], 9, true, this);
            m_BtnLogin.OnButtonClicked += BtnLogin_OnButtonClicked;
            m_BtnLogin.DrawOrder        = (int)DrawOrderEnum.UI;

            RelativePosition    = new Vector2(200, 175);
            m_BtnExit           = new UIButton("BtnExit", Pos + RelativePosition, m_Screen, null, m_Cst[3], 9, true, this);
            m_BtnExit.DrawOrder = (int)DrawOrderEnum.UI;

            SetSize((int)(50 + m_Font.MeasureString(m_Cst[1]).X + 40), m_DefaultSize.Y + m_BtnExit.Size.Y + 10);

            this.DrawOrder = (int)DrawOrderEnum.UI;
        }
Exemple #30
0
        /// <summary>
        /// Сохранить PDF из чертежа с тем же именем
        /// </summary>
        /// <param name="swModelMan"></param>
        /// <param name="folder">Папка сохранения</param>
        /// <param name="name">Имя файла с расширением</param>
        /// <returns></returns>
        public static bool SavePDF(SwModelManager swModelMan, string folder = null, string name = null)
        {
            bool      ret     = false;
            int       lineNum = 14;
            const int offset  = 23;

            Console.CursorLeft = 0;

            if (string.IsNullOrEmpty(folder))
            {
                folder = swModelMan.FolderPath;
            }

            if (string.IsNullOrEmpty(name))
            {
                name = swModelMan.FileNameWhithoutExt + ".pdf";
            }


            StringManager.ClearLine(lineNum);
            Console.Write($"{"Сохранение PDF: ",offset}");

            DrawingDoc DrawDoc;

            string drawName    = Path.ChangeExtension(swModelMan.FileName, "SLDDRW");
            var    openedDraw  = SwProcess.swApp.GetOpenDocument(drawName);
            bool   docIsOpened = false;

            if (!(openedDraw is null))
            {
                docIsOpened = true;
            }

            if (SwFileManager.OpenDraw(swModelMan.FilePath, out DrawDoc))
            {
                var model = (ModelDoc2)DrawDoc;

                ret = swModelMan.Export.SavePdf(DrawDoc, folder + name, true);

                if (!docIsOpened)
                {
                    SwProcess.swApp.CloseDoc(model.GetTitle());
                }
            }

            Console.Write(ret ? " OK\n" : " Не сохранено\n");
            return(ret);
        }
Exemple #31
0
        /// <summary>
        /// Напечатать имя файла
        /// </summary>
        /// <param name="swModelMan"></param>
        /// <returns></returns>
        public static bool ShowDocName(SwModelManager swModelMan)
        {
            bool ret     = false;
            int  lineNum = 4;

            Console.CursorLeft = 0;
            Console.CursorTop  = lineNum;
            Console.WriteLine("Отсутствует");
            if (!(swModelMan is null))
            {
                StringManager.ClearLine(lineNum);
                Console.WriteLine("{0, 23} {1}", "Имя документа: ", swModelMan.FileName);
                ret = true;
            }
            return(ret);
        }
Exemple #32
0
        public static string ConvertString(AMPMS target)
        {
            string result = string.Empty;

            switch (target)
            {
            case AMPMS.AM:
                result = StringManager.GetString("AM");
                break;

            case AMPMS.PM:
                result = StringManager.GetString("PM");
                break;
            }
            return(result);
        }
Exemple #33
0
        /// <summary>
        /// Erstellt eine neue FrohgameSession und versucht sich einzuloggen
        /// </summary>
        /// <param name="name">Username</param>
        /// <param name="password">Userpass</param>
        /// <param name="server">Server des users. example: "uni42.ogame.de"</param>
        public FrohgameSession(string name, string password, string server)
        {
            if (string.IsNullOrEmpty (name))
                throw new ArgumentNullException ("name");

            if (string.IsNullOrEmpty (password))
                throw new ArgumentNullException ("password");

            if (string.IsNullOrEmpty (server))
                throw new ArgumentNullException ("server");

            this._server = server;
            this._userName = name;
            this._userPassword = password;

            _stringManager = new StringManager (this._userName, this._userPassword, this._server);
        }
Exemple #34
0
        /// <summary>
        /// parset planetinformationen
        /// </summary>
        /// <param name="planetNode">Html Knoten, der die Planetinformationen enthält</param>
        public Planet(HtmlAgilityPack.HtmlNode planetNode, StringManager strings, Logger logger)
        {
            logger.Log (LoggingCategories.Parse, "Planet Constructor");
            this._name = planetNode.SelectSingleNode (strings.PlanetNameXPath).InnerText;

            //Koordinaten auslesen:
            string coordsString = planetNode.SelectSingleNode (strings.PlanetCoordsXPath).InnerText;
            System.Text.RegularExpressions.Match match = System.Text.RegularExpressions.Regex.Match (coordsString, strings.PlanetCoordsRegex);

            //Koordinaten Parsen
            this._coords.Galaxy = Convert.ToInt32 (match.Groups [1].Value);
            this._coords.SunSystem = Convert.ToInt32 (match.Groups [2].Value);
            this._coords.Place = Convert.ToInt32 (match.Groups [3].Value);

            //Link auslesen:
            string linktToPlanet = planetNode.SelectSingleNode (strings.PlanetLinkXPath).Attributes ["href"].Value;
            this._id = Utils.StringReplaceToInt32 (Utils.SimpleRegex (linktToPlanet, strings.PlanetIDRegex));
        }
Exemple #35
0
    public Server(StringManager stringManager, Ide.Config config, IServiceProvider serviceProvider)
    {
      Contract.Requires(ServiceProvider != null);

      ServiceProvider = serviceProvider;

      var client = new NitraClient(stringManager);
      client.Send(new ClientMessage.CheckVersion(M.Constants.AssemblyVersionGuid));
      var responseMap = client.ResponseMap;
      responseMap[-1] = Response;
      _config = config;
      Client = client;

      var builder = ImmutableHashSet.CreateBuilder<string>(StringComparer.OrdinalIgnoreCase);
      foreach (var lang in config.Languages)
        builder.UnionWith(lang.Extensions);
      Extensions = builder.ToImmutable();
    }
 //initialize
 void Start()
 {
     //목소리관련 source//여기서 source는 원본이 아니라 소리가 나는곳이란 뜻인듯.
     sound = GetComponent<AudioSource>();
     anim = GetComponent<Animator>();
     mgr = StringManager.instance;
 }