Inheritance: MonoBehaviour
示例#1
0
        public static async void dbInsert(options houseDetails)
        {
            SQLiteAsyncConnection db = new SQLiteAsyncConnection(fullPath);
            await db.InsertAsync(houseDetails);

            //db.Close();
        }
示例#2
0
    void OnGUI()
    {
        GUILayout.Label("                                  Creador de luces", EditorStyles.boldLabel);
        GUI.DrawTexture(GUILayoutUtility.GetRect(50, 120), (Texture2D)Resources.Load("foco"));
        name            = EditorGUILayout.TextField("Name", name);
        op              = (options)EditorGUILayout.EnumPopup("Light Type", op);
        bounceintensity = EditorGUILayout.FloatField("Bounce Intencity", bounceintensity);
        spot            = EditorGUILayout.FloatField("Spot Angle", spot);
        intensity       = EditorGUILayout.FloatField("Intensidad", intensity);
        color           = EditorGUILayout.ColorField("color", color);
        Rect rectOpenNew = EditorGUILayout.BeginHorizontal("Button");

        if (GUI.Button(rectOpenNew, GUIContent.none))
        {
            lc                 = ScriptableObjectUtility.CreateAssetAndReturn <LightsConfig>();
            lc.name            = name;
            lc.bounceIntencity = bounceintensity;
            lc.spotValor       = spot;
            lc.intensity       = intensity;
            lc.color           = color;
            instantiateop(op);
            lc.type = luz;
            GameObject light = new GameObject(name);
            light.AddComponent <Light>();
            light.GetComponent <Light>().bounceIntensity = bounceintensity;
            light.GetComponent <Light>().spotAngle       = spot;
            light.GetComponent <Light>().intensity       = intensity;
            light.GetComponent <Light>().color           = color;
            light.GetComponent <Light>().type            = luz;
        }

        GUILayout.Label("create light");
        EditorGUILayout.EndHorizontal();
    }
示例#3
0
 await VerifyFixAsync(
     result.Text,
     expected,
     additionalData,
     equivalenceKey,
     options,
     cancellationToken).ConfigureAwait(false);
示例#4
0
        static void Main(string[] args)
        {
            options opt = new options();

            CommandParser.CommandDescription = "List Command line variables";
            CommandParser.Parse(opt, args);
            int cnt = 0;

            var envvars = Environment.GetEnvironmentVariables();

            foreach (DictionaryEntry env in envvars)
            {
                string key = env.Key.ToString();
                if (!string.IsNullOrEmpty(opt.filter))
                {
                    if (!key.ToLower().Contains(opt.filter.ToLower()))
                    {
                        continue;
                    }
                }
                Console.WriteLine("%{0}%\r\n\t{1}", env.Key, env.Value);
                Console.WriteLine();
                ++cnt;
            }
            Console.WriteLine("Total: {0}, Filter: {1}", cnt, opt.filter);
            Kernel.DebugWait();
        }
示例#5
0
        public static string compile(string source, options options = null)
        {
            var script   = "external.Set('result', CoffeeScript.compile(external.Get('source'), options));";
            var moptions = rxDetectOptions.Match(source);

            if (moptions.Success)
            {
                script = "var options = { " + moptions.Groups[1].Value + "}; " + script;
                source = source.Remove(moptions.Index, moptions.Length);
            }
            else if (options != null)
            {
                script = string.Format("var options = {{ 'bare': {0} }}; ", options.bare.ToString().ToLower()) + script;
            }
            else
            {
                script = "var options = undefined; " + script;
            }

            var js = JavaScript.Execute(script,
                                        new Dictionary <string, object> {
                { "source", source }
            },
                                        new JavaScript.Requirement {
                Path = "http://jashkenas.github.com/coffee-script/extras/coffee-script.js"
            });

            return(js.Get("result") as string);
        }
示例#6
0
        public ActionResult <string> operation(string type,
                                               string operation = "report",
                                               string format    = "json",
                                               bool paginate    = false,
                                               uint page        = 0,
                                               uint page_length = 10,
                                               bool reload      = false)
        {
            if (reload)
            {
                Program.catalog = Program.catalog.reload();
            }
            options options = new options();

            options.type        = type;
            options.format      = format;
            options.operation   = operation;
            options.paginate    = true;
            options.page        = page;
            options.page_length = page_length;
            options.paginate    = paginate;
            options.build       = false;
            options.debug       = Program.catalog.debug;
            if (options.debug)
            {
                options.verbosity++;
            }
            Task <object> output = Program.catalog.perform_operation(options);

            return((string)output.Result);
        }
示例#7
0
        public async Task <object> operation_POST(operation_json request)
        {
            if (request.reload)
            {
                Program.catalog = Program.catalog.reload();
            }
            options options = new options();

            options.uid          = request.uid;
            options.multi_search = request.multi_search;
            options.format       = request.format;
            options.operation    = "report";
            options.paginate     = true;
            options.page         = request.page;
            options.page_length  = request.page_length;
            options.paginate     = request.paginate;
            options.build        = false;
            options.debug        = Program.catalog.debug;
            options.sort         = request.sort;
            //options.filter       =request.filter;
            if (options.debug)
            {
                options.verbosity++;
            }
            object output = await Program.catalog.perform_operation(options, true);

            return(output);
        }
示例#8
0
        public static string js_beautify(string code, options options = null)
        {
            var data = new Dictionary <string, object> {
                { "code", code },
                { "options", options },
            };
            var optionCode = "";
            var moptions   = rxDetectOptions.Match(code);

            if (moptions.Success)
            {
                optionCode = moptions.Groups[1].Value;
                code       = code.Remove(moptions.Index, moptions.Length);
            }
            else if (options != null)
            {
                foreach (var prop in typeof(options).GetProperties())
                {
                    optionCode += "\r\n\t'" + prop.Name + "': options0['" + prop.Name + "'],";
                }
            }

            var js = JavaScript.Execute(@"var options0 = external.Get('options'), options1 = {
                        " + optionCode.TrimEnd(',') + @"
                    };
                    external.Set('result', js_beautify(external.Get('code'), options1));",
                                        new Dictionary <string, object> {
                { "code", code }, { "options", options }
            },
                                        new JavaScript.Requirement {
                Path = "http://jsbeautifier.org/beautify.js", PostSource = "window.js_beautify = js_beautify;"
            });

            return(js.Get("result") as string);
        }
示例#9
0
        private void btnOpenFolder_Click(object sender, EventArgs e)
        {
            DialogSelectComp selcomp = new DialogSelectComp(this);

            if (selcomp.ShowDialog() != DialogResult.OK)
            {
                if (this.selected_comp == null)
                {
                    Application.Exit();
                }
                return;
            }

            this.selected_comp = selcomp.selected_comp;
            this.glacc_list    = DbfTable.GetGlaccList(this.selected_comp);

            if (this.selected_comp != null)
            {
                SQLiteDbPrepare.EnsureDbCreated(this.selected_comp);
                options opt = HelperClass.GetOptions(OPTIONS.EFILING_TMP_DIR, this.selected_comp);
                if (opt.value_str != null && opt.value_str.Trim().Length > 0 && File.Exists(opt.value_str.Trim()))
                {
                    this.cZipFilePath.Text = opt.value_str.Trim();
                }
                else
                {
                    this.cZipFilePath.Text = string.Empty;
                }
            }

            this.FillForm();
        }
        /* this is to choose the option starting from global site options with user consideration */

        /// <summary> </summary>
        public static String get_option(String name)
        {
            String  result = "";
            options sdata  = ActiveRecordBase <options> .FindOne(
                new List <AbstractCriterion>() {
                Expression.Eq("site", siteService.getCurrentSite()),
                Expression.Eq("option_key", name)
            }.ToArray()
                );

            if (sdata != null)
            {
                result = sdata.value;
            }

            if (sdata != null && sdata.is_overwritable)
            {
                user_meta_data udata = ActiveRecordBase <user_meta_data> .FindOne(
                    new List <AbstractCriterion>() {
                    Expression.Eq("_user", userService.getUserFull()),
                    Expression.Eq("meta_key", name)
                }.ToArray()
                    );

                if (udata != null)
                {
                    result = udata.value;
                }
            }
            return(result);
        }
示例#11
0
文件: JsHint.cs 项目: cbilson/chirpy
        public static result[] JSHINT(string source, options options = null)
        {
            var data = new Dictionary<string, object> {
                {"source", source},
                {"options", options},
            };
            var optionCode = "";
            if (options != null) {
                foreach (var prop in typeof(options).GetProperties()) {
                    optionCode += "\r\n\t'" + prop.Name + "': options0['" + prop.Name + "'],";
                }
            }
            var ie = new JSHint(@"
                    var options0 = external.Get('options'), options1 = {
                        " + optionCode.TrimEnd(',') + @"
                    }, result = JSHINT(external.Get('source'), options1),
                       errors = JSHINT.errors;
                    external.Set('result', result);
                    external.Set('errors', errors.length);
                    if (!result) {
                        for (var i = 0; i < errors.length; i++) {
                            external.AddResult(errors[i].line || 0, errors[i].character || 0, errors[i].reason || '', errors[i].evidence || '', errors[i].raw || '');
                        }
                    }
                ", data);
            ie.Execute();
            var result = ie.Get("result") as bool?;

            if (result ?? ie._Results.Count == 0) return null;
            return ie._Results.ToArray();
        }
示例#12
0
        private void opcao(options enmOptions)
        {
            Diario d = new Diario();
            DiarioDAL dd = new DiarioDAL();

            d.Diary = txtDiario.Text;
            d.Data = txtBusca.Text;

            switch (enmOptions)
            {
                case options.Insert:
                    if (!dd.Editar(d))
                    {
                        dd.Salvar(d);
                        lblRetorno.Text = "Salvo com sucesso";
                    }
                    else
                    {
                        dd.Editar(d);
                        lblRetorno.Text = "Alterado com sucesso";
                    }
                    break;
                case options.Search:
                    txtDiario.Text = dd.Buscar(d);
                    break;
                default:
                    lblRetorno.Text = "Ocorreu um erro no sistema!!!";
                    break;
            }
        }
示例#13
0
        public static string js_beautify(string code, options options = null)
        {
            var data = new Dictionary<string, object> {
                {"code", code},
                {"options", options},
            };
            var optionCode = "";
            var moptions = rxDetectOptions.Match(code);
            if (moptions.Success) {
                optionCode = moptions.Groups[1].Value;
                code = code.Remove(moptions.Index, moptions.Length);

            } else if (options != null) {
                foreach (var prop in typeof(options).GetProperties()) {
                    optionCode += "\r\n\t'" + prop.Name + "': options0['" + prop.Name + "'],";
                }
            }

            var js = JavaScript.Execute(@"var options0 = external.Get('options'), options1 = {
                        " + optionCode.TrimEnd(',') + @"
                    };
                    external.Set('result', js_beautify(external.Get('code'), options1));",
                new Dictionary<string, object> { { "code", code }, { "options", options } },
                new JavaScript.Requirement { Path = "http://jsbeautifier.org/beautify.js", PostSource = "window.js_beautify = js_beautify;" });

            return js.Get("result") as string;
        }
示例#14
0
        public HttpResponseMessage PostPoll(JObject EmpData)
        {
            if (EmpData == null)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            try
            {
                dynamic json    = EmpData;
                poll    new_pol = new poll();
                new_pol.poll_description = json.poll_description;
                db.poll.Add(new_pol);
                db.SaveChanges();

                List <options> listStatus = new List <options>();
                foreach (var item in json.options)
                {
                    options statusNew = new options();
                    statusNew.option_description = item;
                    statusNew.poll_id            = new_pol.poll_id;
                    listStatus.Add(statusNew);
                }
                db.option.AddRange(listStatus);
                db.SaveChanges();
                return(Request.CreateResponse(HttpStatusCode.OK, new { poll_id = new_pol.poll_id }));
            }
            catch
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Falha ao incluir"));
            }
        }
示例#15
0
        public HttpResponseMessage PutVoteOption(int id, options option)
        {
            if (id <= 0)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, "O id informado na URL deve ser maior que zero."));
            }

            if (id != option.option_id)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, "O id informado na URL deve ser igual ao id informado no corpo da requisição."));
            }
            try
            {
                if (db.option.Count(e => e.option_id == id) == 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound));
                }

                var result = db.option.Find(option.option_id);
                result.qty            += 1;
                db.Entry(result).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();

                return(Request.CreateResponse(HttpStatusCode.OK, new { total_votes = result.qty }));
            }
            catch
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
        }
示例#16
0
        public void Test()
        {
            try
            {
                List <Record> rowList = new List <Record>();

                user_field userfield = new user_field {
                    name = "email", value = "*****@*****.**"
                };
                List <user_field> user_fields = new List <user_field>();
                user_fields.Add(userfield);

                rowList.Add(new Record(user_fields, city: "corona", stateprovince: "NY"));

                List <user_field> user_fieldsample = new List <user_field>();
                rowList.Add(new Record(null, city: "Los Angeles", stateprovince: "California"));
                options op = new options();

                input input = new input();
                input.RecordList = rowList;

                GetPostalCodesAPIRequest  request  = new GetPostalCodesAPIRequest(input, op);
                GetPostalCodesAPIResponse response = identifyAddressService.GetPostalCodes(request);

                Assert.IsInstanceOfType(response, typeof(GetPostalCodesAPIResponse));
                string output = Utility.ObjectToJson <GetPostalCodesAPIResponse>(response);
                Debug.WriteLine(output);
            }
            catch (Exception e)
            {
                Assert.Fail("Unexpected Exception");
            }
        }
示例#17
0
        public static options GetOptions(this OPTIONS options_key, SccompDbf selected_comp)
        {
            try
            {
                using (LocalDbEntities db = DBX.DataSet(selected_comp))
                {
                    options opt = db.options.Where(o => o.key == options_key.ToString()).FirstOrDefault();

                    if (opt != null)
                    {
                        return(opt);
                    }
                    else
                    {
                        options o = new options {
                            key = options_key.ToString()
                        };
                        db.options.Add(o);
                        db.SaveChanges();
                        return(o);
                    }
                }
            }
            catch (Exception ex)
            {
                XMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, XMessageBoxIcon.Error);
                return(null);
            }
        }
示例#18
0
        public void Test()
        {
            try
            {
                List <Address> rowList = new List <Address>();

                user_field userfield = new user_field {
                    name = "email", value = "*****@*****.**"
                };
                List <user_field> user_fields = new List <user_field>();
                user_fields.Add(userfield);

                rowList.Add(new Address(user_fields, addressline1: "101 cherry st"));

                List <user_field> user_fieldsample = new List <user_field>();
                rowList.Add(new Address(null, addressline1: "12 yonge st", country: "ca", stateorprovince: "on"));
                options op = new options();

                input input = new input();
                input.AddressList = rowList;

                ValidateMailingAddressUSCANAPIRequest  request  = new ValidateMailingAddressUSCANAPIRequest(input, op);
                ValidateMailingAddressUSCANAPIResponse response = identifyAddressService.ValidateMailingAddressUSCAN(request);

                Assert.IsInstanceOfType(response, typeof(ValidateMailingAddressUSCANAPIResponse));
                string output = Utility.ObjectToJson <ValidateMailingAddressUSCANAPIResponse>(response);
                Debug.WriteLine(output);
            }
            catch (Exception e)
            {
                Assert.Fail("Unexpected Exception");
            }
        }
示例#19
0
        public static int SaveOptions(this options options_to_save, SccompDbf selected_comp)
        {
            try
            {
                using (LocalDbEntities db = DBX.DataSet(selected_comp))
                {
                    options option = db.options.Where(o => o.key == options_to_save.key).FirstOrDefault();
                    if (option != null) // update
                    {
                        option.value_datetime = options_to_save.value_datetime;
                        option.value_num      = options_to_save.value_num;
                        option.value_str      = options_to_save.value_str;

                        return(db.SaveChanges());
                    }
                    else // add new
                    {
                        db.options.Add(options_to_save);
                        return(db.SaveChanges());
                    }
                }
            }
            catch (Exception ex)
            {
                XMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, XMessageBoxIcon.Error);
                return(0);
            }
        }
示例#20
0
 private RenderFragment BuildSVG_hourShadow(options opt)
 => builder =>
 {
     //radius,value,klasa,transform
     // Console.WriteLine($"opt.value  {opt.value}");
     if (opt.value > 0)
     {
         var x = Math.Cos((2 * Math.PI) / (100 / opt.value));
         var y = Math.Sin((2 * Math.PI) / (100 / opt.value));
         //should the arc go the long way round?
         var longArc = (opt.value <= 50) ? 0 : 1;
         //d is a string that describes the path of the slice.
         var d = "M" + opt.radius + "," + opt.radius + " L" + opt.radius + "," + 0 + " A" + opt.radius + "," + opt.radius + " 0 " + longArc + ",1 " + (int)Math.Round(opt.radius + (y * opt.radius), 0) + "," + (int)Math.Round(opt.radius - (x * opt.radius), 0) + " z";
         //  Console.WriteLine($"d: {d}");
         var m = new metrics
         {
             Name   = "hourhandShadow",
             klasa  = opt.klasa,
             number = 1
         };
         builder.OpenElement(0, "path");
         builder.AddAttribute(1, "id", "hourhandShadow");
         builder.AddAttribute(2, "d", d);
         builder.AddAttribute(3, "class", opt.klasa);
         builder.AddAttribute(4, "transform", opt.transform);
         builder.AddAttribute(5, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create <MouseEventArgs>(this, (MouseEventArgs e) => IncrementBuilder(e, m)));
         builder.CloseElement();
     }
 };
示例#21
0
        public void Run()
        {
            Random r            = new Random();
            Font   font18       = new Font("data/Joystix.ttf", 18);
            Image  image        = new Image("data/welcome3.png");
            Image  player1      = new Image("data/personaje.png");
            Image  player2      = new Image("data/personaje2.png");
            Image  welcomeText1 = Hardware.CreateImageFromText("Press P to Play",
                                                               0xCC, 0xCC, 0xCC,
                                                               font18);
            Image welcomeText2 = Hardware.CreateImageFromText("Press Q to Quit",
                                                              0xCC, 0xCC, 0xCC,
                                                              font18);
            Image welcomeText3 = Hardware.CreateImageFromText("Press C to Credits",
                                                              0xCC, 0xCC, 0xCC,
                                                              font18);

            Balls[] balls = new Balls[2];
            balls[0] = new Balls(g, r.Next(0, 902), r.Next(0, 680), 0);
            balls[1] = new Balls(g, r.Next(0, 902), r.Next(0, 680), 1);

            bool validOptionChosen = false;

            do
            {
                Hardware.ClearScreen();
                Hardware.DrawHiddenImage(image, 0, 0);
                balls[0].Move();
                balls[0].DrawOnHiddenScreen();
                balls[1].Move();
                balls[1].DrawOnHiddenScreen();
                Hardware.DrawHiddenImage(player1, 50, 530);
                Hardware.DrawHiddenImage(player2, 730, 530);
                Hardware.DrawHiddenImage(welcomeText1, 410, 550);
                Hardware.DrawHiddenImage(welcomeText2, 410, 600);
                Hardware.DrawHiddenImage(welcomeText3, 410, 650);
                Hardware.ShowHiddenScreen();

                if (Hardware.KeyPressed(Hardware.KEY_P) ||
                    Hardware.KeyPressed(Hardware.KEY_SPC))
                {
                    validOptionChosen = true;
                    optionChosen      = options.Play;
                }
                if (Hardware.KeyPressed(Hardware.KEY_Q))
                {
                    validOptionChosen = true;
                    optionChosen      = options.Quit;
                }

                if (Hardware.KeyPressed(Hardware.KEY_C))
                {
                    validOptionChosen = true;
                    optionChosen      = options.Credits;
                }
                Hardware.Pause(50);
            }while (!validOptionChosen);
            balls = null;
        }
示例#22
0
        public void Run()
        {
            Font  font18 = new Font("data/Joystix.ttf", 18);
            Image player = new Image("data/Images/VAL_LEFT1.png");

            bool validOptionChosen = false;

            do
            {
                Hardware.ScrollTo(0, 0);
                //Centering scroll to the character

                Hardware.ClearScreen();
                Hardware.WriteHiddenText("P to Play, Q to Quit",
                                         40, 10,
                                         0xCC, 0xCC, 0xCC,
                                         font18);


                Hardware.WriteHiddenText(" Key:           Action:",
                                         40, 40,
                                         0xCC, 0xCC, 0xCC,
                                         font18);
                Hardware.WriteHiddenText("W or UP         Move Up",
                                         40, 60,
                                         0xCC, 0xCC, 0xCC,
                                         font18);
                Hardware.WriteHiddenText("S or Down       Move Down",
                                         40, 80,
                                         0xCC, 0xCC, 0xCC,
                                         font18);
                Hardware.WriteHiddenText("D  or Right     Move Right",
                                         40, 100,
                                         0xCC, 0xCC, 0xCC,
                                         font18);
                Hardware.WriteHiddenText("A or Left       Move Left",
                                         40, 120,
                                         0xCC, 0xCC, 0xCC,
                                         font18);
                Hardware.WriteHiddenText("Space           Shot",
                                         40, 140,
                                         0xCC, 0xCC, 0xCC,
                                         font18);
                Hardware.DrawHiddenImage(player, 512, 384);
                Hardware.ShowHiddenScreen();

                if (Hardware.KeyPressed(Hardware.KEY_P))
                {
                    validOptionChosen = true;
                    optionChosen      = options.Play;
                }
                if (Hardware.KeyPressed(Hardware.KEY_Q))
                {
                    validOptionChosen = true;
                    optionChosen      = options.Quit;
                }
                Hardware.Pause(50);
            }while (!validOptionChosen);
        }
示例#23
0
        private void UpdateSvg(DateTime date)
        {
            var hr  = date.Hour;
            var min = date.Minute;
            // Console.WriteLine($"godzina: {hr}, {min}");
            var sec       = date.Second;
            var secangle  = sec * 6;
            var minangle  = min * 6;
            var hourangle = hr * 30 + 5 * Math.Floor((double)min / 10);

            // Console.WriteLine($"tick: {hr%12}, {hr_circ_tick}");
            transform_second = "rotate(" + secangle + ",50,50)";
            transform_minute = "rotate(" + minangle + ",50,50)";
            transform_hour   = "rotate(" + hourangle + ",50,50)";
            sec_circ_offset  = sec_circumference - Math.Round(sec * sec_circ_tick, 0);
            min_circ_offset  = min_circumference - Math.Round(min * min_circ_tick, 0);
            hr_circ_offset   = hr_circumference - Math.Round(hr % 12 * hr_circ_tick, 0) - Math.Floor(hr_circ_tick * ((double)min / 60));
            var     sec_radiusMargin = 20;
            options opt_sec          = new options
            {
                radius    = SVG.promien - sec_radiusMargin,
                klasa     = "cien_seconds",
                value     = Math.Round((double)secangle / 360, 2) * 100,
                transform = $"rotate(0 {SVG.width / 2 } {SVG.width / 2}) translate({sec_radiusMargin} {sec_radiusMargin})" // translate({SVG.width / 2 - SVG.promien + 8 + 4} {SVG.width / 2 - SVG.promien + 8 + 4} )
            };

            secondhandShadow = BuildSVG_secondShadow(opt_sec);
            if (sec == 0 || running == false)
            {
                running    = true;
                minutehand = BuildSVG_minutehand(transform_minute);
                var     min_radiusMargin = 25;
                options opt_min          = new options
                {
                    radius    = SVG.promien - min_radiusMargin,
                    klasa     = "cien_minutes",
                    value     = Math.Round((double)minangle / 360, 2) * 100,
                    transform = $"rotate(0 {SVG.width / 2 } {SVG.width / 2}) translate({min_radiusMargin} {min_radiusMargin})" // translate({SVG.width / 2 - SVG.promien + 8 + 4} {SVG.width / 2 - SVG.promien + 8 + 4} )
                };
                minutehandShadow = BuildSVG_minuteShadow(opt_min);
                var     hr_radiusMargin = 30;
                options opt_hr          = new options
                {
                    radius    = SVG.promien - hr_radiusMargin,
                    klasa     = "cien_hours",
                    value     = Math.Round((30 * (hr % 12) + (double)min / 2) / 360, 2) * 100,
                    transform = $"rotate(0 {SVG.width / 2 } {SVG.width / 2}) translate({hr_radiusMargin} {hr_radiusMargin})" // translate({SVG.width / 2 - SVG.promien + 8 + 4} {SVG.width / 2 - SVG.promien + 8 + 4} )
                };
                // Console.WriteLine($"options: { opt.value}, {opt.transform}, {opt.radius}");
                hourhandShadow = BuildSVG_hourShadow(opt_hr);

                hourhand = BuildSVG_hourhand(transform_hour);
            }
            string Thours   = (hr < 10 ? "0" : "") + hr.ToString();
            string Tminutes = (min < 10 ? "0" : "") + min.ToString();
            string Tseconds = (sec < 10 ? "0" : "") + sec.ToString();

            electronicDisplayer = BuildSVG_displayer((int)Math.Floor((double)SVG.width / 6), (int)(0.35 * (double)SVG.height), Thours + ":" + Tminutes + ":" + Tseconds);
        }
示例#24
0
        private void MoveHeartDown()
        {
            options[] values = (options[])Enum.GetValues(typeof(options));

            int currentPos = Array.IndexOf(values, selectedOption);

            selectedOption = currentPos == values.Length - 1 ? values[0] : values[currentPos + 1];
        }
示例#25
0
        public static void dbDelete(options houseDetails)
        {
            var            db          = new SQLiteConnection(fullPath);
            String         deleteHouse = "DELETE FROM options WHERE listing_id = " + houseDetails.listing_id;
            List <options> allHouses   = db.Query <options>(deleteHouse);

            db.Close();
        }
示例#26
0
 void Start()
 {
     me = this;
     if (PlayerPrefs.HasKey("music"))
     {
         Read();
     }
     ResetSliders();
 }
示例#27
0
 private void Start()
 {
     hoverButton.onButtonDown.AddListener(OnButtonDown);
     moveTarget    = false;
     buttonPress   = false;
     gameMode      = options.Still;
     moveText.text = " " + ModeSelect(); // Button text initially set to "Still"
     MovePlayer(closeDistance);
 }
 public override void OnInspectorGUI()
 {
     _target.name            = EditorGUILayout.TextField("Name", _target.name);
     op                      = (options)EditorGUILayout.EnumPopup("Light Type", op);
     _target.bounceIntencity = EditorGUILayout.FloatField("Bounce Intencity", _target.bounceIntencity);
     _target.spotValor       = EditorGUILayout.FloatField("Spot Angle", _target.spotValor);
     _target.intensity       = EditorGUILayout.FloatField("Intensidad", _target.intensity);
     _target.color           = EditorGUILayout.ColorField("color", _target.color);
     instantiateop(op);
 }
示例#29
0
        public override void HandleInput()
        {
            base.HandleInput();
            if (Globals.Input.keyPressed(Keys.Up) || Globals.Input.keyPressed(Keys.W) || Globals.Input.buttonPressed(Buttons.DPadUp, PlayerIndex.One) || Globals.Input.buttonPressed(Buttons.LeftThumbstickUp, PlayerIndex.One))
            {
                do
                {
                    selection--;
                    if (selection < 0)
                    {
                        selection = (options)Entries.Count - 1;
                    }
                } while(Entries[(int)selection].Enabled == false);
            }

            if (Globals.Input.keyPressed(Keys.Down) || Globals.Input.keyPressed(Keys.S) || Globals.Input.buttonPressed(Buttons.DPadDown, PlayerIndex.One) || Globals.Input.buttonPressed(Buttons.LeftThumbstickDown, PlayerIndex.One))
            {
                do
                {
                    selection++;
                    if ((int)selection > (Entries.Count - 1))
                    {
                        selection = 0;
                    }
                } while(Entries[(int)selection].Enabled == false);
            }

            if (Game1.IsPlayersTurn() && (Globals.Input.keyPressed(Keys.Enter) || Globals.Input.buttonPressed(Buttons.A, PlayerIndex.One)))
            {
                switch (selection)
                {
                case options.ATTACK:
                    Game1.playerShip.FireShot(Game1.enemyShip);
                    Game1.recentMoves.Add("You shot the enemy");
                    enemy.setUnderAttack(watch);
                    fireEffect.Play();
                    break;

                case options.BAIL:
                    Game1.playerShip.BailWater(WATER_BAIL_AMOUNT);
                    Game1.recentMoves.Add("You bailed water");
                    bailEffect.Play();
                    break;

                case options.REPAIR:
                    Game1.playerShip.Repair(REPAIR_HOLES_AMOUNT);
                    Game1.recentMoves.Add("You fixed a hole");
                    repairEffect.Play();
                    break;
                }
                Game1.TrimRecentsList();
                Game1.setPlayersTurn(false);
            }
        }
示例#30
0
        public async Task <ActionResult <object> > config_POST(options options)
        {
            options.operation = "config";
            options.debug     = Program.catalog.debug;
            if (options.debug)
            {
                options.verbosity++;
            }
            ActionResult <object> output = await Program.catalog.perform_operation(options, true);

            return(output);
        }
示例#31
0
 options ModeSelect()
 {
     if (moveTarget)
     {
         gameMode = options.Move;
     }
     else if (!moveTarget)
     {
         gameMode = options.Still;
     }
     return(gameMode);
 }
示例#32
0
        public ActionResult AddOptions(int id)
        {
            options theUser = new options();

            ///store i in the db
            /// establish the connection
            try
            {
                /// string connectionString = "server=localhost;user id=root;database=mydb;persistsecurityinfo=True";

                string          conString = ConfigurationManager.ConnectionStrings["sbsclatest"].ConnectionString.ToString();
                MySqlConnection con       = new MySqlConnection(conString);
                /// con. connectionString = "server=localhost;user id=root;database=mydb;persistsecurityinfo=True";
                ///
                /// open the connection
                con.Open();
                ViewBag.successMessage = "connection was established";
                string       theSql  = "insert options(questionid,optA,optB,optC,optD,isAnswer)values(@questionid,@optA,@optB,@optC,@optD,@isanswer)";
                MySqlCommand command = new MySqlCommand(theSql, con);


                command.Parameters.Add("@questionid", MySqlDbType.String);
                command.Parameters["@questionid"].Value = theUser.questionid;

                command.Parameters.Add("@optA", MySqlDbType.String);
                command.Parameters["@optA"].Value = theUser.optA;

                command.Parameters.Add("@optB", MySqlDbType.String);
                command.Parameters["@optB"].Value = theUser.optB;

                command.Parameters.Add("@optC", MySqlDbType.String);
                command.Parameters["@optC"].Value = theUser.optC;

                command.Parameters.Add("@optD", MySqlDbType.String);
                command.Parameters["@optD"].Value = theUser.optD;

                command.Parameters.Add("@isactive", MySqlDbType.String);
                command.Parameters["@isactive"].Value = theUser.isAnswer;

                command.ExecuteNonQuery();
                ViewBag.success = "Registration Successful";
                con.Close();
            }

            catch (Exception e)
            {
                ViewBag.errorMessage = e.Message;
                return(View("courseListHR"));
            }
            return(View("ExamList"));
        }
示例#33
0
        public async Task <object> list_POST()
        {
            options options = new options();

            options.operation = "list";
            options.debug     = Program.catalog.debug;
            if (options.debug)
            {
                options.verbosity++;
            }
            object output = await Program.catalog.perform_operation(options, true);

            return(output);
        }
示例#34
0
        public static string compile(string source, options options = null)
        {
            var script = "external.Set('result', CoffeeScript.compile(external.Get('source'), options));";
            var moptions = rxDetectOptions.Match(source);
            if (moptions.Success) {
                script = "var options = { " + moptions.Groups[1].Value + "}; " + script;
                source = source.Remove(moptions.Index, moptions.Length);
            } else if (options != null) {
                script = string.Format("var options = {{ 'bare': {0} }}; ", options.bare.ToString().ToLower()) + script;
            } else {
                script = "var options = undefined; " + script;
            }

            var js = JavaScript.Execute(script,
                 new Dictionary<string, object> { { "source", source } },
                 new JavaScript.Requirement { Path = "http://jashkenas.github.com/coffee-script/extras/coffee-script.js" });

            return js.Get("result") as string;
        }
 return WithHammockStreamingImpl(_publicStreamsClient, request, options, action);