コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (GuidLabel != null)
            {
                GuidLabel.Dispose();
                GuidLabel = null;
            }

            if (InvokeButton != null)
            {
                InvokeButton.Dispose();
                InvokeButton = null;
            }

            if (ExecuteButton != null)
            {
                ExecuteButton.Dispose();
                ExecuteButton = null;
            }

            if (BindButton != null)
            {
                BindButton.Dispose();
                BindButton = null;
            }
        }
コード例 #2
0
        public LevelSetsPropertiesView(IEditor <CampaignFile> editor_)
        {
            editor = editor_;

            Style = "vertical";

            properties = new PropertiesListBase();

            properties.AddRow("Name", nameBox = new TextBox());
            properties.AddRow("Description", descriptionBox = new TextBox());
            properties.AddRow("Icon", iconBox = new ResourceSelector(editor, ResourceType.Texture));
            properties.AddRow(null, new StackLayout()
            {
                Style = "no-padding horizontal",

                Items =
                {
                    (iconPreview = new StretchedImageBox()
                    {
                        Height   = 96,
                        Width    = 96,
                    }),
                    null
                }
            });

            properties.AddRow("Campaign playlist", campaignDisplayBox = new BooleanSelector());
            properties.AddRow("Sprint playlist", sprintDisplayBox     = new BooleanSelector());

            properties.AddRow("Unique ID", guidBox = new GuidLabel());
            //properties.AddRow("Playlist locking", new EnumDropDown<PlaylistUnlock>());
            //properties.AddRow("Individual level locking", new EnumDropDown<LevelUnlock>());
            //properties.AddRow("Difficulty rating", new EnumDropDown<Difficulty>());

            properties.CompleteRows();

            Items.Add(new StackLayoutItem(properties)
            {
                Expand = false
            });

            nameBox.TextChanged             += NotifyModified;
            descriptionBox.TextChanged      += NotifyModified;
            iconBox.ResourceSelected        += NotifyModified;
            iconBox.ResourceSelected        += IconSelected;
            guidBox.TextChanged             += NotifyModified;
            sprintDisplayBox.ValueChanged   += NotifyModified;
            campaignDisplayBox.ValueChanged += NotifyModified;
        }
コード例 #3
0
        private void InitDBControls()
        {
            //Required Fields
            AssetTagTextBox.SetDBInfo(DevicesBaseCols.AssetTag, true);
            SerialTextBox.SetDBInfo(DevicesBaseCols.Serial, true);
            CurrentUserTextBox.SetDBInfo(DevicesBaseCols.CurrentUser, true);
            DescriptionTextBox.SetDBInfo(DevicesBaseCols.Description, true);
            PurchaseDatePicker.SetDBInfo(DevicesBaseCols.PurchaseDate, true);
            EquipTypeComboBox.SetDBInfo(DevicesBaseCols.EQType, Attributes.DeviceAttributes.EquipType, true);
            LocationComboBox.SetDBInfo(DevicesBaseCols.Location, Attributes.DeviceAttributes.Locations, true);
            OSVersionComboBox.SetDBInfo(DevicesBaseCols.OSVersion, Attributes.DeviceAttributes.OSType, true);
            StatusComboBox.SetDBInfo(DevicesBaseCols.Status, Attributes.DeviceAttributes.StatusType, true);

            //Non-required and Misc Fields
            PONumberTextBox.SetDBInfo(DevicesBaseCols.PO, false);
            ReplaceYearTextBox.SetDBInfo(DevicesBaseCols.ReplacementYear, false);
            PhoneNumberTextBox.SetDBInfo(DevicesBaseCols.PhoneNumber, false);
            GuidLabel.SetDBInfo(DevicesBaseCols.DeviceGuid, ParseType.DisplayOnly, false);
            TrackableCheckBox.SetDBInfo(DevicesBaseCols.Trackable, false);
            HostnameTextBox.SetDBInfo(DevicesBaseCols.HostName, false);
            iCloudTextBox.SetDBInfo(DevicesBaseCols.iCloudAccount, false);
        }
コード例 #4
0
        public OverviewPage(IEditor <CampaignFile> editor)
        {
            AddRow("Campaign title", titleBox    = new TextBox());
            AddRow("Description", descriptionBox = new TextBox());
            AddRow("Author", authorBox           = new TextBox());
            AddRow("Contact", contactBox         = new TextBox());
            //AddRow("Difficulty rating", new EnumDropDown<Difficulty>());
            //AddRow("Development build", devBuildBox = new CheckBox());
            AddRow("Development status", devBuildBox = new EnumDropDown <DevelopmentStatus>());
            AddRow("Project unique ID", guidBox      = new GuidLabel()
            {
                Text = string.Empty
            });

            CompleteRows();

            titleBox.TextChanged             += (_, __) => editor.Modified = true;
            descriptionBox.TextChanged       += (_, __) => editor.Modified = true;
            authorBox.TextChanged            += (_, __) => editor.Modified = true;
            contactBox.TextChanged           += (_, __) => editor.Modified = true;
            devBuildBox.SelectedValueChanged += (_, __) => editor.Modified = true;
            guidBox.TextChanged += (_, __) => editor.Modified = true;
        }
コード例 #5
0
        public LevelPropertiesWindow(IEditor <CampaignFile> editor, CampaignLevel level)
        {
            this.editor = editor;

            Data = level.CloneObject()
                   ?? new CampaignLevel()
            {
                Guid = Guid.NewGuid().ToString()
            };

            Title   = $"{(Equals(level, null) ? "Add" : "Edit")} level";
            Size    = MinimumSize = new Size(600, 400);
            Padding = new Padding(8);

            Resizable = true;

            Content = new StackLayout()
            {
                Style   = "vertical",
                Spacing = 8,

                Items =
                {
                    new StackLayoutItem(tabs = new ExtendedTabControl(),           true),
                    new StackLayoutItem(new StackLayout()
                    {
                        Style   = "horizontal",
                        Spacing =                                  8,
                        Padding = new Padding(0,                          8,0, 0),

                        Items                =
                        {
                            null,
                            (DefaultButton   = new Button(OnConfirm)
                            {
                                Text         = "OK",
                                Image        = Resources.GetIcon("CheckGreen.ico",     16)
                            }),
                            (AbortButton     = new Button(OnCancel)
                            {
                                Text         = "Cancel",
                                Image        = Resources.GetIcon("CloseRed.ico", 16)
                            })
                        }
                    }, false)
                }
            };

            #region General Tab
            tabs.AddPage("General", generalProperties = new DynamicLayout());

            generalProperties.BeginScrollable(BorderType.None);
            generalProperties.BeginVertical();

            generalProperties.AddRow("Unique ID", propLevelGuid  = new GuidLabel());
            generalProperties.AddRow("Level file", propLevelFile = new ResourceSelector(editor, ResourceType.Level));
            generalProperties.AddRow("Level name", propLevelName = new TextBox());

            generalProperties.EndVertical();
            generalProperties.AddSpace();
            generalProperties.EndScrollable();
            #endregion

            //tabs.AddPage("Gameplay", gameplayProperties = new DynamicLayout());

            #region Loading Screen Tab
            tabs.AddPage("Loading screen", loadingScreenProperties = new DynamicLayout());

            loadingScreenProperties.BeginScrollable(BorderType.None);
            loadingScreenProperties.BeginVertical();

            loadingScreenProperties.AddRow("Background image", propLoadingBackground = new ResourceSelector(editor, ResourceType.Texture));

            loadingScreenProperties.AddRow(string.Empty, new StackLayout()
            {
                Style = "no-padding horizontal",

                Items =
                {
                    (propLoadingBackgroundPreview = new StretchedImageBox()
                    {
                        Width                     =160,
                        Height                    = 90
                    }),
                    null
                }
            });

            loadingScreenProperties.AddRow("Overwrite loading text", propLoadingOverwriteText = new BooleanSelector());
            loadingScreenProperties.AddRow("Loading text", propLoadingText = new TextBox());
            loadingScreenProperties.AddRow("Progress indicator icon", propLoadingBackgroundIcon = new ResourceSelector(editor, ResourceType.Texture));
            loadingScreenProperties.AddRow(string.Empty, new StackLayout()
            {
                Style = "no-padding horizontal",

                Items =
                {
                    (propLoadingBackgroundIconPreview = new StretchedImageBox()
                    {
                        Width                         =64,
                        Height                        = 64
                    }),
                    null
                }
            });

            loadingScreenProperties.EndVertical();
            loadingScreenProperties.AddSpace();
            loadingScreenProperties.EndScrollable();
            #endregion

            #region Intro Sequence Tab
            tabs.AddPage("Intro sequence", introSequenceProperties = new DynamicLayout());

            introSequenceProperties.BeginScrollable(BorderType.None);
            introSequenceProperties.BeginVertical();

            // Set whether or not to show the intro, the intro style and text values

            introSequenceProperties.AddRow("Intro type", propIntroType   = new EnumDropDown <LevelTransitionType>());
            introSequenceProperties.AddRow("First line", propIntroLine1  = new TextBox());
            introSequenceProperties.AddRow("Second line", propIntroLine2 = new TextBox());

            introSequenceProperties.EndVertical();
            introSequenceProperties.AddSpace();
            introSequenceProperties.EndScrollable();
            #endregion

            #region Event Subscribing
            propLoadingOverwriteText.ValueChanged      += OnOverwriteLoadingTextChanged;
            propIntroType.SelectedValueChanged         += OnTransitionTypeChanged;
            propLoadingBackground.ResourceSelected     += OnBackgroundSelected;
            propLoadingBackgroundIcon.ResourceSelected += OnLoadingIconSelected;
            #endregion

            LoadData(Data);
        }