protected RootElement CreateSection(List <string> listOfSources)
        {
            var items = new Section(GetSectionTitle());

            if (!listOfSources.Any())
            {
                AddElementsInCaseOfEmptyList(items);
                return(new RootElement("")
                {
                    items
                });
            }
            var rGroup = new RadioGroup(-1);

            foreach (var item in listOfSources)
            {
                var radioButton = new RadioElement(item);
                radioButton.Tapped += () => Upload(listOfSources[rGroup.Selected]);
                items.Add(radioButton);
            }
            return(new RootElement("", rGroup)
            {
                items
            });
        }
Esempio n. 2
0
        private void buildImageCaptureSettingsElements()
        {
            imageCaptureEnabledElement = new BooleanElement("Capture", settings.ImageCaptureEnabled);
            imageCaptureEnabledElement.ValueChanged += delegate
            {
                EnforceDependencies();
            };

            dontSaveImagesElement           = new RadioElement("Don't Save");
            saveImagesToPhotoLibraryElement = new RadioElement("Photo Library");
            saveImagesToMyDocumentsElement  = new RadioElement("My Documents");

            int index = 0;

            if (settings.SaveCapturedImagesToPhotoLibrary)
            {
                index = 1;
            }
            else if (settings.SaveCapturedImagesToMyDocuments)
            {
                index = 2;
            }
            saveImageGroup   = new RadioGroup("SaveImagesGroup", index);
            saveImageElement = new RootElement("Save To", saveImageGroup)
            {
                new Section()
                {
                    dontSaveImagesElement,
                    saveImagesToPhotoLibraryElement,
                    saveImagesToMyDocumentsElement
                }
            };
        }
Esempio n. 3
0
 public override void Start(RAIN.Core.AI ai)
 {
     base.Start(ai);
     if (radio == null) {
         radio = ai.GetCustomElement<RadioElement>();
     }
 }
Esempio n. 4
0
        private void buildCameraSettingsElements()
        {
            // camera
            fronCameraElement = new RadioElement("Front");
            backCameraElement = new RadioElement("Back");
            int index = (int)settings.Camera;

            cameraGroup   = new RadioGroup("CameraGroup", index);
            cameraElement = new RootElement("Source Camera", cameraGroup)
            {
                new Section()
                {
                    fronCameraElement,
                    backCameraElement
                }
            };

            // resolution choices
            lowResElement     = new RadioElement("Low");
            mediumResElement  = new RadioElement("Medium");
            highResElement    = new RadioElement("High");
            index             = (int)settings.CaptureResolution;
            resolutionGroup   = new RadioGroup("ResolutionGroup", index);
            resolutionElement = new RootElement("Resolution", resolutionGroup)
            {
                new Section()
                {
                    lowResElement,
                    mediumResElement,
                    highResElement
                }
            };
        }
Esempio n. 5
0
        private void buildMediaCaptureSettingsElements()
        {
            audioCaptureEnabledElement = new BooleanElement("Record Audio", settings.AudioCaptureEnabled);
            audioCaptureEnabledElement.ValueChanged += delegate
            {
                EnforceDependencies();
            };
            videoCaptureEnabledElement = new BooleanElement("Record Video", settings.VideoCaptureEnabled);
            videoCaptureEnabledElement.ValueChanged += delegate
            {
                EnforceDependencies();
            };
            autoRecordNextMovieElement = new BooleanElement("Loop Recordings", settings.AutoRecordNextMovie);

            // duration choices
            noLimitElement           = new RadioElement("Unlimited");
            oneMinuteLimitElement    = new RadioElement("1 Minute");
            fiveMinuteLimitElement   = new RadioElement("5 Minutes");
            tenMinuteLimitElement    = new RadioElement("10 Minutes");
            thirtyMinuteLimitElement = new RadioElement("30 Minutes");
            int index    = 0;
            int duration = settings.MaxMovieDurationInSeconds;

            if (duration <= 0)
            {
                index = 0;
            }
            else if (duration <= 60)
            {
                index = 1;
            }
            else if (duration <= 300)
            {
                index = 2;
            }
            else if (duration <= 600)
            {
                index = 3;
            }
            else if (duration <= 1800)
            {
                index = 4;
            }

            durationLimitGroup = new RadioGroup("DurationGroup", index);
            durationElement    = new RootElement("Maximum Time", durationLimitGroup)
            {
                new Section()
                {
                    noLimitElement,
                    oneMinuteLimitElement,
                    fiveMinuteLimitElement,
                    tenMinuteLimitElement,
                    thirtyMinuteLimitElement
                }
            };
        }
Esempio n. 6
0
        public RadioGroupExpression <ENUM> RadioButton([NotNull] RadioButton button)
        {
            var element = new RadioElement <ENUM>(_accessor, button, _group);

            _binder.AddElement(element);

            _lastElement = element;

            return(this);
        }
Esempio n. 7
0
        public void RemoveElement(UInt16 index)
        {
            List <RadioElement> r  = StationList.Children.OfType <RadioElement>().ToList();
            RadioElement        re = r.Where(c => c.Index == index).First();
            int controlIndex       = re.Index;

            StationList.Children.Remove(re);
            r = StationList.Children.OfType <RadioElement>().Where(c => c.Index > controlIndex).ToList();
            foreach (RadioElement _re in r)
            {
                ChangeElementIndex(_re);
            }
        }
Esempio n. 8
0
        public void AddElement(Station station)
        {
            RadioElement radioElement = new RadioElement()
            {
                StationName        = station.Name,
                StationGenre       = RadioElement.Genre.Westfall | RadioElement.Genre.Pop,
                StationDescription = station.Description[0],
                Index   = (UInt16)StationList.Children.Count,
                Station = station,
            };

            StationList.Children.Add(radioElement);
        }
Esempio n. 9
0
 private string DistroGump_GFRadioButton(string gump_name, RadioElement elem)
 {
     return(String.Format("GFRadioButton({0}, {1}, {2}, {3}, {4}, {5}, {6});", gump_name, elem.X, elem.Y, elem.UnCheckedID, elem.CheckedID, BoolToString(elem.Checked), elem.Value));
 }
Esempio n. 10
0
        public static RootElement TestElements()
        {
            RootElement re1 = new RootElement("re1");

            Debug.WriteLine(re1.ToString());
            Section s1 = new Section();

            Debug.WriteLine(s1.ToString());
            //Section s2 = new Section(new Android.Views.View(a1));
            //Debug.WriteLine(s2.ToString());
            Section s3 = new Section("s3");

            Debug.WriteLine(s3.ToString());
            //Section s4 = new Section
            //					(
            //					  new Android.Views.View(a1)
            //					, new Android.Views.View(a1)
            //					);
            //Debug.WriteLine(s4.ToString());
            Section s5 = new Section("caption", "footer");

            Debug.WriteLine(s5.ToString());

            StringElement se1 = new StringElement("se1");

            Debug.WriteLine(se1.ToString());
            StringElement se2 = new StringElement("se2", delegate() { });

            Debug.WriteLine(se2.ToString());
            //StringElement se3 = new StringElement("se3", 4);
            StringElement se4 = new StringElement("se4", "v4");

            Debug.WriteLine(se4.ToString());
            //StringElement se5 = new StringElement("se5", "v5", delegate() { });

            // removed - protected (all with LayoutID)
            // StringElement se6 = new StringElement("se6", "v6", 4);
            // Debug.WriteLine(se6.ToString());

            // not cross platform!
            // TODO: make it!?!?!?
            // AchievementElement

            BooleanElement be1 = new BooleanElement("be1", true);

            Debug.WriteLine(be1.ToString());
            BooleanElement be2 = new BooleanElement("be2", false, "key");

            Debug.WriteLine(be2.ToString());

            // Abstract
            // BoolElement be3 = new BoolElement("be3", true);

            CheckboxElement cb1 = new CheckboxElement("cb1");

            Debug.WriteLine(cb1.ToString());
            CheckboxElement cb2 = new CheckboxElement("cb2", true);

            Debug.WriteLine(cb2.ToString());
            CheckboxElement cb3 = new CheckboxElement("cb3", false, "group1");

            Debug.WriteLine(cb3.ToString());
            CheckboxElement cb4 = new CheckboxElement("cb4", false, "subcaption", "group2");

            Debug.WriteLine(cb4.ToString());

            DateElement de1 = new DateElement("dt1", DateTime.Now);

            Debug.WriteLine(de1.ToString());

            // TODO: see issues
            // https://github.com/kevinmcmahon/MonoDroid.Dialog/issues?page=1&state=open
            EntryElement ee1 = new EntryElement("ee1", "ee1");

            Debug.WriteLine(ee1.ToString());
            EntryElement ee2 = new EntryElement("ee2", "ee2 placeholder", "ee2 value");

            Debug.WriteLine(ee2.ToString());
            EntryElement ee3 = new EntryElement("ee3", "ee3 placeholder", "ee3 value", true);

            Debug.WriteLine(ee3.ToString());

            FloatElement fe1 = new FloatElement("fe1");

            Debug.WriteLine(fe1.ToString());
            FloatElement fe2 = new FloatElement(-0.1f, 0.1f, 3.2f);

            Debug.WriteLine(fe2.ToString());
            FloatElement fe3 = new FloatElement
                               (
                null
                , null                                                         // no ctors new Android.Graphics.Bitmap()
                , 1.0f
                               );

            Debug.WriteLine(fe3.ToString());

            HtmlElement he1 = new HtmlElement("he1", "http://holisiticware.net");

            Debug.WriteLine(he1.ToString());


            // TODO: image as filename - cross-platform
            ImageElement ie1 = new ImageElement(null);

            Debug.WriteLine(ie1.ToString());

            // TODO: not in Kevin's MA.D
            // ImageStringElement

            MultilineElement me1 = new MultilineElement("me1");

            Debug.WriteLine(me1.ToString());
            MultilineElement me2 = new MultilineElement("me2", delegate() { });

            Debug.WriteLine(me2.ToString());
            MultilineElement me3 = new MultilineElement("me3", "me3 value");

            Debug.WriteLine(me3.ToString());

            RadioElement rde1 = new RadioElement("rde1");

            Debug.WriteLine(rde1.ToString());
            RadioElement rde2 = new RadioElement("rde1", "group3");

            Debug.WriteLine(rde2.ToString());

            // TODO: not in Kevin's MA.D
            // StyledMultilineElement

            TimeElement te1 = new TimeElement("TimeElement", DateTime.Now);

            Debug.WriteLine(te1.ToString());



            re1.Add(s1);
            //re1.Add(s2);
            re1.Add(s3);
            //re1.Add(s4);
            re1.Add(s5);

            return(re1);
        }
Esempio n. 11
0
 /*
 public void AddTarget(GameObject element) {
     listOfTargets.Add (element);
 }
 */
 public void Listen(RadioElement copRadio)
 {
     //Debug.Log ("Listening");
     cops.Add (copRadio);
 }
Esempio n. 12
0
 private void ChangeElementIndex(RadioElement element)
 {
     element.Index -= 1;
 }
Esempio n. 13
0
 private string Gump_WriteRadioBox(RadioElement elem)
 {
     return(String.Format("radio {0} {1} {2} {3} {4} {5}", elem.X, elem.Y, elem.UnCheckedID, elem.CheckedID, BoolToString(elem.Checked), elem.Value));
 }
Esempio n. 14
0
 private string Gump_WriteRadioBox(RadioElement elem)
 {
     return String.Format("radio {0} {1} {2} {3} {4} {5}", elem.X, elem.Y, elem.UnCheckedID, elem.CheckedID, BoolToString(elem.Checked), elem.Value);
 }
Esempio n. 15
0
 public void SocialBehaviour()
 {
     RadioElement.Click();
     GenericObjects.GoToNextPage();
 }
Esempio n. 16
0
        private StringWriter CreateDistroScript(bool bShowComment, bool bShowNames, bool bDefaultTexts)
        {
            StringWriter  sw_Script    = new StringWriter();
            List <string> GumpCommands = new List <string>();

            bGetDefaultText = bDefaultTexts; // define if plugin will set default text for empty elems

            string gump_name = GetGumpName();

            GumpCommands.Add(DistroGump_GFCreateGump(gump_name, m_Designer.GumpProperties.Location));
            GumpCommands.Add("");
            if (!m_Designer.GumpProperties.Moveable)
            {
                GumpCommands.Add(String.Format("GFMovable({0}, 0);", gump_name));
            }

            if (!m_Designer.GumpProperties.Closeable)
            {
                GumpCommands.Add(String.Format("GFClosable({0}, 0);", gump_name));
            }

            if (!m_Designer.GumpProperties.Disposeable)
            {
                GumpCommands.Add(String.Format("GFDisposable({0}, 0);", gump_name));
            }


            if (m_Designer.Stacks.Count > 0)
            {
                int radiogroup = -1;
                int pageindex  = 0;
                // =================

                foreach (GroupElement ge_Elements in m_Designer.Stacks)
                {
                    if (pageindex > 0)
                    {
                        GumpCommands.Add("");
                    }

                    GumpCommands.Add(DistroGump_GFPage(gump_name, ref pageindex)); // "page pageid"
                    if (ge_Elements == null)
                    {
                        continue;
                    }

                    foreach (BaseElement be_Element in ge_Elements.GetElementsRecursive())
                    {
                        if (be_Element == null)
                        {
                            continue;
                        }

                        if (bShowComment || bShowNames)
                        {
                            string comment = GetCommentString(be_Element, bShowComment, bShowNames);
                            if (comment != String.Empty)
                            {
                                GumpCommands.Add("");
                                GumpCommands.Add(comment);
                            }
                        }

                        Type ElementType = be_Element.GetType();

                        if (ElementType == typeof(HTMLElement))
                        {
                            HTMLElement elem = be_Element as HTMLElement;
                            if (elem.TextType == HTMLElementType.HTML)
                            {
                                GumpCommands.Add(DistroGump_GFHTMLArea(gump_name, elem));
                            }
                            else
                            {
                                GumpCommands.Add(DistroGump_GFAddHTMLLocalized(gump_name, elem));
                            }
                        }
                        else if (ElementType == typeof(TextEntryElement))
                        {
                            TextEntryElement elem = be_Element as TextEntryElement;
                            GumpCommands.Add(DistroGump_GFTextEntry(gump_name, elem));
                        }
                        else if (ElementType == typeof(LabelElement))
                        {
                            LabelElement elem = be_Element as LabelElement;
                            GumpCommands.Add(DistroGump_GFTextLine(gump_name, elem));
                        }

                        else if (ElementType == typeof(AlphaElement))
                        {
                            AlphaElement elem = be_Element as AlphaElement;
                            GumpCommands.Add(DistroGump_GFAddAlphaRegion(gump_name, elem));
                        }
                        else if (ElementType == typeof(BackgroundElement))
                        {
                            BackgroundElement elem = be_Element as BackgroundElement;
                            GumpCommands.Add(DistroGump_GFResizePic(gump_name, elem));
                        }
                        else if (ElementType == typeof(ImageElement))
                        {
                            ImageElement elem = be_Element as ImageElement;
                            GumpCommands.Add(DistroGump_GFGumpPic(gump_name, elem));
                        }
                        else if (ElementType == typeof(ItemElement))
                        {
                            ItemElement elem = be_Element as ItemElement;
                            GumpCommands.Add(DistroGump_GFTilePic(gump_name, elem));
                        }
                        else if (ElementType == typeof(TiledElement))
                        {
                            // TODO: Support "GFGumpPicTiled" when it´s in distro
                            TiledElement elem = be_Element as TiledElement;
                            GumpCommands.Add("");
                            GumpCommands.Add("//Gump package does not support GumpPicTiled");
                            GumpCommands.Add("//" + Gump_WriteGumpPicTiled(elem));
                            GumpCommands.Add("");
                        }

                        else if (ElementType == typeof(ButtonElement))
                        {
                            ButtonElement elem = be_Element as ButtonElement;
                            GumpCommands.Add(DistroGump_GFAddButton(gump_name, elem));
                        }

                        else if (ElementType == typeof(CheckboxElement))
                        {
                            CheckboxElement elem = be_Element as CheckboxElement;
                            GumpCommands.Add(DistroGump_GFCheckBox(gump_name, elem));
                        }
                        else if (ElementType == typeof(RadioElement))
                        {
                            RadioElement elem = be_Element as RadioElement;
                            if (elem.Group != radiogroup)
                            {
                                GumpCommands.Add(String.Format("GFSetRadioGroup({0}, {1});", gump_name, elem.Group));
                                radiogroup = elem.Group;
                            }
                            GumpCommands.Add(DistroGump_GFRadioButton(gump_name, elem));
                        }
                    }
                }
            }


            sw_Script.WriteLine("// Created {0}, with Gump Studio.", DateTime.Now);
            sw_Script.WriteLine("// Exported with {0} ver {1} for gump pkg", this.GetPluginInfo().PluginName, this.GetPluginInfo().Version);
            sw_Script.WriteLine();
            sw_Script.WriteLine("use uo;");
            sw_Script.WriteLine("use os;");
            sw_Script.WriteLine();
            sw_Script.WriteLine("include \":gumps:gumps\";");
            sw_Script.WriteLine();
            sw_Script.WriteLine("program gump_{0}(who)", gump_name);
            sw_Script.WriteLine();

            foreach (string cmd in GumpCommands)
            {
                sw_Script.WriteLine("\t" + cmd);
            }
            sw_Script.WriteLine();
            sw_Script.WriteLine("\tGFSendGump(who, {0});", gump_name);
            sw_Script.WriteLine();
            sw_Script.WriteLine("endprogram");


            return(sw_Script);
        }
Esempio n. 17
0
        public StringWriter GetSphereScript(bool bIsRevision)
        {
            StringWriter stringWriter1 = new StringWriter();
            ArrayList    arrayList1    = new ArrayList();
            ArrayList    arrayList2    = new ArrayList();

            stringWriter1.WriteLine("// Created {0}, with Gump Studio.", (object)DateTime.Now);
            stringWriter1.WriteLine("// Exported with with {0} ver {1}.", (object)this.GetPluginInfo().PluginName, (object)this.GetPluginInfo().Version);
            stringWriter1.WriteLine("// Script for {0}", bIsRevision ? (object)"0.56/Revisions" : (object)"0.99/1.0");
            stringWriter1.WriteLine("");
            stringWriter1.WriteLine("[DIALOG {0}]", (object)this.frm_SphereExportForm.GumpName);
            StringWriter stringWriter2 = stringWriter1;
            string       format        = "{0}";
            int          num1          = bIsRevision ? 1 : 0;
            Point        location      = ((GumpProperties)this.m_Designer.GumpProperties).Location;
            int          x             = location.X;

            location = ((GumpProperties)this.m_Designer.GumpProperties).Location;
            int    y   = location.Y;
            string str = this.Gump_WriteLocation(num1 != 0, x, y);

            stringWriter2.WriteLine(format, (object)str);
            if (!((GumpProperties)this.m_Designer.GumpProperties).Closeable)
            {
                stringWriter1.WriteLine("{0}", bIsRevision ? (object)"NOCLOSE" : (object)"NoClose");
            }
            if (!((GumpProperties)this.m_Designer.GumpProperties).Moveable)
            {
                stringWriter1.WriteLine("{0}", bIsRevision ? (object)"NOMOVE" : (object)"NoMove");
            }
            if (!((GumpProperties)this.m_Designer.GumpProperties).Disposeable)
            {
                stringWriter1.WriteLine("{0}", bIsRevision ? (object)"NODISPOSE" : (object)"NoDispose");
            }
            if (((ArrayList)this.m_Designer.Stacks).Count > 0)
            {
                int id1  = 0;
                int id2  = 0;
                int id3  = 0;
                int num2 = -1;
                for (int iPage = 0; iPage < ((ArrayList)this.m_Designer.Stacks).Count; ++iPage)
                {
                    stringWriter1.WriteLine("{0}", (object)this.Gump_WritePage(bIsRevision, iPage));
                    GroupElement stack = ((ArrayList)this.m_Designer.Stacks)[iPage] as GroupElement;
                    if (stack != null)
                    {
                        ArrayList elementsRecursive = stack.GetElementsRecursive();
                        if (elementsRecursive.Count > 0)
                        {
                            for (int index = 0; index < elementsRecursive.Count; ++index)
                            {
                                BaseElement baseElement = elementsRecursive[index] as BaseElement;
                                if (baseElement != null)
                                {
                                    HTMLElement htmlElement = baseElement as HTMLElement;
                                    if (htmlElement != null)
                                    {
                                        if (htmlElement.TextType == HTMLElementType.HTML)
                                        {
                                            if (bIsRevision)
                                            {
                                                string text = "HtmlGump id." + id1.ToString();
                                                if (htmlElement.HTML != null)
                                                {
                                                    arrayList2.Add((object)new SphereExporter.SphereElement(htmlElement.HTML.Length == 0 ? text : htmlElement.HTML, id1));
                                                }
                                                else
                                                {
                                                    arrayList2.Add((object)new SphereExporter.SphereElement(text, id1));
                                                }
                                            }
                                            stringWriter1.WriteLine("{0}", (object)this.Gump_WriteHTML(bIsRevision, ((BaseElement)htmlElement).X, ((BaseElement)htmlElement).Y, ((ResizeableElement)htmlElement).Width, ((ResizeableElement)htmlElement).Height, htmlElement.ShowBackground, htmlElement.ShowScrollbar, ref id1, htmlElement.HTML));
                                        }
                                        else
                                        {
                                            stringWriter1.WriteLine("{0}", (object)this.Gump_WriteXFHTML(bIsRevision, ((BaseElement)htmlElement).X, ((BaseElement)htmlElement).Y, ((ResizeableElement)htmlElement).Width, ((ResizeableElement)htmlElement).Height, htmlElement.ShowBackground, htmlElement.ShowScrollbar, htmlElement.CliLocID));
                                        }
                                    }
                                    else
                                    {
                                        AlphaElement alphaElement = baseElement as AlphaElement;
                                        if (alphaElement != null)
                                        {
                                            stringWriter1.WriteLine("{0}", (object)this.Gump_WriteCheckerTrans(bIsRevision, ((BaseElement)alphaElement).X, ((BaseElement)alphaElement).Y, ((ResizeableElement)alphaElement).Width, ((ResizeableElement)alphaElement).Height));
                                        }
                                        else
                                        {
                                            BackgroundElement backgroundElement = baseElement as BackgroundElement;
                                            if (backgroundElement != null)
                                            {
                                                stringWriter1.WriteLine("{0}", (object)this.Gump_WriteResizePic(bIsRevision, ((BaseElement)backgroundElement).X, ((BaseElement)backgroundElement).Y, ((ResizeableElement)backgroundElement).Width, ((ResizeableElement)backgroundElement).Height, backgroundElement.GumpID));
                                            }
                                            else
                                            {
                                                ButtonElement buttonElement = baseElement as ButtonElement;
                                                if (buttonElement != null)
                                                {
                                                    arrayList1.Add((object)new SphereExporter.SphereElement("// " + ((BaseElement)buttonElement).Name + "\n// " + buttonElement.Code, buttonElement.ButtonType == ButtonTypeEnum.Reply ? buttonElement.Param : id2));
                                                    stringWriter1.WriteLine("{0}", (object)this.Gump_WriteButton(bIsRevision, ((BaseElement)buttonElement).X, ((BaseElement)buttonElement).Y, buttonElement.NormalID, buttonElement.PressedID, buttonElement.ButtonType == ButtonTypeEnum.Page, buttonElement.Param, ref id2));
                                                }
                                                else
                                                {
                                                    ImageElement imageElement = baseElement as ImageElement;
                                                    if (imageElement != null)
                                                    {
                                                        stringWriter1.WriteLine("{0}", (object)this.Gump_WriteGumpPic(bIsRevision, ((BaseElement)imageElement).X, ((BaseElement)imageElement).Y, imageElement.GumpID, imageElement.Hue.ToString()));
                                                    }
                                                    else
                                                    {
                                                        ItemElement itemElement = baseElement as ItemElement;
                                                        if (itemElement != null)
                                                        {
                                                            stringWriter1.WriteLine("{0}", (object)this.Gump_WriteTilePic(bIsRevision, ((BaseElement)itemElement).X, ((BaseElement)itemElement).Y, itemElement.ItemID, itemElement.Hue.ToString()));
                                                        }
                                                        else
                                                        {
                                                            LabelElement labelElement = baseElement as LabelElement;
                                                            if (labelElement != null)
                                                            {
                                                                if (bIsRevision)
                                                                {
                                                                    string text = "Text id." + id1.ToString();
                                                                    if (labelElement.Text != null)
                                                                    {
                                                                        arrayList2.Add((object)new SphereExporter.SphereElement(labelElement.Text.Length == 0 ? text : labelElement.Text, id1));
                                                                    }
                                                                    else
                                                                    {
                                                                        arrayList2.Add((object)new SphereExporter.SphereElement(text, id1));
                                                                    }
                                                                }
                                                                stringWriter1.WriteLine("{0}", (object)this.Gump_WriteText(bIsRevision, ((BaseElement)labelElement).X, ((BaseElement)labelElement).Y, labelElement.Hue.ToString(), labelElement.Text, ref id1));
                                                            }
                                                            else
                                                            {
                                                                RadioElement radioElement = baseElement as RadioElement;
                                                                if (radioElement != null)
                                                                {
                                                                    if (radioElement.Group != num2)
                                                                    {
                                                                        stringWriter1.WriteLine("Group{0}", bIsRevision ? (object)(" " + radioElement.Group.ToString()) : (object)("(" + radioElement.Group.ToString() + ")"));
                                                                        num2 = radioElement.Group;
                                                                    }
                                                                    stringWriter1.WriteLine("{0}", (object)this.Gump_WriteRadioBox(bIsRevision, ((BaseElement)radioElement).X, ((BaseElement)radioElement).Y, ((CheckboxElement)radioElement).UnCheckedID, ((CheckboxElement)radioElement).CheckedID, radioElement.Checked, radioElement.Value));
                                                                }
                                                                else
                                                                {
                                                                    CheckboxElement checkboxElement = baseElement as CheckboxElement;
                                                                    if (checkboxElement != null)
                                                                    {
                                                                        stringWriter1.WriteLine("{0}", (object)this.Gump_WriteCheckBox(bIsRevision, ((BaseElement)checkboxElement).X, ((BaseElement)checkboxElement).Y, checkboxElement.UnCheckedID, checkboxElement.CheckedID, checkboxElement.Checked, ref id3));
                                                                    }
                                                                    else
                                                                    {
                                                                        TextEntryElement textEntryElement = baseElement as TextEntryElement;
                                                                        if (textEntryElement != null)
                                                                        {
                                                                            if (bIsRevision)
                                                                            {
                                                                                string text = "Textentry id." + textEntryElement.ID.ToString();
                                                                                if (textEntryElement.InitialText != null)
                                                                                {
                                                                                    arrayList2.Add((object)new SphereExporter.SphereElement(textEntryElement.InitialText.Length == 0 ? text : textEntryElement.InitialText, id1));
                                                                                }
                                                                                else
                                                                                {
                                                                                    arrayList2.Add((object)new SphereExporter.SphereElement(text, id1));
                                                                                }
                                                                            }
                                                                            stringWriter1.WriteLine("{0}", (object)this.Gump_WriteTextEntry(bIsRevision, ((BaseElement)textEntryElement).X, ((BaseElement)textEntryElement).Y, ((ResizeableElement)textEntryElement).Width, ((ResizeableElement)textEntryElement).Height, textEntryElement.Hue.ToString(), textEntryElement.InitialText, textEntryElement.ID, ref id1));
                                                                        }
                                                                        else
                                                                        {
                                                                            TiledElement tiledElement = baseElement as TiledElement;
                                                                            if (tiledElement != null)
                                                                            {
                                                                                stringWriter1.WriteLine("{0}", (object)this.Gump_WriteGumpPicTiled(bIsRevision, ((BaseElement)tiledElement).X, ((BaseElement)tiledElement).Y, ((ResizeableElement)tiledElement).Width, ((ResizeableElement)tiledElement).Height, tiledElement.GumpID));
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            stringWriter1.WriteLine("");
            if (bIsRevision)
            {
                stringWriter1.WriteLine("[DIALOG {0} text]", (object)this.frm_SphereExportForm.GumpName);
                foreach (SphereExporter.SphereElement sphereElement in arrayList2)
                {
                    stringWriter1.WriteLine("{0}", (object)sphereElement.sText);
                }
                stringWriter1.WriteLine("");
            }
            stringWriter1.WriteLine("[DIALOG {0} button]", (object)this.frm_SphereExportForm.GumpName);
            foreach (SphereExporter.SphereElement sphereElement in arrayList1)
            {
                stringWriter1.WriteLine("ON={0}", (object)sphereElement.iId.ToString());
                stringWriter1.WriteLine("{0}", (object)sphereElement.sText);
                stringWriter1.WriteLine("");
            }
            stringWriter1.WriteLine("{0}", (object)this.Gump_WriteEOF());
            return(stringWriter1);
        }
Esempio n. 18
0
        /// <summary>
        /// Initializes a new instance of the view class.
        /// </summary>
        /// <param name="siteName">The remote site name.</param>
        /// <param name="navigation">AppWindow.</param>
        public ConnectView(AppWindow window) :
            base(new RootElement("Get POP3 Mailbox Stat"), true)
        {
            // Initialize controller's elements
            _window = window;

            _serverName = new EntryElement("Hostname: ", "Enter server address", "pop.gmail.com");
            Util.DisableAutoCorrectionAndAutoCapitalization(_serverName);

            var noneRadio     = new RadioElement("None", "mode");
            var implicitRadio = new RadioElement("Implicit", "mode");
            var explicitRadio = new RadioElement("Explicit", "mode");

            // automatically update port number to SSL mode default
            noneRadio.Tapped     += () => { ServerPort = Pop3.DefaultPort; };
            explicitRadio.Tapped += () => { ServerPort = Pop3.DefaultPort; };
            implicitRadio.Tapped += () => { ServerPort = Pop3.DefaultImplicitSslPort; };

            _sslModes = new RadioGroup("mode", 1);
            _mode     = new RootElement("TLS/SSL mode:", _sslModes)
            {
                new Section()
                {
                    noneRadio,
                    implicitRadio,
                    explicitRadio
                }
            };

            string defaultPort = "995";

            _serverPort = new EntryElement("Port: ", "Enter port", defaultPort);
            _serverPort.KeyboardType = UIKit.UIKeyboardType.NumberPad;

            _username = new EntryElement("Username: "******"Enter username", "");
            Util.DisableAutoCorrectionAndAutoCapitalization(_username);

            _password = new EntryElement("Password: "******"Enter password", "", true);
            Util.DisableAutoCorrectionAndAutoCapitalization(_password);

            _propertiesSection = new Section()
            {
                _serverName,
                _mode,
                _serverPort,
                _username,
                _password
            };

            Root.Add(_propertiesSection);

            _connectButton = UIButton.FromType(UIButtonType.System);
            _connectButton.SetTitle("Get Mailbox Info", UIControlState.Normal);
            _connectButton.Frame          = new CoreGraphics.CGRect(0, 0, _window.Screen.Bounds.Width - 20, 40);
            _connectButton.TouchUpInside += Connect;

            Section buttonSection = new Section();

            buttonSection.Add(_connectButton);

            Root.Add(buttonSection);
        }
Esempio n. 19
0
        private StringWriter CreateBareScript()
        {
            StringWriter sw_Script = new StringWriter();
            //ArrayList al_Buttons = new ArrayList();
            //ArrayList al_Texts = new ArrayList();

            List <string> GumpCommands = new List <string>();
            List <string> GumpTexts    = new List <string>();


            sw_Script.WriteLine("// Created {0}, with Gump Studio.", DateTime.Now);
            sw_Script.WriteLine("// Exported with {0} ver {1}.", this.GetPluginInfo().PluginName, this.GetPluginInfo().Version);
            sw_Script.WriteLine("");

            if (!m_Designer.GumpProperties.Moveable)
            {
                GumpCommands.Add("NoMove");
            }

            if (!m_Designer.GumpProperties.Closeable)
            {
                GumpCommands.Add("NoClose");
            }

            if (!m_Designer.GumpProperties.Disposeable)
            {
                GumpCommands.Add("NoDispose");
            }

            if (m_Designer.Stacks.Count > 0)
            {
                int radiogroup = -1;
                int pageindex  = 0;
                // =================

                foreach (GroupElement ge_Elements in m_Designer.Stacks)
                {
                    GumpCommands.Add(Gump_WritePage(ref pageindex)); // "page pageid"
                    if (ge_Elements == null)
                    {
                        continue;
                    }

                    foreach (BaseElement be_Element in ge_Elements.GetElementsRecursive())
                    {
                        if (be_Element == null)
                        {
                            continue;
                        }

                        Type ElementType = be_Element.GetType();

                        if (ElementType == typeof(HTMLElement))
                        {
                            HTMLElement elem = be_Element as HTMLElement;
                            if (elem.TextType == HTMLElementType.HTML)
                            {
                                string cmd = Gump_WriteHTMLGump(elem, ref GumpTexts);
                                GumpCommands.Add(cmd);
                            }
                            else
                            {
                                string cmd = Gump_WriteXMFHtmlGump(elem);
                                GumpCommands.Add(cmd);
                            }
                        }
                        else if (ElementType == typeof(TextEntryElement))
                        {
                            TextEntryElement elem = be_Element as TextEntryElement;
                            string           cmd  = Gump_WriteTextEntry(elem, ref GumpTexts);
                            GumpCommands.Add(cmd);
                        }
                        else if (ElementType == typeof(LabelElement))
                        {
                            LabelElement elem = be_Element as LabelElement;
                            string       cmd  = Gump_WriteText(elem, ref GumpTexts);
                            GumpCommands.Add(cmd);
                        }

                        else if (ElementType == typeof(AlphaElement))
                        {
                            AlphaElement elem = be_Element as AlphaElement;
                            string       cmd  = Gump_WriteCheckerTrans(elem);
                            GumpCommands.Add(cmd);
                        }
                        else if (ElementType == typeof(BackgroundElement))
                        {
                            BackgroundElement elem = be_Element as BackgroundElement;
                            string            cmd  = Gump_WriteResizePic(elem);
                            GumpCommands.Add(cmd);
                        }
                        else if (ElementType == typeof(ImageElement))
                        {
                            ImageElement elem = be_Element as ImageElement;
                            string       cmd  = Gump_WriteGumpPic(elem);
                            GumpCommands.Add(cmd);
                        }
                        else if (ElementType == typeof(ItemElement))
                        {
                            ItemElement elem = be_Element as ItemElement;
                            string      cmd  = Gump_WriteTilePic(elem);
                            GumpCommands.Add(cmd);
                        }
                        else if (ElementType == typeof(TiledElement))
                        {
                            TiledElement elem = be_Element as TiledElement;
                            string       cmd  = Gump_WriteGumpPicTiled(elem);
                            GumpCommands.Add(cmd);
                        }

                        else if (ElementType == typeof(ButtonElement))
                        {
                            ButtonElement elem = be_Element as ButtonElement;
                            string        cmd  = Gump_WriteButton(elem);
                            GumpCommands.Add(cmd);
                        }

                        else if (ElementType == typeof(CheckboxElement))
                        {
                            CheckboxElement elem = be_Element as CheckboxElement;
                            string          cmd  = Gump_WriteCheckBox(elem);
                            GumpCommands.Add(cmd);
                        }
                        else if (ElementType == typeof(RadioElement))
                        {
                            RadioElement elem = be_Element as RadioElement;
                            if (elem.Group != radiogroup)
                            {
                                GumpCommands.Add("group " + elem.Group);
                                radiogroup = elem.Group;
                            }
                            string cmd = Gump_WriteRadioBox(elem);
                            GumpCommands.Add(cmd);
                        }
                    }
                }
            }
            sw_Script.WriteLine("");
            sw_Script.WriteLine("use uo;");
            sw_Script.WriteLine("use os;");
            sw_Script.WriteLine("");
            sw_Script.WriteLine("program gump_{0}(who)", frm_POLExportForm.GumpName);
            sw_Script.WriteLine("");

            sw_Script.WriteLine("\tvar gump := array {");

            int i = 1;

            foreach (string tmpCmd in GumpCommands)
            {
                sw_Script.Write("\t\t\"{0}\"", tmpCmd);

                if (i == GumpCommands.Count)
                {
                    sw_Script.WriteLine("");
                }
                else
                {
                    sw_Script.WriteLine(",", tmpCmd);
                }
                i++;
            }
            sw_Script.WriteLine("\t};");

            sw_Script.WriteLine("\tvar data := array {");

            i = 1;
            foreach (string tmpSe in GumpTexts)
            {
                sw_Script.Write("\t\t\"{0}\"", tmpSe);
                if (i == GumpTexts.Count)
                {
                    sw_Script.WriteLine("");
                }
                else
                {
                    sw_Script.WriteLine(",");
                }
                i++;
            }
            sw_Script.WriteLine("\t};");
            sw_Script.WriteLine("");
            sw_Script.WriteLine("\tSendDialogGump(who, gump, data{0});", Gump_Location(m_Designer.GumpProperties.Location));
            sw_Script.WriteLine("");
            sw_Script.WriteLine("endprogram");
            return(sw_Script);
        }
Esempio n. 20
0
 private string DistroGump_GFRadioButton(string gump_name, RadioElement elem)
 {
     return String.Format("GFRadioButton({0}, {1}, {2}, {3}, {4}, {5}, {6});", gump_name, elem.X, elem.Y, elem.UnCheckedID, elem.CheckedID, BoolToString(elem.Checked), elem.Value);
 }