Ejemplo n.º 1
0
        protected override CASMode GetMode(SimDescription sim, ref OutfitCategories startCategory, ref int startIndex, ref EditType editType)
        {
            editType = mEditType;

            if (mStartCategory != OutfitCategories.None)
            {
                startCategory = mStartCategory;
                startIndex = 0;
            }

            if (sim == null) 
            {
                return CASMode.Dresser;
            }
            else if (sim.IsEP11Bot)
            {
                return CASMode.EditABot;
            } 
            else if (sim.IsHuman)
            {
                return CASMode.Dresser;
            }
            else if (sim.IsHorse)
            {
                return CASMode.Tack;
            }
            else if (sim.IsCat || sim.IsADogSpecies)
            {
                return CASMode.Collar;
            }
            else
            {
                return CASMode.Dresser;
            }
        }
Ejemplo n.º 2
0
        internal static XElement[] SplitRun(Run r, int index, EditType type = EditType.ins)
        {
            index -= r.StartIndex;
            Text firstTextEffectedByEdit = r.GetFirstTextEffectedByEdit(index, type);

            XElement[] array    = Text.SplitText(firstTextEffectedByEdit, index);
            XElement   xElement = new XElement(r.Xml.Name, r.Xml.Attributes(), r.Xml.Element(XName.Get("rPr", DocX.w.NamespaceName)), from n in firstTextEffectedByEdit.Xml.ElementsBeforeSelf()
                                               where n.Name.LocalName != "rPr"
                                               select n, array[0]);

            if (Paragraph.GetElementTextLength(xElement) == 0)
            {
                xElement = null;
            }
            XElement xElement2 = new XElement(r.Xml.Name, r.Xml.Attributes(), r.Xml.Element(XName.Get("rPr", DocX.w.NamespaceName)), array[1], from n in firstTextEffectedByEdit.Xml.ElementsAfterSelf()
                                              where n.Name.LocalName != "rPr"
                                              select n);

            if (Paragraph.GetElementTextLength(xElement2) == 0)
            {
                xElement2 = null;
            }
            return(new XElement[2]
            {
                xElement,
                xElement2
            });
        }
Ejemplo n.º 3
0
 public DiffViewLine(string strText, int iNumber, EditType Type, bool bEdited)
 {
     m_strText = strText;
     m_iNumber = iNumber;
     m_Type = Type;
     m_bEdited = bEdited;
 }
Ejemplo n.º 4
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()}");
 }
Ejemplo n.º 5
0
 /// <summary>
 /// EditのAddが変化したとき
 /// </summary>
 /// <param name="v"></param>
 void HandleChangedEditAdd(bool v)
 {
     if (v)
     {
         _editType = EditType.Add;
     }
 }
Ejemplo n.º 6
0
 public DiffViewLine(string strText, int iNumber, EditType Type, bool bEdited)
 {
     m_strText = strText;
     m_iNumber = iNumber;
     m_Type    = Type;
     m_bEdited = bEdited;
 }
Ejemplo n.º 7
0
        public PortCommands(string name, string content, EditType type = Config.EditType.EDIT_NONE, XmlNodeList nodeList = null)
        {
            m_text     = content;
            m_name     = name;
            m_type     = type;
            m_nodeList = nodeList;
            if (m_text != null)
            {
                int      colCount    = 0;
                string[] stringEnter = new string[] { "\n" };
                string[] text_line   = m_text.Split(stringEnter, StringSplitOptions.RemoveEmptyEntries);
                string   tmp;
                if (text_line.Length >= 2)
                {
                    colCount = m_nodeList.Count + 1;

                    for (int j = 2; j < text_line.Length; j++)
                    {
                        tmp = text_line[j].Trim();
                        if (tmp.Length < colCount - 1 || tmp[0] == '#')
                        {
                            continue;
                        }
                        else
                        {
                            m_ItemArray.Add(new PortConfig(m_name, text_line[j], m_type, m_nodeList));
                        }
                    }
                }
            }
            else
            {
                m_ItemArray.Add(new PortConfig(m_name, null, m_type, m_nodeList));
            }
        }
Ejemplo n.º 8
0
        private int m_iStartB; //Where to Insert or Change in the "B" sequence

        #endregion Fields

        #region Constructors

        public Edit(EditType eType, int iStartA, int iStartB, int iLength)
        {
            m_eType = eType;
            m_iStartA = iStartA;
            m_iStartB = iStartB;
            m_iLength = iLength;
        }
Ejemplo n.º 9
0
 public FrmKsSprwh(string deptId, DataTable shrTable, EditType editType)
     : this()
 {
     this.deptId   = deptId;
     this.shrTable = shrTable;
     this.pagetype = editType;
 }
Ejemplo n.º 10
0
        private int startB;          // Where to Insert or Change in the "B" sequence

        #endregion

        #region Constructors
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="editType">Models the type of the edit operation
        /// that should be applied to transform string_A into String_B.</param>
        /// <param name="startA">The starting offset where the edit operation should be applied.</param>
        /// <param name="startB">The starting offset where the application of the edit operation
        /// will lead to equality in this starting position of stringB.</param>
        /// <param name="length">The length of the sub-string that is affected in stringA or stringB
        /// when the edit operation is applied in stringA or the inverted edit operation is applied in stringB.</param>
        internal Edit(EditType editType, int startA, int startB, int length)
        {
            this.editType = editType;
            this.startA   = startA;
            this.startB   = startB;
            this.length   = length;
        }
Ejemplo n.º 11
0
        public static Color GetColorForEditType(EditType editType)
        {
            Color result;

            switch (editType)
            {
            case EditType.Change:
                result = ChangedColor;
                break;

            case EditType.Insert:
                result = InsertedColor;
                break;

            case EditType.Delete:
                result = DeletedColor;
                break;

            default:
                Debug.Assert(false, "An invalid EditType was passed in.");
                result = Color.Transparent;
                break;
            }

            return(result);
        }
Ejemplo n.º 12
0
    protected void TouchCallBack(int touchId, EditType editType)
    {
        curEditData.id       = touchId;
        curEditData.editType = editType;

        ChangeColorAllowPos();
    }
Ejemplo n.º 13
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)
                );
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 編集ダイアログを表示する
        /// </summary>
        /// <param name="editType"></param>
        public void ShowEditDialog(EditType editType)
        {
            switch (editType)
            {
            case EditType.Register:
                SelectedEditType = EditType.Register;

                break;

            case EditType.Update:
                SelectedUser     = GetSelctedUser(ListForm.GetSelectedRow());
                SelectedEditType = EditType.Update;

                break;

            case EditType.Delete:
                SelectedUser     = GetSelctedUser(ListForm.GetSelectedRow());
                SelectedEditType = EditType.Delete;

                break;
            }

            View.EditForm editForm = new View.EditForm(Users, Departments, SelectedEditType, SelectedUser);
            editForm.ShowDialog();

            //編集したユーザー情報をIDの昇順に並べバインドリストに
            Users = Users.OrderBy(x => x.ID).ToList();
        }
Ejemplo n.º 15
0
        private static void EditDo <T>(this DbSet <T> sets, EditType type, IEnumerable <T> entities, bool many = false) where T : ISuper
        {
            switch (type)
            {
            case EditType.Add: if (many)
                {
                    sets.AddRange(entities);
                }
                else
                {
                    sets.Add(entities.First());
                } break;

            case EditType.Modify: if (many)
                {
                    sets.UpdateRange(entities);
                }
                else
                {
                    sets.Update(entities.First());
                } break;

            case EditType.Remove: if (many)
                {
                    sets.RemoveRange(entities);
                }
                else
                {
                    sets.Remove(entities.First());
                } break;
            }
        }
Ejemplo n.º 16
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            var newClient = new Client();

            _editType = EditType.Add;
            ShowEditClientInfor(newClient);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 修改
        /// </summary>
        private void Modify()
        {
            editType = EditType.Modify;
            //修改
            #region 获取信息
            FtpFile obj = new FtpFile();
            obj.PrimaryID      = this.lbPrimaryID.Text;
            obj.FileName       = this.lbFileName.Text;
            obj.LocalDirectory = this.lbFilePath.Text;
            obj.FileVersion    = this.lbFileVersion.Text;
            obj.OperCode       = this.lbOperCode.Text;
            obj.OperDate       = System.DateTime.Now;
            //string strSql = "select t.file_content  from com_downloadfile t where t.primary_id = '{0}'";
            //strSql = string.Format(strSql,obj.PrimaryID);
            //System.Data.DataSet ds = mgr.SelectData(con,strSql);
            //byte [] blob = null;
            //foreach(DataRow row in ds.Tables[0].Rows)
            //{
            //    blob = (byte [])row[0];
            //}
            //obj.FileContent = blob; modified by xipeter 20120831 更新文件时,没有必要得到文件内容
            #endregion

            frmInfo frm = new frmInfo();
            frm.Con = con;
            frm.SetInfo(obj);
            frm.myEditType  = EditType.Modify;            //修改
            frm.SaveHandle += new AutoUpdate.frmInfo.SaveDelegate(frm_SaveHandle);
            frm.ShowDialog();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// the constructor of this form
        /// </summary>
        /// <param name="editType">the type of how to open this form</param>
        /// <param name="bindingSource">the data source</param>
        /// <param name="vehicleStockData">the data use to connect to the database</param>
        public frmEditVehicleStock(EditType editType, BindingSource bindingSource, VehicleStockData vehicleStockData)
        {
            _bindingSource    = bindingSource;
            _vehicleStockData = vehicleStockData;
            _editType         = editType;

            InitializeComponent();
            frmEditVehicleStock_Load();

            //Validation
            txtStockNumber.Validating += new CancelEventHandler(txtStockNumber_Validating);
            txtStockNumber.Validated  += new EventHandler(txtBox_Validated);

            txtMake.Validating += new CancelEventHandler(txtBoxRequired_Validating);
            txtMake.Validated  += new EventHandler(txtBox_Validated);

            txtModel.Validating += new CancelEventHandler(txtBoxRequired_Validating);
            txtModel.Validated  += new EventHandler(txtBox_Validated);

            txtColour.Validating += new CancelEventHandler(txtBoxRequired_Validating);
            txtColour.Validated  += new EventHandler(txtBox_Validated);

            txtYear.Validating += new CancelEventHandler(txtYear_Validating);
            txtYear.Validated  += new EventHandler(txtBox_Validated);


            txtMileage.Validating += new CancelEventHandler(txtNumeric_Validating);
            txtMileage.Validated  += new EventHandler(txtBox_Validated);

            txtBasePrice.Validating += new CancelEventHandler(txtNumeric_Validating);
            txtBasePrice.Validated  += new EventHandler(txtBox_Validated);

            this.FormClosing += new FormClosingEventHandler(frmEditVehicleStock_FormClosing);
        }
Ejemplo n.º 19
0
 static async Task EditType(EditType obj)
 {
     var                 json                = JsonConvert.SerializeObject(obj);
     var                 httpContent         = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
     HttpClient          client              = new HttpClient();
     HttpResponseMessage httpResponseMessage = await client.PostAsync("http://localhost:2794/DictionaryConferenceType/EditType", httpContent);
 }
Ejemplo n.º 20
0
 public ConfEditor(TransferForm parent, EditType type)
 {
     InitializeComponent();
     nameBox.Focus();
     this.parent = parent;
     this.Type   = type;
 }
Ejemplo n.º 21
0
 public EditItem(EditType editType, string suggestedText, string description, int removeTokensCount = 0)
 {
     EditType          = editType;
     SuggestedText     = suggestedText;
     Description       = description;
     RemoveTokensCount = removeTokensCount;
 }
Ejemplo n.º 22
0
        private string GetEditType(EditType type)
        {
            switch (type)
            {
            case EditType.CheckBox:
                return("checkbox");

            case EditType.Custom:
                return("custom");

            case EditType.DropDown:
                return("select");

            case EditType.Password:
                return("password");

            case EditType.TextArea:
                return("textarea");

            case EditType.TextBox:
                return("text");

            case EditType.Chosen:
                return("select");
                //case EditType.Button:
                //    return "button";
            }
            return("text");
        }
Ejemplo n.º 23
0
 public UcClient(ClientViewModel client, EditType editType) : this()
 {
     _editType        = editType;
     _client          = client;
     DataContext      = _client;
     _currentClientId = client.Client.ClientId;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="text"></param>
 /// <param name="number"></param>
 /// <param name="editType"></param>
 /// <param name="fromA">Set to true if this data represents the reference view
 /// (left view also known as ViewA) otherwise false.</param>
 public DiffViewLine(string text, int?number, EditType editType, bool fromA)
 {
     this.text      = text;
     this.number    = number;
     this._editType = editType;
     this.FromA     = fromA;
 }
Ejemplo n.º 25
0
        public RoleEditForm(AerospikeClient client, EditType editType, RoleRow row)
        {
            this.client = client;
            this.editType = editType;
            InitializeComponent();

            grid.AutoGenerateColumns = false;
            PrivilegeCodeColumn.DataPropertyName = "Code";
            PrivilegeCodeColumn.ValueMember = "PrivilegeCode";
            PrivilegeCodeColumn.DisplayMember = "Label";
            PrivilegeCodeColumn.DataSource = GetPrivilegeTypeBinding();
            NamespaceColumn.DataPropertyName = "Namespace";
            SetNameColumn.DataPropertyName = "SetName";

            BindingSource bindingSource = new BindingSource();

            switch (editType)
            {
                case EditType.CREATE:
                    bindingSource.DataSource = new BindingList<Privilege>();
                    break;

                case EditType.EDIT:
                    this.Text = "Edit Role";
                    nameBox.Enabled = false;
                    nameBox.Text = row.name;
                    bindingSource.DataSource = LoadPrivileges(row.privileges);
                    oldPrivileges = row.privileges;
                    break;
            }
            grid.DataSource = bindingSource;
        }
Ejemplo n.º 26
0
        public override void EditList(Noti item, EditType type)
        {
            switch (type)
            {
            case EditType.Add:
                item.NotiId = IdPreIndex + Notis.Count;

                Notis.Add(item);
                Notis.Sort(SortNotis);
                break;

            case EditType.Remove:
                Notis.Remove(Notis.Find(x => x.NotiId == item.NotiId));
                break;

            case EditType.Edit:
                int index = Notis.FindIndex(x => x.NotiId == item.NotiId);

                Notis[index] = item;
                Notis[index].UpdateTime();
                break;

            case EditType.EditOnlyTime:
                Notis[Notis.FindIndex(x => x.NotiId == item.NotiId)] = item;
                break;

            default:
                break;
            }

            SaveNotis();
            UpdateScheduledNoti <GardeningNoti>();
        }
        private string GetEditType(EditType type)
        {
            switch (type)
            {
            case EditType.Password:
                return("password");

            case EditType.DropDown:
                return("select");

            case EditType.TextArea:
                return("textarea");

            case EditType.CheckBox:
                return("checkbox");

            case EditType.TextBox:
                return("text");

            case EditType.Custom:
                return("custom");

            default:
                return("text");
            }
        }
Ejemplo n.º 28
0
        private void frmAddConfig_Load(object sender, EventArgs e)
        {
            if (sizeConf != null)
            {
                editType       = EditType.EditTypeUpdate;
                addButton.Text = "确认修改";
                Button deleteButton = new Button();
                deleteButton.Text      = "删除配置";
                deleteButton.Width     = addButton.Width;
                deleteButton.Height    = addButton.Height;
                deleteButton.Left      = addButton.Left;
                deleteButton.Top       = addButton.Top - deleteButton.Height - 5;
                deleteButton.ForeColor = Color.White;
                deleteButton.BackColor = Color.Red;
                deleteButton.Click    += new EventHandler(deleteButton_Click);

                this.Controls.Add(deleteButton);
                // other
                numericUpDown1.Value = decimal.Parse(sizeConf.size.Width.ToString());
                numericUpDown2.Value = decimal.Parse(sizeConf.size.Height.ToString());
                textBox1.Text        = sizeConf.name;
            }
            else
            {
                editType       = EditType.EditTypeAdd;
                addButton.Text = "确认添加";
            }
        }
Ejemplo n.º 29
0
        public RoleEditForm(AerospikeClient client, EditType editType, RoleRow row)
        {
            this.client   = client;
            this.editType = editType;
            InitializeComponent();

            grid.AutoGenerateColumns             = false;
            PrivilegeCodeColumn.DataPropertyName = "Code";
            PrivilegeCodeColumn.ValueMember      = "PrivilegeCode";
            PrivilegeCodeColumn.DisplayMember    = "Label";
            PrivilegeCodeColumn.DataSource       = GetPrivilegeTypeBinding();
            NamespaceColumn.DataPropertyName     = "Namespace";
            SetNameColumn.DataPropertyName       = "SetName";

            BindingSource bindingSource = new BindingSource();

            switch (editType)
            {
            case EditType.CREATE:
                bindingSource.DataSource = new BindingList <Privilege>();
                break;

            case EditType.EDIT:
                this.Text                = "Edit Role";
                nameBox.Enabled          = false;
                nameBox.Text             = row.name;
                bindingSource.DataSource = LoadPrivileges(row.privileges);
                oldPrivileges            = row.privileges;
                break;
            }
            grid.DataSource = bindingSource;
        }
Ejemplo n.º 30
0
        public override void EditList(Noti item, EditType type)
        {
            var noti = item as RealmFriendshipNoti;

            switch (type)
            {
            case EditType.Add:
                if (Notis.FindAll(x => (x as RealmFriendshipNoti).Percentage.Equals(noti.Percentage)).Count == 0)
                {
                    Notis.Add(item);
                    Notis.Sort(SortNotis);
                }
                else
                {
                    DependencyService.Get <IToast>().Show(AppResources.NotiSettingPage_AlreadyExistToast_Message);
                }
                break;

            case EditType.Remove:
                Notis.Remove(Notis.Find(x => (x as RealmFriendshipNoti).Percentage.Equals(noti.Percentage)));
                break;

            case EditType.Edit:
                (Notis[Notis.FindIndex(x => (x as RealmFriendshipNoti).Percentage.Equals(noti.Percentage))] as RealmFriendshipNoti).Percentage = noti.Percentage;
                break;

            default:
                break;
            }

            SaveNotis();
            UpdateScheduledNoti <RealmFriendshipNoti>();
        }
Ejemplo n.º 31
0
 public Edit(EditType eType, int iStartA, int iStartB, int iLength)
 {
     m_eType   = eType;
     m_iStartA = iStartA;
     m_iStartB = iStartB;
     m_iLength = iLength;
 }
Ejemplo n.º 32
0
        public EditcarnePage(CarnePronta CarnePronta, EditType tipo)
        {
            InitializeComponent();

            if (CarnePronta != null) // Editar / Excluir
            {
                this.CarnePronta    = CarnePronta;
                DescricaoEntry.Text = CarnePronta.Descricao;
                NomeEntry.Text      = CarnePronta.Nome;
                PrecoEntry.Text     = CarnePronta.Preco;
                Title = "Editar os carnes emprestados";
                SalvarButton.IsVisible     = false;
                SalvarMenuButton.IsVisible = false;
                AttButton.IsVisible        = true;
                if (tipo == EditType.Excluir)
                {
                    ExcluirButton.IsVisible = true;
                }
                else if (tipo == EditType.Separar)
                {
                    SepararButton.IsVisible = true;
                }
            }
            else // Novo
            {
                Title = "Nova Carne";
            }

            /*
             * DescricaoEntry.Text = CarnePronta.Descricao;
             * NomeEntry.Text = CarnePronta.Nome;
             * DataEntry.Text = CarnePronta.Data.ToString("dd/MM/yyyy");
             */
        }
Ejemplo n.º 33
0
 /// <summary>
 /// EditのMoveが変化したとき
 /// </summary>
 /// <param name="v"></param>
 void HandleChangedEditMove(bool v)
 {
     if (v)
     {
         _editType = EditType.Move;
     }
 }
Ejemplo n.º 34
0
        //==========================BeforSave==========================

        public static List <TR01C> BeforSave(List <TR01CModel> data, EditType editType)
        {
            List <TR01C> list = new List <TR01C>();

            if (editType == EditType.AddNew)
            {
                foreach (var item in data)
                {
                    item.CREATE_USER = UserInfo.Id;
                    item.CREATE_DATE = DateTime.Now;
                    list.Add(ToEntity(item));
                }
            }
            else
            {
                TR01Service _Service    = new TR01Service();
                var         DBTR01CList = _Service.GetC(data.Select(x => x.TR01C_ID).ToList());
                foreach (var item in DBTR01CList)
                {
                    var tempData = data.First(x => x.TR01C_ID == item.TR01C_ID);
                    tempData.TR01A_ID    = item.TR01A_ID;
                    tempData.CREATE_USER = item.CREATE_USER;
                    tempData.CREATE_DATE = item.CREATE_DATE;
                    tempData.UPDATE_USER = UserInfo.Id;
                    tempData.UPDATE_DATE = DateTime.Now;
                    list.Add(ToEntity(tempData));
                }
            }
            return(list);
        }
Ejemplo n.º 35
0
 private static EditStruct GetChangeStruct(string source, string target, int i, int j, EditType type)
 {
     EditStruct es = new EditStruct();
     es.editType = type;
     es.editPos = i - 1;
     es.editChar = target[j - 1];
     return es;
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Set Editor to Add Mode. This method must be called before show dialog.
        /// </summary>
        public void AddMode()
        {
            OKButtonLabel = "_Save";
            OnPropertyChanged("OKButtonLabel");
            IsComplete = false;
            mode = EditType.Add;

            OnModeSet();
        }
Ejemplo n.º 37
0
        protected BaseAppEditorVM(Window w)
        {
            view = w;
            view.DataContext = this;
            view.Owner = AppData.MainWindowView;

            mode = EditType.NotSet;

            OKButtonCommand = new RelayCommand(OKAction);
            CancelButtonCommand = new RelayCommand(CancelAction);
        }
        public static string Translate(EditType type)
        {
            switch (type)
            {
                case EditType.WebEdit:
                    return HtmlUtility.Encode(SR.StudyDetails_WebEdit_Description);
                case EditType.WebServiceEdit:
                    return HtmlUtility.Encode(SR.StudyDetails_WebServiceEdit_Description);
            }

            return HtmlUtility.Encode(HtmlUtility.GetEnumInfo(type).LongDescription);
        }
Ejemplo n.º 39
0
        protected override CASMode GetMode(SimDescription sim, ref OutfitCategories startCategory, ref int startIndex, ref EditType editType)
        {
            if (!mAlwaysCAS)
            {
                if (mCAB)
                {
                    return CASMode.CreateABot;
                }
                else if (sim.IsEP11Bot)
                {
                    return CASMode.EditABot;
                }
            }

            return CASMode.Full;
        }
Ejemplo n.º 40
0
 public static string GetJqColumnEditTypeValue(EditType? editType)
 {
     switch (editType)
     {
         case EditType.Text:
             return string.Empty;
         case EditType.Select:
             return "select";
         case EditType.Check:
             return "checkbox";
         case EditType.TextArea:
             return "textarea";
         default:
             return string.Empty;    
     }
 }
Ejemplo n.º 41
0
 public EditForm(EditType type)
 {
     this.type = type;
     page = 0;
     InitializeComponent();
     switch (type)
     {
         case EditType.InventoryEdit:
             table = "inventory";
             break;
         case EditType.CustomerEdit:
             table = "customer";
             Text = "Customer Edit";
             if (DB.Instance.CustomerPagination)
             {
                 showPagination();
             }
             break;
         case EditType.EmployeeEdit:
             table = "employee";
             Text = "Employee Edit";
             if (DB.Instance.EmployeePagination)
             {
                 showPagination();
             }
             break;
         case EditType.OrderEdit:
             table = "order";
             Text = "Order Edit";
             if (DB.Instance.OrderPagination)
             {
                 showPagination();
             }
             break;
     }
     if (EditType.OrderEdit == type) fetch(
     @"SELECT
     O.id, C.first_name, C.last_name, O.dt, sum(I.cost * OI.amount) as Total, OS.title
     FROM
     order_inventory AS OI
     INNER JOIN inventory AS I ON I.id = OI.inventory_id
     INNER JOIN `order` AS O ON O.id = OI.order_id
     INNER JOIN customer AS C ON C.id = O.customer_id
     INNER JOIN order_status AS OS ON OS.id = O.`status`
     GROUP BY OI.order_id");
     else fetchAll();
 }
Ejemplo n.º 42
0
 public OrderEdit(uint uid, EditType et)
     : this()
 {
     Tag = et;
     query =
     @"SELECT
     O.id, O.dt, sum(I.cost * OI.amount) as Total, OS.title
     FROM
     order_inventory AS OI
     INNER JOIN inventory AS I ON I.id = OI.inventory_id
     INNER JOIN `order` AS O ON O.id = OI.order_id
     INNER JOIN customer AS C ON C.id = O.customer_id
     INNER JOIN order_status AS OS ON OS.id = O.`status`
     WHERE O.customer_id = " + uid + @"
     GROUP BY OI.order_id";
     refresh();
 }
Ejemplo n.º 43
0
        // Call to load from the XIB/NIB file
        public EditWizardController (EditType type, CmisRepoCredentials credentials, string name, string remotePath, List<string> ignores, string localPath) : base ("EditWizard")
        {
            FolderName = name;
            this.Credentials = credentials;
            this.remotePath = remotePath;
            this.Ignores = new List<string>(ignores);
            this.localPath = localPath;
            this.type = type;

            Initialize ();

            Controller.OpenWindowEvent += () =>
            {
                InvokeOnMainThread (() =>
                {
                    this.Window.OrderFrontRegardless ();
                });
            };
        }
Ejemplo n.º 44
0
        public EditForm(EditType EditMode,Task StartValue)
        {
            InitializeComponent();
            this.FormClosing += new FormClosingEventHandler(EditForm_FormClosing);
            _editmode = EditMode;
            _task = StartValue;
            Fill();
            switch (_editmode)
            {
                case EditType.New:
                    {
                        _task.ID = -1;
                        break;
                    }
                case EditType.Edit:
                    {

                        break;
                    }
            }
        }
Ejemplo n.º 45
0
 public static void SetType(string name)
 {
     if(name == "Brush")
     {
         editType = EditType.Brush;
     }
     else if (name == "World")
     {
         editType = EditType.World;
     }
     else if (name == "Erase")
     {
         editType = EditType.Erase;
     }
     else if (name == "Game")
     {
         editType = EditType.Game;
     }
     else
     {
         editType = EditType.None;
     }
 }
Ejemplo n.º 46
0
        public UserEditForm(AerospikeClient client, EditType editType, UserRow user)
        {
            this.client = client;
            this.editType = editType;

            InitializeComponent();

            switch (editType)
            {
                case EditType.CREATE:
                    SetRoles(null);
                    break;

                case EditType.EDIT:
                    this.Text = "Edit User Roles";
                    userBox.Enabled = false;
                    userBox.Text = user.name;
                    passwordBox.Enabled = false;
                    passwordVerifyBox.Enabled = false;
                    SetRoles(user.roles);
                    oldRoles = user.roles;
                    break;
            }
        }
Ejemplo n.º 47
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Edit(EditType type, CmisRepoCredentials credentials, string name, string remotePath, List<string> ignores, string localPath)
        {
            this.FolderName = name;
            this.Credentials = credentials;
            this.remotePath = remotePath;
            this.Ignores = ignores;
            this.localPath = localPath;
            this.type = type;

            this.CreateEdit();

            this.Deletable = true;

            this.DeleteEvent += delegate(object sender, DeleteEventArgs args) {
                args.RetVal = false;
                this.Controller.CloseWindow();
            };

            this.Controller.OpenWindowEvent += delegate
            {
                this.ShowAll();
                this.Activate();
            };
        }
Ejemplo n.º 48
0
        private static bool OnTileEdit(TSPlayer ply, int x, int y, EditAction action, EditType editDetail, short editData, byte style)
        {
            if (TileEdit == null)
                return false;

            var args = new TileEditEventArgs
            {
                Player = ply,
                X = x,
                Y = y,
                Action = action,
                EditData = editData,
                editDetail = editDetail,
                Style = style
            };
            TileEdit.Invoke(null, args);
            return args.Handled;
        }
Ejemplo n.º 49
0
 private void OnStartEditUnderSider(object sender, RoutedEventArgs e)
 {
     curEditType = EditType.UnderSider;
     mapResView.IsCanDrag = false;
 }
Ejemplo n.º 50
0
 private void OnStartEditOffset(object sender, RoutedEventArgs e)
 {
     if (this.IsInitialized)
     {
         curEditType = EditType.Offset;
         mapResView.IsCanDrag = true;
     }
 }
Ejemplo n.º 51
0
        internal Text GetFirstTextEffectedByEdit(int index, EditType type = EditType.ins)
        {
            // Make sure we are looking within an acceptable index range.
            if (index < 0 || index > HelperFunctions.GetText(Xml).Length)
                throw new ArgumentOutOfRangeException();

            // Need some memory that can be updated by the recursive search for the XElement to Split.
            int count = 0;
            Text theOne = null;

            GetFirstTextEffectedByEditRecursive(Xml, index, ref count, ref theOne, type);

            return theOne;
        }
Ejemplo n.º 52
0
 protected override CASMode GetMode(SimDescription sim, ref OutfitCategories startCategory, ref int startIndex, ref EditType editType)
 {
     editType = EditType.None;
     return CASMode.Mirror;
 }
Ejemplo n.º 53
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)
            );
        }
Ejemplo n.º 54
0
        internal void GetFirstRunEffectedByEditRecursive(XElement Xml, int index, ref int count, ref Run theOne, EditType type)
        {
            count += HelperFunctions.GetSize(Xml);

            // If the EditType is deletion then we must return the next blah
            if (count > 0 && ((type == EditType.del && count > index) || (type == EditType.ins && count >= index)))
            {
                // Correct the index
                foreach (XElement e in Xml.ElementsBeforeSelf())
                    count -= HelperFunctions.GetSize(e);

                count -= HelperFunctions.GetSize(Xml);

                // We have found the element, now find the run it belongs to.
                while (Xml.Name.LocalName != "r")
                    Xml = Xml.Parent;

                theOne = new Run(Document, Xml, count);
                return;
            }

            if (Xml.HasElements)
                foreach (XElement e in Xml.Elements())
                    if (theOne == null)
                        GetFirstRunEffectedByEditRecursive(e, index, ref count, ref theOne, type);
        }
Ejemplo n.º 55
0
 private void AddLine(string strText, int iNumber, EditType eType, bool bEdited)
 {
     AddLine(new DiffViewLine(strText, iNumber, eType, bEdited));
 }
Ejemplo n.º 56
0
        internal XElement[] SplitEdit(XElement edit, int index, EditType type)
        {
            Run run = GetFirstRunEffectedByEdit(index, type);

            XElement[] splitRun = Run.SplitRun(run, index, type);

            XElement splitLeft = new XElement(edit.Name, edit.Attributes(), run.Xml.ElementsBeforeSelf(), splitRun[0]);
            if (GetElementTextLength(splitLeft) == 0)
                splitLeft = null;

            XElement splitRight = new XElement(edit.Name, edit.Attributes(), splitRun[1], run.Xml.ElementsAfterSelf());
            if (GetElementTextLength(splitRight) == 0)
                splitRight = null;

            return
            (
                new XElement[]
                {
                    splitLeft,
                    splitRight
                }
            );
        }
Ejemplo n.º 57
0
        internal void GetFirstTextEffectedByEditRecursive(XElement Xml, int index, ref int count, ref Text theOne, EditType type = EditType.ins)
        {
            count += HelperFunctions.GetSize(Xml);
            if (count > 0 && ((type == EditType.del && count > index) || (type == EditType.ins && count >= index)))
            {
                theOne = new Text(Document, Xml, count - HelperFunctions.GetSize(Xml));
                return;
            }

            if (Xml.HasElements)
                foreach (XElement e in Xml.Elements())
                    if (theOne == null)
                        GetFirstTextEffectedByEditRecursive(e, index, ref count, ref theOne);
        }
Ejemplo n.º 58
0
 public CommandHelper(string tableName, EditType editType)
 {
     TableName = tableName;
     EditType = editType;
 }
Ejemplo n.º 59
0
 public Column setEditType(EditType editType)
 {
     this._editType = editType;
     return this;
 }
Ejemplo n.º 60
0
        static internal XElement[] SplitRun(Run r, int index, EditType type = EditType.ins)
        {
            index = index - r.StartIndex;

            Text t = r.GetFirstTextEffectedByEdit(index, type);
            XElement[] splitText = Text.SplitText(t, index);

            XElement splitLeft = new XElement(r.Xml.Name, r.Xml.Attributes(), r.Xml.Element(XName.Get("rPr", DocX.w.NamespaceName)), t.Xml.ElementsBeforeSelf().Where(n => n.Name.LocalName != "rPr"), splitText[0]);
            if (Paragraph.GetElementTextLength(splitLeft) == 0)
                splitLeft = null;

            XElement splitRight = new XElement(r.Xml.Name, r.Xml.Attributes(), r.Xml.Element(XName.Get("rPr", DocX.w.NamespaceName)), splitText[1], t.Xml.ElementsAfterSelf().Where(n => n.Name.LocalName != "rPr"));
            if (Paragraph.GetElementTextLength(splitRight) == 0)
                splitRight = null;

            return
            (
                new XElement[]
                {
                    splitLeft,
                    splitRight
                }
            );
        }