コード例 #1
0
ファイル: UCsController.cs プロジェクト: PMU-EDU/BEP
        public async Task <IActionResult> Edit(int id, [Bind("UCID,TehsilID,UCName,UCCode")] UC uC)
        {
            if (id != uC.UCID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(uC);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UCExists(uC.UCID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TehsilID"] = new SelectList(_context.Tehsils, "TehsilID", "TehsilName", uC.TehsilID);
            return(View(uC));
        }
コード例 #2
0
        private void ListView2_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            sbyte[]      microinstruccion     = Main.ListaMicroinstrucciones[e.ItemIndex];
            ListViewItem itemMicroinstruccion = new ListViewItem(UC.ObtenerMicroInstruccionAPartirDeSeñales(microinstruccion));

            itemMicroinstruccion.SubItems.AddRange
                (new ListViewItem.ListViewSubItem[] {
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[0].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[1].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[2].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[3].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[4].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[5].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[6].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[7].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[8].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[9].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[10].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[11].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[12].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, microinstruccion[13] < 0 ? "     X" : "     " + microinstruccion[13].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, microinstruccion[14] < 0 ? "     X" : "     " + microinstruccion[14].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, microinstruccion[15] < 0 ? "     X" : "     " + microinstruccion[15].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[16].ToString()),
                new ListViewItem.ListViewSubItem(itemMicroinstruccion, "     " + microinstruccion[17].ToString())
            });

            e.Item = itemMicroinstruccion;
        }
コード例 #3
0
        /// <summary>
        /// This is executed at the start of the application.
        /// It getts all Strategies in AlgoTraderStrategies namespace.
        /// It will hash the code and store it in the DB and return the usable strategies that can be used in trading
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, string> RefreshStrategyNamesAndIds()
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            Type[] types = UC.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "AT.AlgoTraderStrategies");


            string baseStrategyText = UC.NormalizeSourceCode(File.ReadAllText(Global.Constants.BaseStrategyPath));
            string baseStrategyMD5  = UC.MD5Hash(baseStrategyText);
            string baseStrategyId   = baseStrategyMD5.Substring(baseStrategyMD5.Length - 6);

            for (int n = 0; n < types.Length; n++)
            {
                string strategyText = UC.NormalizeSourceCode(File.ReadAllText(Global.Constants.StrategiesFolder + types[n].Name + ".cs"));
                string strategyMD5  = UC.MD5Hash(strategyText);
                string strategyId   = strategyMD5.Substring(strategyMD5.Length - 6) + baseStrategyId;
                result.Add(strategyId, types[n].Name);

                DBMethods.InsertStrategyName(strategyId, types[n].Name, UCDT.GetCurrentNanoUnix());
            }



            return(result);
        }
コード例 #4
0
ファイル: UCsController.cs プロジェクト: PMU-EDU/BEP
        public async Task <IActionResult> PutUC(int id, UC uC)
        {
            if (id != uC.UCID)
            {
                return(BadRequest());
            }

            _context.Entry(uC).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UCExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            UC ui = new UC();

            G1.Children.Add(ui);
            Grid.SetRow(ui, 2);
        }
コード例 #6
0
ファイル: UCsController.cs プロジェクト: PMU-EDU/BEP
        public async Task <ActionResult <UC> > PostUC(UC uC)
        {
            _context.UCs.Add(uC);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetUC", new { id = uC.UCID }, uC));
        }
コード例 #7
0
 /****************************************Form Event****************************************************************/
 #region Form Event
 private void UC_SizeChanged(object sender, EventArgs e)
 {
     if (UC.geturl() != "" && UC.gethtmlsource() != "")
     {
         UC.callJS();
     }
 }
コード例 #8
0
        public static void VacuumAllDBs(ThreadControl tc)
        {
            tc.Log.AddLine("Starting Vacuuming all databases", Verbosity.Minimal);

            List <string> keys = DBMethods.GetConnectionKeys();

            long startSize = UC.GetFolderSize(Global.Constants.StockTicksDBPath);

            for (int m = 0; m < keys.Count; m += 60)
            {
                Parallel.For(0, 60, new ParallelOptions {
                    MaxDegreeOfParallelism = 20
                }, n =>
                {
                    if (m + n < keys.Count)
                    {
                        tc.Log.AddLine("Vacuuming " + keys[m + n], Verbosity.Verbose);
                        DBMethods.Vacuum(keys[m + n]);
                        tc.Log.AddLine("Done Vacuuming " + keys[m + n], Verbosity.Verbose);
                    }
                });
                if (!tc.CheckNotStopped())
                {
                    tc.Log.AddLine("Breaking VacuumAllDBs!");
                    break;
                }
            }

            Thread.Sleep(500);

            long endSize = UC.GetFolderSize(Global.Constants.StockTicksDBPath);

            tc.Log.AddLine("Vacuuming Complete. Start size: " + startSize + ", End size: " + endSize, Verbosity.Minimal);
        }
コード例 #9
0
ファイル: frmLast.cs プロジェクト: hkiaipc/hunb
 /// <summary>
 /// 
 /// </summary>
 /// <param name="uc"></param>
 /// <param name="n"></param>
 private void Add(UC.UCSluice uc, int n)
 {
     Point loc = GetLocate(n);
     Size size = GetSize();
     uc.Location = loc;
     uc.Size = size;
     this.panel1.Controls.Add(uc);
 }
コード例 #10
0
        private static UC CriaUC(List <string> codigo, Compilado compilado)
        {
            UC comp = new UC(null, compilado.CodigoXBinario);

            foreach (var item in compilado.Codigo)
            {
                comp.Memoria.AddCodigo(item);
            }
            return(comp);
        }
コード例 #11
0
        public MenuCloseButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(CloseButtonBrush);
                MouseEnter      += (s, x) => ButtonMouseOverAnim(CloseButtonBrush, true);
                MouseLeave      += (s, x) => ButtonMouseLeaveAnimBgColor(CloseButtonBrush, false);
                TheButton.Click += delegate { UC.Close_UserControls(); };
            };
        }
コード例 #12
0
ファイル: Program.cs プロジェクト: PedroVFerreira/AssemblyIDE
        private static UC CriaUC(List <string> codigo)
        {
            var compilado = Compilador.Compilar(codigo);

            UC comp = new UC(new Logger(), compilado.CodigoXBinario);

            foreach (var item in compilado.Codigo)
            {
                comp.Memoria.AddCodigo(item);
            }
            return(comp);
        }
コード例 #13
0
ファイル: UCsController.cs プロジェクト: PMU-EDU/BEP
        public async Task <IActionResult> Create([Bind("UCID,TehsilID,UCName,UCCode")] UC uC)
        {
            if (ModelState.IsValid)
            {
                _context.Add(uC);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TehsilID"] = new SelectList(_context.Tehsils, "TehsilID", "TehsilName", uC.TehsilID);
            return(View(uC));
        }
コード例 #14
0
        void UpdateProduct(string name, string description, string price, Image image, string mark, string category, string oldName)
        {
            OleDbConnection connection = new OleDbConnection(connstring);

            try
            {
                connection.Open();

                OleDbCommand   command   = new OleDbCommand("UPDATE [" + category + "] SET Название = ?, Описание = ?, Цена = ?, Изображение = ?, ID_Марки = ? WHERE [" + category + "].Название = ?", connection);
                OleDbParameter parameter = new OleDbParameter("Название", OleDbType.VarChar);
                parameter.Value = name;
                command.Parameters.Add(parameter);

                OleDbParameter parameter1 = new OleDbParameter("Описание", OleDbType.VarChar);
                parameter1.Value = description;
                command.Parameters.Add(parameter1);

                OleDbParameter parameter2 = new OleDbParameter("Цена", OleDbType.Integer);
                parameter2.Value = Convert.ToInt32(price);
                command.Parameters.Add(parameter2);

                MemoryStream memoryStream = new MemoryStream();
                System.Drawing.Imaging.ImageFormat format = image.RawFormat;
                image.Save(memoryStream, format);
                OleDbParameter parameter3 = new OleDbParameter("Изображение", OleDbType.Binary);
                parameter3.Value = memoryStream.ToArray();
                command.Parameters.Add(parameter3);

                OleDbParameter parameter4 = new OleDbParameter("ID_Марки", OleDbType.Integer);
                parameter4.Value = Convert.ToInt32(ID_Марки);
                command.Parameters.Add(parameter4);

                OleDbParameter parameter5 = new OleDbParameter("[" + category + "].Название", OleDbType.VarChar);
                parameter5.Value = oldName;
                command.Parameters.Add(parameter5);

                command.ExecuteNonQuery();

                MetroFramework.MetroMessageBox.Show(this, "Запись успешно обновлена!", "Обновление товара");
                UC.flowLayoutPanel1.Controls.Clear();
                UC.LoadProducts(UC.lNameCategory.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                connection.Close();
            }
        }
コード例 #15
0
        /// <summary>
        /// Unique constraints don't work
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public static string GetTableCreationSQL(List <Column> columns, string tableName)
        {
            /*
             *  CREATE TABLE IF NOT EXISTS "Trades"
             *  (
             *          "Timestamp" INTEGER NOT NULL UNIQUE,
             *          "Price" REAL NOT NULL,
             *          "Volume" INTEGER NOT NULL,
             *          "ExchangeId" INTEGER NOT NULL,
             *          "Conditions" TEXT,
             *          "Tape" INTEGER NOT NULL,
             *          PRIMARY KEY("Timestamp") // PRIMARY KEY("col1","col2")
             *  );
             */

            string result = "CREATE TABLE IF NOT EXISTS \"" + tableName + "\" ";

            result += "(";

            List <string> primaryKeysNames = columns.Where(c => c.PrimaryKey != 0).OrderBy(c => c.PrimaryKey).Select(p => p.Name).ToList();

            // columns
            for (int n = 0; n < columns.Count; n++)
            {
                result += "\"" + columns[n].Name + "\" " + columns[n].Type.ToString();

                if (primaryKeysNames.Count == 1 && primaryKeysNames[0] == columns[n].Name)
                {
                    result += " PRIMARY KEY, ";
                }
                else
                {
                    result += (columns[n].NotNull ? " NOT NULL" : "") + ", ";
                }
            }

            if (primaryKeysNames.Count == 1)
            {
                result = result.Substring(0, result.Length - 2);
            }

            //primary key
            if (primaryKeysNames.Count > 1)
            {
                result += "PRIMARY KEY (\"" + UC.ListToString(primaryKeysNames, "\",\"") + "\")";
            }

            result += ");";

            return(result);
        }
コード例 #16
0
 private void FillList(List <Image> board, string image, string oddImage, decimal limit)
 {
     for (decimal i = limit; i > 0; i -= UC)
     {
         if (i < UC)
         {
             board.Add(GetImage(oddImage, i.ToString("0.###")));
         }
         else
         {
             board.Add(GetImage(image, UC.ToString("0.###")));
         }
     }
 }
コード例 #17
0
ファイル: MainVM.cs プロジェクト: YuvalNag/WPF
 public void SwitchUCSelected()
 {
     if (selectedIndex == 0)
     {
         if (UC.Count == 1)
         {
             UC.Add(new CountriesListUC());
         }
         selectedIndex = 1;
     }
     else
     {
         selectedIndex = 0;
     }
 }
コード例 #18
0
ファイル: View.ascx.cs プロジェクト: dchaves80/dispe
        protected void btnGuardarConfigNegocio_Click(object sender, EventArgs e)
        {
            Data2.Class.Struct_UserConfig UC = Data2.Class.Struct_UserConfig.getUserConfig(UserId);
            if (UC == null)
            {
                UC = new Struct_UserConfig();
            }

            UC.FacturaPorDefecto  = cmb_FacturaPorDefecto.SelectedValue;
            UC.NombreNegocio      = txt_NombreNegocio.Text;
            UC.MostrarLogoNegocio = chk_MostrarLogoNegocio.Checked;
            UC.PIN           = "";
            UC.MostrarKiosco = chk_HabilitarKiosco.Checked;
            UC.Guardar(UserId);
        }
コード例 #19
0
        private void waitdata()
        {
            string finishurl = @"https://api.twitter.com/oauth/authorize";

            while (true)
            {
                if (UC.geturl() == finishurl)
                {
                    if (twitterAuthenticateHtml(UC.gethtmlsource()))
                    {
                        break;
                    }
                }
                Thread.Sleep(100);
            }
        }
コード例 #20
0
        public SlideshowButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                TheButton.PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(SlideshowButtonBrush);
                TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(SlideshowButtonBrush, true);
                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(SlideshowButtonBrush, false);
                TheButton.Click      += delegate { UC.Close_UserControls(); Slideshow.StartSlideshow(); };

                var s = Application.Current.Resources["StartSlideshow"] as string;
                s      += " [F5]";
                ToolTip = s;
            };
        }
コード例 #21
0
        /// <summary>
        /// When simulating, this method will load all of the needed nodes for simulating a live feed/stream.
        /// </summary>
        private void PrepareSimDayNodes()
        {
            if (AlgoTraderState.IsSim)
            {
                // load up today's nodes for StreamManager to pretend to add nodes by using today's nodes

                int       amount = 100;
                Stopwatch sw     = new Stopwatch();
                sw.Start();

                object lockObj = new object();

                for (int m = 0; m < Global.State.AllSymbols.Count; m += amount)
                {
                    Parallel.For(0, amount, new ParallelOptions {
                        MaxDegreeOfParallelism = 30
                    }, n =>
                    {
                        if (m + n < Global.State.AllSymbols.Count)
                        {
                            // NodesData nodes = null;
                            NodesData nodes = DataMethods.GetCachedDayNodesData(Global.State.AllSymbols[m + n], AlgoTraderState.CurrentDay, Interval.HalfSecond, justCache: false);

                            // NodesData nodesData = DataMethods.GetCachedDayNodesData(Global.State.AllSymbols[m + n], CurrentDay, Interval.HalfSecond, computeNodes: true, justCache: false);

                            // no need to ComputeGaps because it's 1 day... trusting well formatted data
                            lock (lockObj)
                            {
                                AlgoTraderShared.SimDayNodes.Add(Global.State.AllSymbols[m + n], nodes);

                                //nodes.Add(Global.State.AllSymbols[m + n], DataMethods.GetCachedDayNodesData(Global.State.AllSymbols[m + n], CurrentDay, Interval.HalfSecond, computeNodes: true, justCache: false));
                            }
                            TC.Log.AddLine("Loaded " + Global.State.AllSymbols[m + n] + " stock nodes for stream manager");
                        }
                    });

                    if (!TC.CheckNotStopped())
                    {
                        break;
                    }
                }

                sw.Stop();

                TC.Log.AddLine("Finished loading sim nodes for stream manager in " + UC.MillisecondsToSeconds(sw.ElapsedMilliseconds, 3) + " sec(s). That's " + ((decimal)Global.State.AllSymbols.Count / UC.MillisecondsToSeconds(sw.ElapsedMilliseconds, 3)) + " per sec.");
            }
        }
コード例 #22
0
        public MenuCloseButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(CloseButtonBrush);
                MouseEnter += (s, x) => ButtonMouseOverAnim(CloseButtonBrush, true);
                MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CloseButtonBrush, false);

                if (!Properties.Settings.Default.DarkTheme)
                {
                    AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                }

                TheButton.Click += delegate { UC.Close_UserControls(); };
            };
        }
コード例 #23
0
        private string _generalLogicResult(UBasCov2 BasCov)
        {
            try{
                var BaseSetLst  = BasCov.BaseSetLst;        //BaseSet  list
                var CoverSetLst = BasCov.CoverSetLst;       //CoverSet list

                Bit81 Q = new Bit81();
                foreach (var P in CoverSetLst)
                {
                    Q |= P.rcnBit.CompressToHitCells();
                }
                foreach (var UC in Q.IEGetRC().Select(rc => pBDL[rc]))
                {
                    UC.SetCellBgColor(SolBkCr2);
                }

                for (int rc = 0; rc < 81; rc++)
                {
                    int noB = BasCov.HB981.IsHit(rc);
                    if (noB > 0)
                    {
                        pBDL[rc].SetNoBBgColor(noB, AttCr, SolBkCr);
                    }
                }

                string msg  = "\r     BaseSet: ";
                string msgB = BaseSetLst.Aggregate("", (Q, P) => Q + $" {P.ToAppearance()}");
                msg += msgB.ToString_SameHouseComp1();

                msg += "\r    CoverSet: ";
                string msgC = CoverSetLst.Aggregate("", (Q, P) => Q + $" {P.ToAppearance()}");
                msg += msgC.ToString_SameHouseComp1();

                string st = $"GeneralLogic size:{BasCov.sz} rank:{BasCov.rnk}";
                Result     = st;
                msg       += $"\rChkBas:{ChkBas4}/{ChkBas1}  ChkCov:{ChkCov2}/{ChkCov1}";
                ResultLong = st + "\r " + msg;
                return(st + "\r" + msg);
            }
            catch (Exception ex) { WriteLine(ex.Message + "\r" + ex.StackTrace); }
            return("");
        }
コード例 #24
0
        public FileMenu()
        {
            InitializeComponent();

            PasteButton.PreviewMouseLeftButtonDown += delegate { UC.Close_UserControls(); };

            // OpenBorder
            OpenBorder.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(OpenBorderFill); };
            OpenBorder.MouseEnter += delegate { ButtonMouseOverAnim(OpenBorderFill); };
            OpenBorder.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(OpenBorderBrush); };
            OpenBorder.MouseLeave += delegate { ButtonMouseLeaveAnim(OpenBorderFill); };
            OpenBorder.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(OpenBorderBrush); };

            // PrintBorder
            PrintBorder.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(PrintFill); };
            PrintBorder.MouseEnter += delegate { ButtonMouseOverAnim(PrintFill); };
            PrintBorder.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(PrintBrush); };
            PrintBorder.MouseLeave += delegate { ButtonMouseLeaveAnim(PrintFill); };
            PrintBorder.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(PrintBrush); };

            // SaveBorder
            SaveBorder.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(SaveFill); };
            SaveBorder.MouseEnter += delegate { ButtonMouseOverAnim(SaveFill); };
            SaveBorder.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(SaveBrush); };
            SaveBorder.MouseLeave += delegate { ButtonMouseLeaveAnim(SaveFill); };
            SaveBorder.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(SaveBrush); };

            // FileLocationBorder
            FileLocationBorder.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(FileLocationFill); };
            FileLocationBorder.MouseEnter += delegate { ButtonMouseOverAnim(FileLocationFill); };
            FileLocationBorder.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(FileLocationBrush); };
            FileLocationBorder.MouseLeave += delegate { ButtonMouseLeaveAnim(FileLocationFill); };
            FileLocationBorder.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(FileLocationBrush); };

            // CopyButton
            CopyButton.TheButton.Click += delegate
            {
                UC.Close_UserControls();
                FileHandling.Copy_Paste.Copyfile();
            };
        }
コード例 #25
0
        public SlideshowButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                TheButton.PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(SlideshowButtonBrush);
                TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(SlideshowButtonBrush, true);
                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(SlideshowButtonBrush, false);
                TheButton.Click      += delegate { UC.Close_UserControls(); Slideshow.StartSlideshow(); };

                var s = Application.Current.Resources["StartSlideshow"] as string;
                s      += " [F5]";
                ToolTip = s;

                if (!Properties.Settings.Default.DarkTheme)
                {
                    AnimationHelper.LightThemeMouseEvent(this, SlideshowBrush);
                }
            };
        }
コード例 #26
0
ファイル: UC.cs プロジェクト: meatz89/CyberWarfare
    // Use this for initialization
    void Start () {
        Instance = this;

        MainCamera = Camera.allCameras[0];
        MenuCamera = Camera.allCameras[1];

        List<GameObject> Ressources = new List<GameObject>(GameObject.FindGameObjectsWithTag("Ressource"));
        foreach (var r in Ressources)
        {
            var pos = r.transform.position;
        
            RectTransform go = (RectTransform)Instantiate(RessourceLabel, RessourceLabel.transform.position, RessourceLabel.transform.rotation);
            go.transform.SetParent(r.transform, false);
            go.position = pos;
        }

        List<GameObject> SystemRessources = new List<GameObject>(GameObject.FindGameObjectsWithTag("SystemRessource"));
        foreach (var r in SystemRessources)
        {
            var pos = r.transform.position;

            RectTransform go = (RectTransform)Instantiate(RessourceLabel, RessourceLabel.transform.position, RessourceLabel.transform.rotation);
            go.transform.SetParent(r.transform, false);
            go.position = pos;

            var scriptRessource = r.GetComponent<RessourceBehaviour>();
            var Systems = GameObject.FindGameObjectsWithTag("System");
            foreach (var system in Systems)
            {
                var scriptSystem = system.GetComponent<SystemBehaviour>();
                scriptSystem.CreateSystemRessource(scriptRessource.gameObject);
            }
        }

        CanvasGroup cg = RessourceLabel.GetComponent<CanvasGroup>();
        cg.interactable = false;
        cg.alpha = 0;
    }
コード例 #27
0
        //en Form1

        private void Renombrar()
        {
            //Renombrar Objetos Form1
            #region Renombrar Labels
            LB_CantidadLibros.Text = Res.tx_CantidadLibros;
            LB_NombreLibro.Text    = Res.tx_NombreLibro;
            #endregion
            #region Renombrar Botones
            BTN_Importar.Text = Res.tx_importar;
            Btn_Calcular.Text = Res.tx_Ingresar;
            #endregion
            #region Renombrar GroupBox
            this.GB_IngresarDatos.Text = Res.tx_IngresarDatos;
            #endregion

            //Recorrer cada UserControl1 y Renombrar
            foreach (UserControl1 UC in TodosMisUC)
            {
                UC.RenombrarTodo();
            }

            //Renombrar Form2.
        }
コード例 #28
0
ファイル: Program.cs プロジェクト: PedroVFerreira/AssemblyIDE
        static void Main(string[] args)
        {
            var codigo = new List <string>();

            //codigo.Add("mov ax,bx");
            //codigo.Add("mov ax,[100]");
            //codigo.Add("mov ax,[bx]");
            //codigo.Add("mov [100],bx");
            codigo.Add("mov [100],10");
            ////codigo.Add("mov ax,[100]");
            ////codigo.Add("mov [ax],[bx]");
            //codigo.Add("mov [100],bx");
            UC comp = CriaUC(codigo);

            comp.Registradores.BX.setConteudo("100000000");
            //comp.Registradores.AX.setConteudo("00");

            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            comp.Rodar();
            //comp.Clock();
            //comp.Clock();
            //comp.Clock();
            //comp.Clock();
            //comp.Clock();
            //comp.Clock();
            //comp.Clock();
            //comp.Clock();
        }
コード例 #29
0
        private void Renombrar(string Cultura)
        {
            //Renombrar Objetos Form1
            #region Renombrar Labels
            LB_CantidadLibros.Text = Res.tx_CantidadLibros;
            LB_NombreLibro.Text    = Res.tx_NombreLibro;
            Lbl_Elige_Idioma.Text  = Res.tx_elige_idioma;
            LB_Editorial.Text      = Res.Editorial;
            #endregion
            #region Renombrar Botones
            //BTN_Importar.Text = Res.tx_importar;
            BTN_Calcular.Text = Res.tx_Ingresar;
            #endregion
            #region Renombrar GroupBox
            this.GB_IngresarDatos.Text = Res.tx_IngresarDatos;
            #endregion
            #region Librerias
            MiGraf.Idioma(Cultura);
            base.renombrar();

            #endregion

            //Recorrer cada UserControl1 y Renombrar
            int contador = 0;
            foreach (UserControl1 UC in TodosMisUC)
            {
                UC.RenombrarTodo();
                contador += 1;
            }
            for (int i = 0; i <= TodosMisUC.Count; i++)
            {
                contador++;
            }

            //Renombrar Form2.
        }
コード例 #30
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                UC.f = this;
                UC.start("https://twitter.com/");
                if (!File.Exists(Application.StartupPath + "\\context.xml"))
                {
                    setForm sf = new setForm(this);
                    sf.ShowDialog();
                }
                else
                {
                    xmlload(Application.StartupPath + "\\context.xml");
                }

                Thread runkiritan = new Thread(Runkiritan);
                runkiritan.Start();
                TCPage1.Parent      = null;
                kiritanimg.SizeMode = PictureBoxSizeMode.StretchImage;
                //twitterData();
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
コード例 #31
0
        public static string GetColumnNamesCommaSeperated(List <Column> columns)
        {
            List <string> columnNames = columns.Select(c => c.Name).ToList();

            return(UC.ListToString(columnNames, ", "));
        }
コード例 #32
0
        public ToolsAndEffectsMenu()
        {
            InitializeComponent();

            // ResizeButton
            ResizeButton.PreviewMouseLeftButtonDown += delegate
            {
                PreviewMouseButtonDownAnim(ResizeButtonBrush);
            };
            ResizeButton.MouseEnter += delegate
            {
                ButtonMouseOverAnim(ResizeText);
                ButtonMouseOverAnim(ResizeFill);
                AnimationHelper.MouseEnterBgTexColor(ResizeButtonBrush);
            };
            ResizeButton.MouseLeave += delegate
            {
                ButtonMouseLeaveAnim(ResizeText);
                ButtonMouseLeaveAnim(ResizeFill);
                AnimationHelper.MouseLeaveBgTexColor(ResizeButtonBrush);
            };
            ResizeButton.Click += delegate
            {
                UC.Close_UserControls();
                LoadWindows.ResizeAndOptimizeWindow();
                Batch_Resize.UpdateValues();
            };

            // EffectsButton
            EffectsButton.PreviewMouseLeftButtonDown += delegate
            {
                PreviewMouseButtonDownAnim(EffectsButtonBrush);
            };
            EffectsButton.MouseEnter += delegate
            {
                ButtonMouseOverAnim(EffectsText);
                ButtonMouseOverAnim(EffectsFill);
                AnimationHelper.MouseEnterBgTexColor(EffectsButtonBrush);
            };
            EffectsButton.MouseLeave += delegate
            {
                ButtonMouseLeaveAnim(EffectsText);
                ButtonMouseLeaveAnim(EffectsFill);
                AnimationHelper.MouseLeaveBgTexColor(EffectsButtonBrush);
            };
            EffectsButton.Click += delegate
            {
                UC.Close_UserControls();
                LoadWindows.EffectsWindow();
            };

            // CropButton
            CropButton.PreviewMouseLeftButtonDown += delegate
            {
                PreviewMouseButtonDownAnim(CropButtonBrush);
            };
            CropButton.MouseEnter += delegate
            {
                ButtonMouseOverAnim(CropText);
                ButtonMouseOverAnim(CropFill);
                AnimationHelper.MouseEnterBgTexColor(CropButtonBrush);
            };
            CropButton.MouseLeave += delegate
            {
                ButtonMouseLeaveAnim(CropText);
                ButtonMouseLeaveAnim(CropFill);
                AnimationHelper.MouseLeaveBgTexColor(CropButtonBrush);
            };
            CropButton.Click += delegate
            {
                UC.Close_UserControls();
                CropFunctions.StartCrop();
            };

            // ColorPickerButton
            ColorPickerButton.PreviewMouseLeftButtonDown += delegate
            {
                PreviewMouseButtonDownAnim(ColorPickerBrush);
            };
            ColorPickerButton.MouseEnter += delegate
            {
                ButtonMouseOverAnim(ColorPickerText);
                ButtonMouseOverAnim(ColorPickerFill);
                AnimationHelper.MouseEnterBgTexColor(ColorPickerBrush);
            };
            ColorPickerButton.MouseLeave += delegate
            {
                ButtonMouseLeaveAnim(ColorPickerText);
                ButtonMouseLeaveAnim(ColorPickerFill);
                AnimationHelper.MouseLeaveBgTexColor(ColorPickerBrush);
            };
            ColorPickerButton.Click += delegate
            {
                UC.Close_UserControls();
                Color_Picking.IsRunning = true;
                Color_Picking.Start();
            };

            // ImageInfoButton
            ImageInfoButton.PreviewMouseLeftButtonDown += delegate
            {
                PreviewMouseButtonDownAnim(ImageInfoBrush);
            };
            ImageInfoButton.MouseEnter += delegate
            {
                ButtonMouseOverAnim(ImageInfoText);
                ButtonMouseOverAnim(ImageInfoFill);
                AnimationHelper.MouseEnterBgTexColor(ImageInfoBrush);
            };
            ImageInfoButton.MouseLeave += delegate
            {
                ButtonMouseLeaveAnim(ImageInfoText);
                ButtonMouseLeaveAnim(ImageInfoFill);
                AnimationHelper.MouseLeaveBgTexColor(ImageInfoBrush);
            };
            ImageInfoButton.Click += delegate
            {
                UC.Close_UserControls();
                LoadWindows.ImageInfoWindow();
            };
        }
コード例 #33
0
 private void trvContacts_SelectedContact(object sender, UC.SelectedContactEventArgs e)
 {
     PrepareChat(e.Connection, e.Contact);
 }
コード例 #34
0
 private void trvContacts_SetStatus(object sender, UC.SetStatusEventArgs e)
 {
     SetUserStatus(e.Connection, e.Status, null);
 }