Esempio n. 1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (this.showStatus == null && this.Page != null)
     {
         EcpContentPage ecpContentPage = this.Page as EcpContentPage;
         if (ecpContentPage != null && ecpContentPage.FeatureSet == FeatureSet.Options)
         {
             this.showStatusDefault = false;
         }
     }
     if (!string.IsNullOrEmpty(this.DataSourceID))
     {
         WebServiceListSource webServiceListSource = this.FindControl(this.DataSourceID) as WebServiceListSource;
         if (webServiceListSource != null)
         {
             this.listSource = webServiceListSource;
             this.Commands.Add(new RefreshCommand());
         }
     }
     this.toolbar.ApplyRolesFilter();
     if (this.Commands.Count == 0 && this.Controls.Contains(this.toolbar))
     {
         this.Controls.Remove(this.toolbar);
     }
     this.UpdateColumns();
     if (this.Views.Count > 0)
     {
         ComponentBinding componentBinding = new ComponentBinding(this.viewFilterDropDown, "filterValue");
         componentBinding.Name = "SelectedView";
         this.listSource.FilterParameters.Add(componentBinding);
     }
     if (this.ShowSearchBar)
     {
         if (string.IsNullOrEmpty(this.LocalSearchViewModel))
         {
             ComponentBinding componentBinding2 = new ComponentBinding(this.searchTextBox, "filterText");
             componentBinding2.Name = "SearchText";
             this.listSource.FilterParameters.Add(componentBinding2);
         }
         else
         {
             ComponentBinding componentBinding3 = new ComponentBinding(this.searchTextBox, "advancedSearch");
             componentBinding3.Name = "SearchText";
             this.listSource.FilterParameters.Add(componentBinding3);
         }
     }
     this.ClientSort |= this.SupportAsyncGetList;
     if (this.ShowHeader && !this.ClientSort)
     {
         ComponentBinding componentBinding4 = new ComponentBinding(this, "SortDirection");
         componentBinding4.Name = "Direction";
         this.listSource.SortParameters.Add(componentBinding4);
         ComponentBinding componentBinding5 = new ComponentBinding(this, "SortProperty");
         componentBinding5.Name = "PropertyName";
         this.listSource.SortParameters.Add(componentBinding5);
     }
     this.listSource.UpdateParameters();
 }
Esempio n. 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            ComponentBinding componentBinding = new ComponentBinding(this, "showAll");

            componentBinding.Name = "ShowAll";
            base.FilterParameters.Add(componentBinding);
        }
Esempio n. 3
0
    public void ConstructAndBindViewComponent(ViewComponent vc, ModelBlock parent)
    {
        var modelPosition = new Vector3(vc.Position.x, vc.Position.y, vc.Position.z);
        var mc            = new ModelComponent(vc.componentType, modelPosition, parent);
        var binding       = new ComponentBinding(vc, mc, environmentChanged);

        componentBindings.Add(binding);
        me.AddComponent(mc);
    }
Esempio n. 4
0
        protected override void OnLoad(EventArgs e)
        {
            try
            {
                WebServiceReference webServiceReference = new WebServiceReference("~/DDI/DDIService.svc?schema=VirtualDirectory&workflow=GetServerDropDown");
                this.serverListResult = webServiceReference.GetList(null, null);
                if (this.serverListResult.Output != null && this.serverListResult.Output.Length > 0)
                {
                    base.Views = new List <ListItem>();
                    JsonDictionary <object>[] output = this.serverListResult.Output;
                    for (int i = 0; i < output.Length; i++)
                    {
                        Dictionary <string, object> dictionary = output[i];
                        base.Views.Add(new ListItem((string)dictionary["Fqdn"], (string)dictionary["Fqdn"]));
                    }
                    base.Views.Sort((ListItem item1, ListItem item2) => item1.Text.CompareTo(item2.Text));
                }
            }
            catch (TargetInvocationException ex)
            {
                throw ex.InnerException;
            }
            finally
            {
                base.Views.Insert(0, new ListItem(Strings.AllServers, string.Empty));
            }
            ListItem[] items = new ListItem[]
            {
                new ListItem(Strings.AllVDirTypes, "All"),
                new ListItem("Autodiscover", "Autodiscover"),
                new ListItem("EAS", "EAS"),
                new ListItem("ECP", "ECP"),
                new ListItem("EWS", "EWS"),
                new ListItem("OAB", "OAB"),
                new ListItem("OWA", "OWA"),
                new ListItem("PowerShell", "PowerShell")
            };
            this.vDirDropDown           = new FilterDropDown();
            this.vDirDropDown.LabelText = Strings.SelectVDirTypeLabel;
            this.vDirDropDown.ID        = "VDirTypeDropDown";
            this.vDirDropDown.Items.AddRange(items);
            this.vDirDropDown.Width = Unit.Percentage(100.0);
            ComponentBinding componentBinding = new ComponentBinding(this.vDirDropDown, "filterValue");

            componentBinding.Name = "SelectedVDirType";
            WebServiceListSource webServiceListSource = (WebServiceListSource)this.FindControl("listSource");

            webServiceListSource.FilterParameters.Add(componentBinding);
            this.vDirDropDown.Style.Add(HtmlTextWriterStyle.MarginTop, "30");
            this.FindControl("ViewFilterDropDown").Parent.Controls.Add(this.vDirDropDown);
            base.OnLoad(e);
        }
Esempio n. 5
0
    public ModelBlock ConvertViewBlockToModelBlock(GameObject gameObjectViewBlock)
    {
        HashSet <ModelComponent> modelComponents = new HashSet <ModelComponent>();
        Vector3 viewPosition     = gameObjectViewBlock.transform.position;
        string  viewName         = gameObjectViewBlock.GetComponent <ViewBlock>().id;
        var     resultModelBlock = new ModelBlock(viewPosition, modelComponents, viewName);

        foreach (ViewComponent vc in gameObjectViewBlock.GetComponentsInChildren <ViewComponent>())
        {
            var mc      = new ModelComponent(vc.componentType, vc.Position, resultModelBlock);
            var binding = new ComponentBinding(vc, mc, environmentChanged);
            vc.Initialize(gameObjectViewBlock.GetComponent <ViewBlock>(), binding);
            modelComponents.Add(mc);
            componentBindings.Add(binding);
            me.AddComponent(mc);
        }

        return(resultModelBlock);
    }
        private static void DrawBindings(List <ComponentBinding> bindings)
        {
            for (int index = 0; index < bindings.Count; index++)
            {
                ComponentBinding binding = bindings[index];

                Object owner        = (Object)_ownerFieldInfo.GetValue(binding);
                string propertyName = (string)_propertyNameFieldInfo.GetValue(binding);

                Color previousBgColor = GUI.backgroundColor;
                GUI.backgroundColor = Color.green;
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                GUI.backgroundColor = previousBgColor;
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Property name", GUILayout.Width(_columnWidth));
                        EditorGUILayout.LabelField(propertyName, EditorStyles.boldLabel, GUILayout.Height(20F));
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Bound to:", GUILayout.Width(_columnWidth));

                        GUI.enabled = false;
                        _           = EditorGUILayout.ObjectField(GUIContent.none, owner, typeof(Object), false);
                        GUI.enabled = true;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();

                if (index == bindings.Count - 1)
                {
                    continue;
                }

                EditorGUILayout.Separator();
            }
        }
Esempio n. 7
0
 public void Initialize(ViewBlock parent, ComponentBinding binding)
 {
     this.parent          = parent;
     this.binding         = binding;
     this.initializeValue = 3;
 }
Esempio n. 8
0
 public void DeleteComponent(ComponentBinding binding)
 {
     binding.DeleteFromViewAndModel(me);
     componentBindings.Remove(binding);
     me.RemoveComponent(binding.mc);
 }