Exemplo n.º 1
0
 public void SendResult(string pathoNo, ReportType reportType, string bgxh, EditType editType, PisAction pisAction,
                        string yymc)
 {
     log.WriteMyLog("aaaaaaaaaaaaaaaaa");
     MessageBox.Show(
         $"测试调用复杂接口成功:{pathoNo}|{reportType.ToString()}|{bgxh}|{editType.ToString()}|{pisAction.ToString()}");
 }
Exemplo n.º 2
0
        internal static XElement CreateEdit(EditType t, DateTime edit_time, object content)
        {
            if (t == EditType.del)
            {
                foreach (object o in (IEnumerable <XElement>)content)
                {
                    if (o is XElement)
                    {
                        XElement e = (o as XElement);
                        IEnumerable <XElement> ts = e.DescendantsAndSelf(XName.Get("t", DocX.w.NamespaceName));

                        for (int i = 0; i < ts.Count(); i++)
                        {
                            XElement text = ts.ElementAt(i);
                            text.ReplaceWith(new XElement(DocX.w + "delText", text.Attributes(), text.Value));
                        }
                    }
                }
            }

            return
                (
                new XElement(DocX.w + t.ToString(),
                             new XAttribute(DocX.w + "id", 0),
                             new XAttribute(DocX.w + "author", WindowsIdentity.GetCurrent().Name),
                             new XAttribute(DocX.w + "date", edit_time),
                             content)
                );
        }
Exemplo n.º 3
0
        //Bearbeiten eines einzelnen IDrawable
        public static void EditDraw(IDrawable obj, EditType edit)
        {
            try
            {
                //EditType wird als string abgespeichert
                var editString = edit.ToString();

                if (obj.GetType().BaseType == typeof(DrawObject))
                {
                    //drwaObject ist obj als DrawObject, so kann auf die DrawObject Funktionen zugegriffen werden
                    var drawObject = (DrawObject)obj;

                    //objekt wird bearbeitet
                    drawObject.Edit((DrawObject.EditObject)Enum.Parse(typeof(DrawObject.EditObject), editString));
                }
                else if (obj.GetType().BaseType == typeof(DrawGroup))
                {
                    var drawGroup = (DrawGroup)obj;

                    //objekt wird bearbeitet
                    drawGroup.Edit((DrawGroup.EditGroup)Enum.Parse(typeof(DrawGroup.EditGroup), editString));
                }

                // Maße werden aktualisiert
                MainWindow.ThisWindow.Measure();
            }
            catch { }
        }
Exemplo n.º 4
0
    private void DrawRightSide()
    {
        float posX = position.width - RightWidth + Offset;
        float posY = Offset;

        int editLenght = Enum.GetNames(typeof(EditType)).Length;

        for (int i = 0; i < editLenght; i++)
        {
            float    tabWidth   = ((float)(RightWidth - (editLenght + 1) * Offset) / editLenght);
            EditType editType   = (EditType)i;
            Color    startColor = GUI.color;
            if (SelectedEdit == editType)
            {
                GUI.color = Color.green;
            }
            if (GUI.Button(new Rect(posX, posY, tabWidth, LineHeight), editType.ToString()))
            {
                if (SelectedEdit != editType)
                {
                    SelectedTile = null;
                    SelectedEdit = editType;
                }
            }
            GUI.color = startColor;
            posX     += tabWidth + Offset;
        }


        posX  = position.width - RightWidth + Offset;
        posY += LineHeight + Offset;

        switch (SelectedEdit)
        {
        case EditType.Building:
            DrawBuildingEdit(posX, posY);
            break;

        case EditType.Tiles:
            DrawTileEdit(posX, posY);
            break;

        case EditType.Track:
            DrawTrackEdit(posX, posY);
            break;
        }
    }
Exemplo n.º 5
0
 internal static XElement CreateEdit(EditType t, DateTime edit_time, object content)
 {
     if (t == EditType.del)
     {
         foreach (XElement item in (IEnumerable <XElement>)content)
         {
             if (item is XElement)
             {
                 XElement xElement             = item as XElement;
                 IEnumerable <XElement> source = xElement.DescendantsAndSelf(XName.Get("t", DocX.w.NamespaceName));
                 for (int i = 0; i < source.Count(); i++)
                 {
                     XElement xElement2 = source.ElementAt(i);
                     xElement2.ReplaceWith(new XElement(DocX.w + "delText", xElement2.Attributes(), xElement2.Value));
                 }
             }
         }
     }
     return(new XElement(DocX.w + t.ToString(), new XAttribute(DocX.w + "id", 0), new XAttribute(DocX.w + "author", "elane"), new XAttribute(DocX.w + "date", edit_time), content));
 }
Exemplo n.º 6
0
        // Removed because it confusses the API.
        //public Picture InsertPicture(int index, string imageID)
        //{
        //    return InsertPicture(index, imageID, string.Empty, string.Empty);
        //}

        /// <summary>
        /// Creates an Edit either a ins or a del with the specified content and date
        /// </summary>
        /// <param name="t">The type of this edit (ins or del)</param>
        /// <param name="edit_time">The time stamp to use for this edit</param>
        /// <param name="content">The initial content of this edit</param>
        /// <returns></returns>
        internal static XElement CreateEdit(EditType t, DateTime edit_time, object content)
        {
            if (t == EditType.del)
            {
                foreach (object o in (IEnumerable<XElement>)content)
                {
                    if (o is XElement)
                    {
                        XElement e = (o as XElement);
                        IEnumerable<XElement> ts = e.DescendantsAndSelf(XName.Get("t", DocX.w.NamespaceName));

                        for (int i = 0; i < ts.Count(); i++)
                        {
                            XElement text = ts.ElementAt(i);
                            text.ReplaceWith(new XElement(DocX.w + "delText", text.Attributes(), text.Value));
                        }
                    }
                }
            }

            return
            (
                new XElement(DocX.w + t.ToString(),
                    new XAttribute(DocX.w + "id", 0),
                    new XAttribute(DocX.w + "author", WindowsIdentity.GetCurrent().Name),
                    new XAttribute(DocX.w + "date", edit_time),
                content)
            );
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //add the localization control
            //NOTE: when this becomes a custom control, the control should be passed
            //in as a child

            /*
             * switch (this.Type)
             * {
             *  case DynamicEditType.HyperLink:
             *      LocalizedHyperLink hyperlink = new LocalizedHyperLink();
             *
             *      if (EditingActive)
             *      {
             *          //hyperlink text should just be simple [Go]
             *
             *      }
             *      hyperlink.Key = this.Key;
             *      hyperlink.NavigateUrl = this.NavigateUrl;
             *      hyperlink.ReplaceText = EmptyText;
             *      plhText.Controls.Add(hyperlink);
             *      break;
             *  default:
             *      LocalizedLiteral literal = new LocalizedLiteral();
             *      literal.Key = this.Key;
             *      literal.ReplaceText = EmptyText;
             *      plhText.Controls.Add(literal);
             *      break;
             *
             * }
             */


            LocalizedLiteral literal = new LocalizedLiteral();

            literal.Key = this.Key;

            if (IsFirst && EditingActive)
            {
                plhScriptOnce.Visible = true;
            }


            if (!EditingActive)
            {
                editingData.Visible     = false;
                plhScriptAlways.Visible = false;
            }
            else
            {
                literal.ReplaceText = EmptyText;


                btnCancel.OnClientClick = "jsi.aspdotnet.getControlInstance('" + this.UniqueID + "').lock(); return false;";

                containingData.Attributes.Add("onclick", "jsi.aspdotnet.getControlInstance('" + this.UniqueID + "').edit();");
                containingData.Attributes.Add("onmouseover", "this.style.cursor='pointer';");

                //show the required javascript for this control if it is the first instance of itself
                if (this.IsFirst)
                {
                    plhScriptOnce.Visible = true;
                }

                txtForEdit.CssClass = "tinymce" + EditType.ToString();

                //add the content inside the textbox as well
                // LocalizedLiteral literalInside = new LocalizedLiteral();
                //literalInside.Key = this.Key;

                //txtForEdit.Controls.Add(literalInside);
            }

            plhText.Controls.Add(literal);
        }