Exemplo n.º 1
0
 void Start()
 {
     // Connect client and start up read thread
     StartClient();
     clientLoader = gameObject.GetComponent<ClientLoader>();
     Send("{\"msgtype\": \"_register\", \"appname\":  \""+appname+"\"}");
 }
Exemplo n.º 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // first option is to use newly created class (ClientGroup) and method + XAML
            // this.DataContext = ClientLoader.LoadClientGroups();

            // second option: if we don`t have ClientGroup class
            // we can use LINQ to group items as below. We also don`t need to use
            //ItemsPath in XAML of our CollectionViewSource + adjsut HeaderTemplate

            ObservableCollection <Client> clients = ClientLoader.LoadClients();

            this.DataContext = clients.OrderBy(f => f.Name).GroupBy(f => f.Name[0]); // we are ordering by name and grouping by the first character of the name
                                                                                     // LINQ will create IGrouping object

            //************* The ICollectionViewGroup *************
            // to understand to what kind of properties we are binding to from XAML
            // public interface ICollectionView : IObservable<object>, IList<object>, IEnumerable<object>
            // {
            //     ....
            //     IObservableVector<object> CollectionGroups { get; }
            // }

            //public interface ICollectionViewGroup
            //{
            //     object Group { get; }
            //     IObservableVector<object> GroupItems { get; }
            //}
        }
Exemplo n.º 3
0
        void Caller()
        {
            IClientBuilder builder = new ClientLoader();
            CompanyModel   company = new OurCompany(builder);

            Client client = company.LoadClient();
        }
Exemplo n.º 4
0
        protected override async Task OnAfterRenderAsync(bool aFirstRender)
        {
            //await ReduxDevToolsInterop.InitAsync();
            await JsonRequestHandler.InitAsync();

            await ClientLoader.InitAsync();
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClientLoader.DataBind();

            pp_src.Text        = ui.Text("url");
            pp_title.Text      = ui.Text("name");
            pp_dimensions.Text = ui.Text("dimensions");

            pane_src.Style.Add("height", "105px");

            lt_heightLabel.Text = ui.Text("height");
            lt_widthLabel.Text  = ui.Text("width");

            Title = ui.Text("insertimage");

            // Put user code to initialize the page here
            var tp = tv_options.NewTabPage(ui.Text("choose"));

            tp.HasMenu = false;
            tp.Controls.Add(pane_select);

            var tp2 = tv_options.NewTabPage(ui.Text("create") + " " + ui.Text("new"));

            tp2.HasMenu = false;
            tp2.Controls.Add(pane_upload);
        }
Exemplo n.º 6
0
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            services.Configure <IISOptions>(iis =>
            {
                iis.AuthenticationDisplayName = "Windows";
                iis.AutomaticAuthentication   = false;
            });

            services.AddIdentityServer(options =>
            {
                options.Events.RaiseSuccessEvents = true;
                options.Events.RaiseFailureEvents = true;
                options.Events.RaiseErrorEvents   = true;
            })
            .AddInMemoryClients(ClientLoader.LoadClient(_config))
            .AddInMemoryIdentityResources(ResourceLoader.LoadIdentityResources(_config))
            .AddInMemoryApiResources(ResourceLoader.LoadApiResources(_config))
            .AddDeveloperSigningCredential(persistKey: true)
            .AddSecretParser <ClientAssertionSecretParser>()
            .AddSecretValidator <PrivateKeyJwtSecretValidator>()
            .AddAppAuthRedirectUriValidator()
            .AddTestUsers(TestUsers.Users);

            return(services.BuildServiceProvider(validateScopes: true));
        }
Exemplo n.º 7
0
        protected override async Task OnAfterRenderAsync(bool aFirstRender)
        {
#if ReduxDevToolsEnabled
            await ReduxDevToolsInterop.InitAsync().ConfigureAwait(false);
#endif
            await JsonRequestHandler.InitAsync().ConfigureAwait(false);

            await ClientLoader.LoadClient().ConfigureAwait(false);
        }
Exemplo n.º 8
0
        // GET: Orders/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.Staff    = StaffLoader.GetAll();
            ViewBag.Gifts    = GiftsLoader.GetGifts();
            ViewBag.Brunches = BrunchLoader.GetBrunches();
            ViewBag.Clients  = ClientLoader.GetAll();

            return(View());
        }
Exemplo n.º 9
0
 public ActionResult Delete(int id)
 {
     try
     {
         ClientLoader.Delete(id);
         TempData["SuccessMessage"] = "Created Successfully";
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 10
0
 public ActionResult Create(ClientDto client)
 {
     try
     {
         ClientLoader.Save(client);
         TempData["SuccessMessage"] = "Created Successfully";
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 11
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            ClientLoader.DataBind();

            // validate redirect url
            string redirUrl = Request["redir"];

            if (!String.IsNullOrEmpty(redirUrl))
            {
                validateRedirectUrl(redirUrl);
            }
        }
Exemplo n.º 12
0
        // GET: Orders
        public ActionResult Index()
        {
            var result = OrderLoader.GetOrders();

            foreach (var item in result)
            {
                item.Client = ClientLoader.GetInsertedById((item.Client_id).GetValueOrDefault());
                item.Brunch = BrunchLoader.GetInsertedById((item.Brunch_id).GetValueOrDefault());
                item.Staff  = StaffLoader.GetInsertedById((item.Staff_id).GetValueOrDefault());
                item.Gifts  = GiftsLoader.GetInsertedById((item.Gift_id).GetValueOrDefault());
            }
            return(View(result));
        }
Exemplo n.º 13
0
        //protected uicontrols.TabView tbv = new uicontrols.TabView();

        protected void Page_Load(object sender, System.EventArgs e)
        {
            ClientLoader.DataBind();

            uicontrols.TabPage tp = tv_options.NewTabPage(ui.Text("content"));
            tp.HasMenu = false;
            tp.Controls.Add(pane_content);



            uicontrols.TabPage tp2 = tv_options.NewTabPage(ui.Text("media"));
            tp2.HasMenu = false;
            tp2.Controls.Add(pane_media);
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            ClientLoader.DataBind();

            uicontrols.TabPage tp = tv_options.NewTabPage(ui.Text("content"));
            tp.HasMenu = false;
            tp.Controls.Add(pane_content);


            if (CurrentUser.GetApplications().Find(t => t.alias == "media") != null)
            {
                uicontrols.TabPage tp2 = tv_options.NewTabPage(ui.Text("media"));
                tp2.HasMenu = false;
                tp2.Controls.Add(pane_media);
            }
            else
            {
                pane_media.Visible = false;
            }
        }
Exemplo n.º 15
0
        protected override async Task OnAfterRenderAsync(bool aFirstRender)
        {
#if ReduxDevToolsEnabled
            await ReduxDevToolsInterop.InitAsync();
#endif
            await JsonRequestHandler.InitAsync();

            await ClientLoader.InitAsync();

            var tasks = new Task[]
            {
                Mediator.Send(new FetchWalletAction()),
                Mediator.Send(new FetchSchemasAction()),
                Mediator.Send(new FetchCredentialDefinitionsAction()),
                Mediator.Send(new FetchConnectionsAction()),
                Mediator.Send(new FetchCredentialsAction()),
                Mediator.Send(new FetchProofsAction())
            };

            await Task.WhenAll(tasks);
        }
Exemplo n.º 16
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            ClientLoader.DataBind();

            pp_src.Text        = ui.Text("url");
            pp_title.Text      = ui.Text("name");
            pp_dimensions.Text = ui.Text("dimensions");

            pane_src.Style.Add("height", "105px");

            lt_heightLabel.Text = ui.Text("height");
            lt_widthLabel.Text  = ui.Text("width");

            Title = ui.Text("insertimage");

            // Put user code to initialize the page here
            uicontrols.TabPage tp = tv_options.NewTabPage(ui.Text("choose"));
            tp.HasMenu = false;
            tp.Controls.Add(pane_select);

            uicontrols.TabPage tp2 = tv_options.NewTabPage(ui.Text("create") + " " + ui.Text("new"));
            tp2.HasMenu = false;
            tp2.Controls.Add(pane_upload);

            if (IsTriphulcasCall)
            {
                Page.ClientScript.RegisterClientScriptBlock(
                    Page.GetType(),
                    "TriphulcasCustomCode",
                    @"jQuery('document').ready(function(){
                        jQuery('#advimage').css('display','block');
                        jQuery('#SubmitControls').css('display','none');
                    });",
                    true);
            }
        }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClientLoader.DataBind();

            _scriptOnLoad = "";

            string reqMacroID    = UmbracoContext.Current.Request["umb_macroID"];
            string reqMacroAlias = UmbracoContext.Current.Request["umb_macroAlias"];
            bool   ignoreForm    = string.IsNullOrEmpty(UmbracoContext.Current.Request["class"]);

            pane_insert.Text = ui.Text("insertMacro");
            Page.Title       = ui.Text("insertMacro");

            if (!String.IsNullOrEmpty(reqMacroID) || !String.IsNullOrEmpty(reqMacroAlias))
            {
                pane_edit.Visible      = true;
                pane_insert.Visible    = false;
                edit_buttons.Visible   = true;
                insert_buttons.Visible = false;

                // Put user code to initialize the page here
                if (!string.IsNullOrEmpty(reqMacroID))
                {
                    m = new Macro(int.Parse(reqMacroID));
                }
                else
                {
                    m = new Macro(reqMacroAlias);
                }

                pane_edit.Text = ui.Text("edit") + " " + m.Name;
                Page.Title     = ui.Text("edit") + " " + m.Name;

                String macroAssembly = "";
                String macroType     = "";

                if (m.Properties.Length == 0)
                {
                    if (ignoreForm)
                    {
                        renderMacro_Click(null, EventArgs.Empty);
                    }
                    else
                    {
                        Literal fb = new Literal();
                        fb.Text = "<p>" + ui.Text("macroDoesNotHaveProperties") + "</p><p><a href='#' onClick='tinyMCEPopup.close();'>" + ui.Text("closeThisWindow") + "</a>";
                        macroProperties.Controls.Add(fb);
                        edit_buttons.Visible = false;
                    }
                }
                else
                {
                    foreach (MacroProperty mp in m.Properties)
                    {
                        macroAssembly = mp.Type.Assembly;
                        macroType     = mp.Type.Type;
                        try
                        {
                            Assembly assembly = Assembly.LoadFrom(IOHelper.MapPath(SystemDirectories.Bin + "/" + macroAssembly + ".dll"));

                            Type type = assembly.GetType(macroAssembly + "." + macroType);
                            IMacroGuiRendering typeInstance = Activator.CreateInstance(type) as IMacroGuiRendering;
                            if (typeInstance != null)
                            {
                                Control control = Activator.CreateInstance(type) as Control;
                                control.ID = mp.Alias;

                                if (!IsPostBack)
                                {
                                    string propertyValue = Request["umb_" + mp.Alias];
                                    if (propertyValue != null)
                                    {
                                        // replace linebreaks and quotes
                                        propertyValue =
                                            propertyValue.Replace("\\r", "\r").Replace("\\n", "\n").Replace("\\\"", "\"");

                                        // check encoding
                                        propertyValue = HttpUtility.UrlDecode(propertyValue);

                                        if (propertyValue != "")
                                        {
                                            type.GetProperty("Value").SetValue(control,
                                                                               Convert.ChangeType(
                                                                                   propertyValue,
                                                                                   type.GetProperty("Value").PropertyType),
                                                                               null);
                                        }
                                    }
                                }


                                uicontrols.PropertyPanel pp = new global::umbraco.uicontrols.PropertyPanel();
                                pp.Text = mp.Name;
                                pp.Controls.Add(control);
                                _scriptOnLoad += "\t\tregisterAlias('" + control.ID + "');\n";
//                                pp.Controls.Add(new LiteralControl("<script type=\"text/javascript\"></script>\n"));
                                macroProperties.Controls.Add(pp);

                                _dataFields.Add(control);

                                //macroProperties.Controls.Add(new LiteralControl("</td></tr>"));
                            }
                            else
                            {
                                Trace.Warn("umbEditContent",
                                           "Type doesn't exist or is not umbraco.interfaces.DataFieldI ('" + macroAssembly +
                                           "." + macroType + "')");
                            }
                        }
                        catch (Exception fieldException)
                        {
                            Trace.Warn("umbEditContent", "Error creating type '" + macroAssembly + "." + macroType + "'",
                                       fieldException);
                        }
                    }
                }
            }
            else
            {
                IRecordsReader macroRenderings;
                if (UmbracoContext.Current.Request["editor"] != "")
                {
                    macroRenderings = SqlHelper.ExecuteReader("select macroAlias, macroName from cmsMacro where macroUseInEditor = 1 order by macroName");
                }
                else
                {
                    macroRenderings = SqlHelper.ExecuteReader("select macroAlias, macroName from cmsMacro order by macroName");
                }

                umb_macroAlias.DataSource     = macroRenderings;
                umb_macroAlias.DataValueField = "macroAlias";
                umb_macroAlias.DataTextField  = "macroName";
                umb_macroAlias.DataBind();
                macroRenderings.Close();
            }
        }
Exemplo n.º 18
0
        // GET: Client/Details/5
        public ActionResult Details(int id)
        {
            var result = ClientLoader.GetById(id);

            return(View(result));
        }
Exemplo n.º 19
0
        // GET: Client
        public ActionResult Index()
        {
            var result = ClientLoader.GetAll();

            return(View(result));
        }
Exemplo n.º 20
0
        protected override async Task OnAfterRenderAsync(bool aFirstRender)
        {
            await JsonRequestHandler.InitAsync().ConfigureAwait(false);

            await ClientLoader.LoadClient().ConfigureAwait(false);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     ClientLoader.DataBind();
     FireOnLoad(e);
 }
Exemplo n.º 22
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     ClientLoader.DataBind();
 }
Exemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ClientLoader.DataBind();
     ScriptManager.RegisterStartupScript(Page, Page.GetType(), "setRoot", "UmbClientMgr.setUmbracoPath(\"" + IO.IOHelper.ResolveUrl(IO.SystemDirectories.Umbraco) + "\");", true);
     FireOnLoad(e);
 }
Exemplo n.º 24
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     this.DataContext = ClientLoader.LoadClients();
 }