当前位置: 首页>>代码示例>>C#>>正文


C# System.Collections.Generic.List.Clear方法代码示例

本文整理汇总了C#中System.Collections.Generic.System.Collections.Generic.List.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Generic.List.Clear方法的具体用法?C# System.Collections.Generic.List.Clear怎么用?C# System.Collections.Generic.List.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Generic.System.Collections.Generic.List的用法示例。


在下文中一共展示了System.Collections.Generic.List.Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GPGSA

 /// <summary>
 ///  GPS DOP and active satellites and parses an NMEA sentence
 /// </summary>
 /// <param name="NMEAsentence"></param>
 public GPGSA(string NMEAsentence)
 {
     _pRNInSolution = new List<string>();
     try
     {
         if (NMEAsentence.IndexOf('*') > 0)
             NMEAsentence = NMEAsentence.Substring(0, NMEAsentence.IndexOf('*'));
         //Split into an array of strings.
         string[] split = NMEAsentence.Split(new Char[] { ',' });
         if (split[1].Length > 0)
             _mode = split[1][0];
         else
             _mode = ' ';
         if (split[2].Length > 0)
         {
             switch (split[2])
             {
                 case "2": _fixMode = GSAFixModeEnum._2D; break;
                 case "3": _fixMode = GSAFixModeEnum._3D; break;
                 default: _fixMode = GSAFixModeEnum.FixNotAvailable; break;
             }
         }
         _pRNInSolution.Clear();
         for (int i = 0; i <= 11; i++)
             if(split[i + 3]!="")
                 _pRNInSolution.Add(split[i + 3]);
         GPSHandler.dblTryParse(split[15], out _pdop);
         GPSHandler.dblTryParse(split[16], out _hdop);
         GPSHandler.dblTryParse(split[17], out _vdop);
     }
     catch { }
 }
开发者ID:fivepmtechnology,项目名称:SharpGPS,代码行数:36,代码来源:GPGSA.cs

示例2: findLoadedParts

        private void findLoadedParts(string OboznOfPart)
        {
            if (!SQLOracle.existParamQuery("OBOZN", "DB_DATA", "OBOZN", OboznOfPart))
            {
                toolStripStatusLabel1.Text = "Модель не найдена!";

                string NMF = SQLOracle.ParamQuerySelect("SELECT NMF FROM KTC.MODEL_ATTR20 WHERE HD = :HD", "HD", OboznOfPart);

                if (SQLOracle.existParamQuery("NMF", "FILE_BLOB20", "NMF", NMF.Trim()))
                {
                    toolStripStatusLabel1.Text = "Модель создана и ожидает внесения информации в базу данных!";

                    System.Collections.Generic.List<string> AcquiredInformation = new System.Collections.Generic.List<string>();

                    treeOfModel.BeginUpdate();

                    treeOfModel.Nodes.Clear();

                    treeOfModel.Nodes.Add(NMF);

                    AcquiredInformation = SQLOracle.GetInformationListWithParamQuery("NMF", "MODEL_STRUCT20", "PARENT", (NMF));

                    for (int i = 0; i < AcquiredInformation.Count; i++)
                    {
                        treeOfModel.Nodes[0].Nodes.Add(AcquiredInformation[i].ToString());
                    }

                    AcquiredInformation.Clear();

                    treeOfModel.EndUpdate();

                    treeOfModel.Nodes[0].ExpandAll();
                }

            }
            else {

                toolStripStatusLabel1.Text = "Информация о модели уже внесена!";

            }
        }
开发者ID:Blyumenshteyn,项目名称:UchetUSP,代码行数:41,代码来源:FindLoadedModels.cs

示例3: voidCloseAPP

        public void voidCloseAPP()
        {
            if (SQLOracle.existParamQuery("FORM_SAVE", "USP_USER_SETTING", "FORM_SAVE = '1' AND USR ", "USR", SQLOracle.GetCurrentUser()))
            {

                System.Collections.Generic.List<string> parametr = new System.Collections.Generic.List<string>();
                System.Collections.Generic.List<string> value = new System.Collections.Generic.List<string>();

                string InputString = "UPDATE USP_USER_SETTING SET FORM_WIDTH = :FORM_WIDTH, FORM_HEIGHT = :FORM_HEIGHT WHERE USR = : USR  ";

                parametr.Add("FORM_WIDTH");
                value.Add(WidthForm.ToString());
                parametr.Add("FORM_HEIGHT");
                value.Add(HeightForm.ToString());
                parametr.Add("USR");
                value.Add(SQLOracle.GetCurrentUser());
                SQLOracle.UpdateQuery(InputString, parametr, value);
                parametr.Clear();
                value.Clear();
            }
        }
开发者ID:Blyumenshteyn,项目名称:UchetUSP,代码行数:21,代码来源:Setings.cs

示例4: GetSignature

        public static string GetSignature(string appkey, string appsecret,
        string userID)
        {
            System.Collections.Generic.List<string> arr = new System.Collections.Generic.List<string>();
            arr.Add(appkey.ToLower());
            arr.Add(appsecret.ToLower());
            arr.Sort();
            string appinfo = string.Join(string.Empty, arr.ToArray());

            appinfo = GetMd5(appinfo).ToLower();

            arr.Clear();
            arr.Add(appinfo);
            arr.Add(userID.ToLower());
            arr.Sort();

            string signature = string.Join(string.Empty, arr.ToArray());
            signature = GetSha1(signature).ToLower();

            return signature;
        }
开发者ID:yunxiaokeji,项目名称:IntFactory,代码行数:21,代码来源:Signature.cs

示例5: ProcessFile

    // modified to take first argument as a preprocessed buffer, instead of filename
    public void ProcessFile(string ncFile, List<clsMotionRecord> gfxRecs)
    {
        mGfxRecs = gfxRecs;
        mCodefile = ncFile;
        {
            mMotion.SubCall.Label = mCurMachine.Subcall[0];
            mMotion.SubCall.Value = int.Parse(mCurMachine.Subcall.Substring(1));

            mMotion.SubReturn.Label = mCurMachine.SubReturn[0];
            mMotion.SubReturn.Value = int.Parse(mCurMachine.SubReturn.Substring(1));

            mMotion.Abs.Label = mCurMachine.Absolute[0];
            mMotion.Abs.Value = int.Parse(mCurMachine.Absolute.Substring(1));
            mMotion.CCArc.Label = mCurMachine.CCArc[0];
            mMotion.CCArc.Value = int.Parse(mCurMachine.CCArc.Substring(1));
            mMotion.CWArc.Label = mCurMachine.CWArc[0];
            mMotion.CWArc.Value = int.Parse(mCurMachine.CWArc.Substring(1));

            mMotion.Inc.Label = mCurMachine.Incremental[0];
            mMotion.Inc.Value = int.Parse(mCurMachine.Incremental.Substring(1));

            mMotion.Linear.Label = mCurMachine.Linear[0];
            mMotion.Linear.Value = int.Parse(mCurMachine.Linear.Substring(1));

            mMotion.Rapid.Label = mCurMachine.Rapid[0];
            mMotion.Rapid.Value = int.Parse(mCurMachine.Rapid.Substring(1));

            mMotion.Rotary.Label = mCurMachine.Rotary[0];
            mMotion.Rotary.Value = 0;

            mMotion.DrillRapid.Label = mCurMachine.DrillRapid[0];
            mMotion.DrillRapid.Value = 0;

            mMotion.Plane[0].Label = mCurMachine.XYplane[0];
            mMotion.Plane[0].Value = int.Parse(mCurMachine.XYplane.Substring(1));
            mMotion.Plane[1].Label = mCurMachine.XZplane[0];
            mMotion.Plane[1].Value = int.Parse(mCurMachine.XZplane.Substring(1));
            mMotion.Plane[2].Label = mCurMachine.YZplane[0];
            mMotion.Plane[2].Value = int.Parse(mCurMachine.YZplane.Substring(1));

            mMotion.ReturnLevel[0].Label = mCurMachine.ReturnLevel[0][0];
            mMotion.ReturnLevel[0].Value = int.Parse(mCurMachine.ReturnLevel[0].Substring(1));
            mMotion.ReturnLevel[1].Label = mCurMachine.ReturnLevel[1][0];
            mMotion.ReturnLevel[1].Value = int.Parse(mCurMachine.ReturnLevel[1].Substring(1));

            for (int r = 0; r <= mMotion.Drills.Length - 1; r++)
            {
                if (mCurMachine.Drills[r].Length > 2)
                {
                    mMotion.Drills[r].Label = mCurMachine.Drills[r][0];
                    mMotion.Drills[r].Value = int.Parse(mCurMachine.Drills[r].Substring(1));
                }
            }
        }


        //Reset all positions. 
        mGfxRecs.Clear();
        mCurrentColor = 0;
        mPrevTool = -1;
        mXpos = 0;
        mYpos = 0;
        mZpos = 0;
        mPrevX = 0;
        mPrevY = 0;
        mPrevZ = 0;
        mPrevABC = 0;
        mABC = 0;
        mRpoint = 0;
        mSpeed = 0;
        mFeed = 0;
        mDrillClear = 0;
        mInitialZBeforeDrill = 0;
        mRotDir = 1;
        mAbsolute = true;
        mMode = Motion.RAPID;
        mDrillReturnMode = Motion.I_PLN;

        if (mCurMachine.MachineType == MachineType.MILL)
        {
            mPlane = Motion.XY_PLN; //Mill 
        }
        else
        {
            mPlane = Motion.XZ_PLN;//Lathe 
        }

        mEndmain = mCurMachine.Endmain.Trim();
        mSubcall = mCurMachine.Subcall.Trim();
        mSubRepeats = mCurMachine.SubRepeats.Trim();
		
        string sFileContents = null;
        sFileContents = FilterJunk(ncFile);
        
        mNcProgs.Clear();
        int lastIndex = -1;
        int thisIndex = -1;
        clsProg p = default(clsProg);
        foreach (Match m in this.mRegSubs.Matches(sFileContents))
//.........这里部分代码省略.........
开发者ID:fieldbob,项目名称:CNCInfusion,代码行数:101,代码来源:clsProcessor.cs

示例6: UpdateActivityPreferences

    private void UpdateActivityPreferences()
    {
        Ektron.Cms.Activity.ActivityTypeCriteria activityCollListCriteria = new Ektron.Cms.Activity.ActivityTypeCriteria();
        Ektron.Cms.Activity.ActivityTypeCriteria activityGroupListCriteria = new Ektron.Cms.Activity.ActivityTypeCriteria();
        long uId = 0;

        if ((!(Request.QueryString["id"] == null)) && Information.IsNumeric(Request.QueryString["id"]))
        {
            long.TryParse(Request.QueryString["id"], out uId);
        }

        activityCollListCriteria.AddFilter(Ektron.Cms.Activity.ActivityTypeProperty.Scope, CriteriaFilterOperator.EqualTo, EkEnumeration.ActivityActionSource.Colleague);
        activityGroupListCriteria.AddFilter(Ektron.Cms.Activity.ActivityTypeProperty.Scope, CriteriaFilterOperator.EqualTo, EkEnumeration.ActivityActionSource.CommunityGroup);

        collActivityTypeList = _activityListApi.GetList(activityCollListCriteria);
        groupActivityTypeList = _activityListApi.GetList(activityGroupListCriteria);
        if (uId > 0)
        {
            //Colleague Preferences
            preferenceList = new System.Collections.Generic.List<NotificationPreferenceData>();
            preferenceList.Clear();
            for (int i = 0; i <= collActivityTypeList.Count - 1; i++)
            {
                if ((Page.Request.Form["email" + collActivityTypeList[i].Id] != null) && Page.Request.Form["email" + collActivityTypeList[i].Id] == "on")
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = collActivityTypeList[i].Id;
                    prefData.AgentId = 1;
                    prefData.UserId = uId;
                    preferenceList.Add(prefData);
                }
                else
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = collActivityTypeList[i].Id;
                    prefData.DataState = Ektron.Cms.Common.EkEnumeration.DataState.Deleted;
                    prefData.AgentId = 1;
                    prefData.UserId = uId;
                    preferenceList.Add(prefData);
                }
                if ((Page.Request.Form["sms" + collActivityTypeList[i].Id] != null) && Page.Request.Form["sms" + collActivityTypeList[i].Id] == "on")
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = collActivityTypeList[i].Id;
                    prefData.AgentId = 3;
                    prefData.UserId = uId;
                    preferenceList.Add(prefData);
                }
                else
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = collActivityTypeList[i].Id;
                    prefData.DataState = Ektron.Cms.Common.EkEnumeration.DataState.Deleted;
                    prefData.AgentId = 3;
                    prefData.UserId = uId;
                    preferenceList.Add(prefData);
                }
                if ((Page.Request.Form["feed" + collActivityTypeList[i].Id] != null) && Page.Request.Form["feed" + collActivityTypeList[i].Id] == "on")
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = collActivityTypeList[i].Id;
                    prefData.AgentId = 2;
                    prefData.UserId = uId;
                    preferenceList.Add(prefData);
                }
                else
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = collActivityTypeList[i].Id;
                    prefData.DataState = Ektron.Cms.Common.EkEnumeration.DataState.Deleted;
                    prefData.AgentId = 2;
                    prefData.UserId = uId;
                    preferenceList.Add(prefData);
                }

            }
            //Group Preferences

            for (int i = 0; i <= groupActivityTypeList.Count - 1; i++)
            {

                if ((Page.Request.Form["email" + groupActivityTypeList[i].Id] != null) && Page.Request.Form["email" + groupActivityTypeList[i].Id] == "on")
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = groupActivityTypeList[i].Id;
                    prefData.AgentId = 1;
                    prefData.UserId = uId;
                    prefData.ActionSourceId = -1;
                    preferenceList.Add(prefData);
                }
                else
                {
                    prefData = new NotificationPreferenceData();
                    prefData.ActivityTypeId = groupActivityTypeList[i].Id;
                    prefData.DataState = Ektron.Cms.Common.EkEnumeration.DataState.Deleted;
                    prefData.AgentId = 1;
                    prefData.UserId = uId;
                    prefData.ActionSourceId = -1;
                    preferenceList.Add(prefData);
                }
//.........这里部分代码省略.........
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:users.aspx.cs

示例7: CreateListViewColumnTH

        /// <summary>
        /// Create columns for ListView
        /// </summary>
        private void CreateListViewColumnTH(string olvType, string sortColumnName, SortOrder order)
        {
            if (olvType == "Strings") this.olvTHStrings.AllColumns.Clear();
              if (olvType == "DLStrings") this.olvTHILStrings.AllColumns.Clear();
              if (olvType == "ILStrings") this.olvTHDLStrings.AllColumns.Clear();
              if (olvType == "OtherStrings") this.olvTHOtherStrings.AllColumns.Clear();

              string typeCol = "STR";
              if (olvType == "DLStrings") typeCol = "DL";
              if (olvType == "ILStrings") typeCol = "IL";
              if (olvType == "OtherStrings") typeCol = "OTHER";

              System.Collections.Generic.List<OLVColumn> listCol = new System.Collections.Generic.List<OLVColumn>();
              BrightIdeasSoftware.OLVColumn olvCol;
              BrightIdeasSoftware.OLVColumn primarySortColumn = null;
              BrightIdeasSoftware.OLVColumn secondarySortColumn = null;

              listCol.Clear();

              #region GroupName

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "GroupName";
              olvCol.Text = "Group";
              olvCol.Width = 100;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = true;
              olvCol.Name = "olvColGroup" + typeCol;
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Left;
              olvCol.Sortable = true;
              olvCol.Groupable = true;
              listCol.Add(olvCol);
              primarySortColumn = olvCol;

              #endregion

              #region StringStatus

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "StringStatus";
              olvCol.Text = "State";
              olvCol.Width = 50;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = true;
              olvCol.Name = "olvColStringStatus" + typeCol;
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Center;
              olvCol.Sortable = false;
              olvCol.Groupable = false;
              listCol.Add(olvCol);

              #endregion

              #region CompareStatusSource

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "CompareStatusSource";
              olvCol.Text = "Src <>";
              olvCol.Width = 50;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = true;
              olvCol.Name = "olvColCompareStatus" + typeCol;
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Center;
              olvCol.Sortable = false;
              olvCol.Groupable = false;
              listCol.Add(olvCol);

              #endregion

              #region CompareStatusSource

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "CompareStatusTarget";
              olvCol.Text = "Tgt <>";
              olvCol.Width = 50;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = true;
              olvCol.Name = "olvColCompareStatusTarget" + typeCol;
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Center;
              olvCol.Sortable = false;
              olvCol.Groupable = false;
              listCol.Add(olvCol);

              #endregion

              #region CompareStatusSource

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "RecordType";
              olvCol.Text = "Type";
              olvCol.Width = 60;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = true;
              olvCol.Name = "olvColRecordType" + typeCol;
//.........这里部分代码省略.........
开发者ID:SmaugNogardeht,项目名称:tesvsnip,代码行数:101,代码来源:TranslatorHelperFunctions.cs

示例8: LoadInformationToDB

        /// <summary>
        /// Загрузка данных в БД (запускается на статусе добавления данныз)
        /// </summary>      
        /// <returns></returns>   
        private void LoadInformationToDB()
        {
            if (string.Compare(CheckInformation(), "0") == 0)
            {
                bool successToLoadData = false;

                System.Collections.Generic.List<string> Parameters = new System.Collections.Generic.List<string>();

                System.Collections.Generic.List<string> DataFromTextBox = new System.Collections.Generic.List<string>();

                //Основные данные
                Parameters.Add("N_ACT"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(J8));
                Parameters.Add("OKUD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(Z10));
                Parameters.Add("UTV_DOLZNOST"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(U4));
                Parameters.Add("UTV_RAS_PODP"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(U6));
                Parameters.Add("ORAGANIZATION_HEAD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(D12));
                Parameters.Add("STRUCT_PODR_HEAD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(F14));
                Parameters.Add("DATA_SOST"); DataFromTextBox.Add(H22.Value.ToString());
                Parameters.Add("COD_VIDA_OPER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(K22));
                Parameters.Add("STRUCT_PODR"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(M22));
                Parameters.Add("NOMER_CEHA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(P22));
                Parameters.Add("VID_DEYAT"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(R22));
                Parameters.Add("CORRESP_SCHET"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(U22));
                Parameters.Add("COD_ZATRAT"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(Y22));
                Parameters.Add("PRICAZ_OT"); DataFromTextBox.Add(J26.Value.ToString());
                Parameters.Add("PRICAZ_YEAR"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(S26));
                Parameters.Add("KOL_PREDETOV"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(F86));
                Parameters.Add("NOM_ACT_VIB"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(F89));
                Parameters.Add("UTIL"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(F112));
                //Итог 1
                Parameters.Add("ITOG_KOL"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(J83));
                Parameters.Add("ITOG_DATA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(L83));
                Parameters.Add("ITOG_CENA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(N83));
                Parameters.Add("ITOG_SUM_CENA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(P83));
                Parameters.Add("ITOG_SUM_AMOR"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(R83));
                Parameters.Add("ITOG_SROK_SLUZ"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(T83));
                Parameters.Add("ITOG_PRIHINA_NAIMENOV"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(V83));
                Parameters.Add("ITOG_PRICH_COD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(X83));
                Parameters.Add("ITOG_SROK"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(Z83));
                //Итог 2
                Parameters.Add("ITOGTWO_KOL"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(S103));
                Parameters.Add("ITOGTWO_CENA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(U103));
                Parameters.Add("ITOGTWO_SUMMA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(X103));
                Parameters.Add("ITOGTWO_PORYAD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(Z103));

                string cmd = "INSERT INTO USP_ACTNASPISANIE_HEAD" +
                    "(N_ACT, OKUD, UTV_DOLZNOST, UTV_RAS_PODP, ORAGANIZATION_HEAD, STRUCT_PODR_HEAD, "+
                    "DATA_SOST, COD_VIDA_OPER, STRUCT_PODR, NOMER_CEHA, VID_DEYAT, CORRESP_SCHET, COD_ZATRAT, "+
                    "PRICAZ_OT, PRICAZ_YEAR, KOL_PREDETOV, NOM_ACT_VIB, UTIL, ITOG_KOL, ITOG_DATA, ITOG_CENA, ITOG_SUM_CENA, "+
                    "ITOG_SUM_AMOR, ITOG_SROK_SLUZ, ITOG_PRIHINA_NAIMENOV, ITOG_PRICH_COD, ITOG_SROK, ITOGTWO_KOL, ITOGTWO_CENA, ITOGTWO_SUMMA, ITOGTWO_PORYAD)"+
                    " VALUES (:N_ACT, :OKUD, :UTV_DOLZNOST, :UTV_RAS_PODP, :ORAGANIZATION_HEAD, :STRUCT_PODR_HEAD,"+
                    "  to_date(:DATA_SOST,'DD.MM.YYYY hh24:mi:ss'), :COD_VIDA_OPER, :STRUCT_PODR, :NOMER_CEHA, :VID_DEYAT, :CORRESP_SCHET, :COD_ZATRAT, "+
                    "to_date(:PRICAZ_OT,'DD.MM.YYYY hh24:mi:ss'), :PRICAZ_YEAR, :KOL_PREDETOV, :NOM_ACT_VIB, :UTIL, :ITOG_KOL, :ITOG_DATA, :ITOG_CENA, :ITOG_SUM_CENA, "+
                    ":ITOG_SUM_AMOR, :ITOG_SROK_SLUZ, :ITOG_PRIHINA_NAIMENOV, :ITOG_PRICH_COD, :ITOG_SROK, :ITOGTWO_KOL, :ITOGTWO_CENA, :ITOGTWO_SUMMA, :ITOGTWO_PORYAD)";

                successToLoadData = SQLOracle.InsertQuery(cmd, Parameters, DataFromTextBox);

                //MessageBox.Show("1");

                Parameters.Clear();
                DataFromTextBox.Clear();

                if (successToLoadData == true)
                    for (int i = 1; i < 6; i++)
                    {
                        if (successToLoadData == true)
                        {
                            string cmdDATA = "INSERT INTO USP_ACTNASPISANIE_DATA_ONE(ACT_NOMER,NUMBER_OF_PANEL," +
                                " PREDMET_NAIM, PREDMET_NOMEN_NOMER, PREDMET_INVENT_NOMER, ED_IZM_NAIM, ED_IZM_KOD, KOL_VO, DATA_POSTUPLENIYA, "+
                                "CENA, SUMMA_CENA_RUB, SUMMA_AMORTIZ, SROK_SLUZ, PRICH_SPIS_NAIM, PRICH_SPIS_KOD, NOMER_PASPORTA)" +
                                " VALUES(:ACT_NOMER,:NUMBER_OF_PANEL," +
                                " :PREDMET_NAIM, :PREDMET_NOMEN_NOMER, :PREDMET_INVENT_NOMER, :ED_IZM_NAIM, :ED_IZM_KOD, :KOL_VO,to_date(:DATA_POSTUPLENIYA,'DD.MM.YYYY hh24:mi:ss')," +
                                " :CENA, :SUMMA_CENA_RUB, :SUMMA_AMORTIZ, :SROK_SLUZ, :PRICH_SPIS_NAIM, :PRICH_SPIS_KOD, :NOMER_PASPORTA)";

                            Parameters.Add("ACT_NOMER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(J8));
                            Parameters.Add("NUMBER_OF_PANEL"); DataFromTextBox.Add((i).ToString());

                            Parameters.Add("PREDMET_NAIM"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("A" + ((4 * (i - 1))+36).ToString()), true)[0])));
                            Parameters.Add("PREDMET_NOMEN_NOMER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("A" + ((4 * (i - 1))+38).ToString()), true)[0])));
                            Parameters.Add("PREDMET_INVENT_NOMER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("F" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("ED_IZM_NAIM"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("H" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("ED_IZM_KOD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("H" + ((4 * (i - 1)) + 38).ToString()), true)[0])));
                            Parameters.Add("KOL_VO"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("J" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("DATA_POSTUPLENIYA"); DataFromTextBox.Add(((System.Windows.Forms.DateTimePicker)(this.tabPage1.Controls.Find(("L" + ((4 * (i - 1)) + 36).ToString()), true)[0])).Value.ToString());
                            Parameters.Add("CENA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("N" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("SUMMA_CENA_RUB"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("P" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("SUMMA_AMORTIZ"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("R" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("SROK_SLUZ"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("T" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("PRICH_SPIS_NAIM"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("V" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("PRICH_SPIS_KOD"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("X" + ((4 * (i - 1)) + 36).ToString()), true)[0])));
                            Parameters.Add("NOMER_PASPORTA"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)(this.tabPage1.Controls.Find(("Z" + ((4 * (i - 1)) + 36).ToString()), true)[0])));

                            successToLoadData = SQLOracle.InsertQuery(cmdDATA, Parameters, DataFromTextBox);

                            Parameters.Clear();
                            DataFromTextBox.Clear();
//.........这里部分代码省略.........
开发者ID:Blyumenshteyn,项目名称:UchetUSP,代码行数:101,代码来源:ActSpisanie.cs

示例9: Update

        // Update is called once per frame
        private void Update()
        {
            if (_Instance == null)
                Init();

            var notification = PopNotification();
            if (!string.IsNullOrEmpty(notification))
            {
                Debug.Log(notification);
                ShowNotification(new GUIContent(notification));
            }

            if (!string.IsNullOrEmpty(UpdateMessage))
            {
                Debug.Log(UpdateMessage);
                UpdateMessage = string.Empty;
            }

            if ((DateTime.Now - LastEllipses).Milliseconds > 500)
            {
                LastEllipses = DateTime.Now;
                EllipsesCount += 1;
                if (EllipsesCount > 5)
                    EllipsesCount = 2;
                Ellipses = string.Empty;
                for (var i = 0; i < EllipsesCount; ++i)
                    Ellipses += ".";
                Repaint();
            }

            // Detect Skin Changes
            var oldUseDarkSkin = UseDarkSkin;
            if (EditorGUIUtility.isProSkin)
            {
                UseDarkSkin = true;
                if(oldUseDarkSkin != UseDarkSkin)
                    LoadStyles();
            }

            if (IsDirty)
            {
                Google2uGUIUtil.Save();
                IsDirty = false;
            }

            // Prevent Google2u from doing anything while in play mode
            if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling)
                return;

            if ((DateTime.Now - LastCheckedRSS).Hours > 0)
            {
                LastCheckedRSS = DateTime.Now;
                var t = new Thread(CheckForService);
                t.Start();
            }

            if (InstanceData.Commands.Contains(GFCommand.DoLogout))
            {
                InstanceData.Commands.Remove(GFCommand.DoLogout);
                var t = new Thread(DoLogout) { Name = "DoLogout" };
                t.Start(InstanceData);
            }

            if (InstanceData.Commands.Contains(GFCommand.RetrieveWorkbooks))
            {
                InstanceData.Commands.Remove(GFCommand.RetrieveWorkbooks);
                InstanceData.Commands.Add(GFCommand.WaitForRetrievingWorkbooks);
                InstanceData.AccountWorkbooks.Clear();
                var t = new Thread(DoWorkbookQuery) { Name = "RetrieveWorkbooks" };
                t.Start(InstanceData);
            }

            if (InstanceData.Commands.Contains(GFCommand.RetrieveManualWorkbooks))
            {
                InstanceData.Commands.Remove(GFCommand.RetrieveManualWorkbooks);
                InstanceData.Commands.Add(GFCommand.WaitForRetrievingManualWorkbooks);
                var t = new Thread(DoManualWorkbookRetrieval) { Name = "ManualWorkbookRetrieval" };
                t.Start(InstanceData);
            }

            if (InstanceData.Commands.Contains(GFCommand.ManualWorkbooksRetrievalComplete))
            {
                InstanceData.Commands.Remove(GFCommand.ManualWorkbooksRetrievalComplete);
                var manualWorkbooksString = InstanceData.ManualWorkbooks.Aggregate(string.Empty, (in_current, in_wb) => in_current + (in_wb.WorkbookUrl + "|"));
                Google2uGUIUtil.SetString(InstanceData.ProjectPath + "_ManualWorkbookCache", manualWorkbooksString);
            }

            if (InstanceData.Commands.Contains(GFCommand.DoUpload))
            {
                InstanceData.Commands.Remove(GFCommand.DoUpload);
                InstanceData.Commands.Add(GFCommand.WaitingForUpload);
                var t = new Thread(DoWorkbookUpload) {Name = "WorkbookUpload"};
                t.Start(InstanceData);
            }

            if (InstanceData.Commands.Contains(GFCommand.UploadComplete))
            {
                InstanceData.Commands.Remove(GFCommand.UploadComplete);
                InstanceData.WorkbookUploadProgress = 0;
//.........这里部分代码省略.........
开发者ID:DarkRay,项目名称:neverending-story,代码行数:101,代码来源:Google2u.cs

示例10: pingHengZhiShu

        //平衡指数
        public string[] pingHengZhiShu()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();
            string[] allNum = fanBianQiuCal();

            int overMy = 0;
            List<int> nums = new List<int>();
            foreach (Control ctls in this.pHZSGpb.Controls)
            {
                bool isNum = isNumber(ctls.Text);
                if (ctls is CheckBox)
                {
                    if ((ctls as CheckBox).Checked == true && isNum == true)
                    {
                        nums.Add(Convert.ToInt16(ctls.Text));
                    }
                }
            }

            if (nums.Count == 1)
            {
                if (nums.Contains(1))
                {
                    if (jiaCkb.Checked == true)
                    {
                        overMy++;
                        result.AddRange(phJia());
                    }

                    if (jianCkb.Checked == true)
                    {
                        overMy++;
                        result.AddRange(phJian());
                    }

                    if (dengCkb.Checked == true)
                    {
                        overMy++;
                        result.AddRange(phDeng());
                    }
                }

                if (nums.Contains(0))
                {
                    if (jiaCkb.Checked == true)
                    {
                        overMy++;
                        result.AddRange(phJia());
                    }

                    if (jianCkb.Checked == true)
                    {
                        overMy++;
                        result.AddRange(phJian());
                    }

                    if (dengCkb.Checked == true)
                    {
                        overMy++;
                        result.AddRange(phDeng());
                    }

                    List<string> temp = new List<string>();
                    temp.AddRange(chaHe());
                    for (int i = 0; i < result.Count(); i++)
                    {
                        temp.Remove(result[i]);
                    }
                    result.Clear();
                    result.AddRange(temp);
                }

            }

            if (nums.Count == 2)
            {
                result.AddRange(allNum);
            }

            if (overMy == 0)
                result.AddRange(allNum);

            List<string> result1 = result.Distinct().ToList();//去除重复项
            result1.Sort();
            return result1.ToArray();
        }
开发者ID:svn2github,项目名称:eztx,代码行数:87,代码来源:page3.cs

示例11: UpdateInformationInDB

        //функция обновления данных
        private void UpdateInformationInDB()
        {
            if (string.Compare(CheckInformation(), "0") != 0)
            {
                bool successToLoadData = false;

                System.Collections.Generic.List<string> Parameters = new System.Collections.Generic.List<string>();

                System.Collections.Generic.List<string> DataFromTextBox = new System.Collections.Generic.List<string>();

                string cmd = "UPDATE KTC.USP_NAKLADNAYA_HEAD SET " +
                " ORGANIZATION = :ORGANIZATION, " +
                " DATA_SOSTAVLENIYA = to_date(:DATA_SOSTAVLENIYA,'DD.MM.YYYY hh24:mi:ss'), " +
                " COD_VIDA_OPER = :COD_VIDA_OPER, " +
                " OTPRAV_STRUCT_PODR = :OTPRAV_STRUCT_PODR, " +
                " OTPRAV_VID_DEYAT = :OTPRAV_VID_DEYAT, " +
                " SHIFR_POLUCH = :SHIFR_POLUCH, " +
                " SHIFR_POTREB = :SHIFR_POTREB, " +
                " VID_DEYAT = :VID_DEYAT, " +
                " UCH_ED_VIP = :UCH_ED_VIP, " +
                " PORYAD_NUM = :PORYAD_NUM, " +
                " CHEREZ_KOGO = :CHEREZ_KOGO, " +
                " ZATREBOVAL = :ZATREBOVAL, " +
                " RAZRESHIL = :RAZRESHIL, " +
                " OTPUSTIL_DATE = to_date(:OTPUSTIL_DATE,'DD.MM.YYYY hh24:mi:ss'), " +
                " OTPUSTIL_FAM = :OTPUSTIL_FAM, " +
                " POLUCHIL_DATE = to_date(:POLUCHIL_DATE,'DD.MM.YYYY hh24:mi:ss'), " +
                " POLUCHIL_FAM = :POLUCHIL_FAM " +
                " WHERE NOMER_TREBOV_NAKLADNOI = :NOMER_TREBOV_NAKLADNOI";

                Parameters.Add("ORGANIZATION"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(textBox1));
                Parameters.Add("DATA_SOSTAVLENIYA"); DataFromTextBox.Add(PanelN1One.Value.ToString());
                Parameters.Add("COD_VIDA_OPER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1two));
                Parameters.Add("OTPRAV_STRUCT_PODR"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1three));
                Parameters.Add("OTPRAV_VID_DEYAT"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1four));
                Parameters.Add("SHIFR_POLUCH"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1five));
                Parameters.Add("SHIFR_POTREB"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1FiveA));
                Parameters.Add("VID_DEYAT"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1Six));
                Parameters.Add("UCH_ED_VIP"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1Seven));
                Parameters.Add("PORYAD_NUM"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1sevenA));
                Parameters.Add("CHEREZ_KOGO"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(textBox2));
                Parameters.Add("ZATREBOVAL"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(textBox3));
                Parameters.Add("RAZRESHIL"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(textBox4));
                Parameters.Add("OTPUSTIL_DATE"); DataFromTextBox.Add(dateTimePicker1.Value.ToString());
                Parameters.Add("OTPUSTIL_FAM"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(textBox245));
                Parameters.Add("POLUCHIL_DATE"); DataFromTextBox.Add(dateTimePicker2.Value.ToString());
                Parameters.Add("POLUCHIL_FAM"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(textBox246));
                Parameters.Add("NOMER_TREBOV_NAKLADNOI"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr(PanelN1OneA));

                successToLoadData = SQLOracle.UpdateQuery(cmd, Parameters, DataFromTextBox);

                Parameters.Clear();
                DataFromTextBox.Clear();

                if (successToLoadData == true)
                    for (int i = 0; i < 16; i++)
                    {
                        string cmdDATA = "UPDATE KTC.USP_NAKLADNAYA_DATA SET   ";

                        for (int j = 0; j < ((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls.Count; j++)
                        {

                            int TagOfObject = (Convert.ToInt32(((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j].Tag));

                            if (TagOfObject == 0)
                            {
                                //Корресп. Счет, суб-счет, код аналит. Учета
                                Parameters.Add("KORRESP_SCHET"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j]));

                                cmdDATA += "KORRESP_SCHET = :KORRESP_SCHET, ";
                            }
                            else if (TagOfObject == 1)
                            {
                                //Материальные ценности наименование (9)
                                Parameters.Add("MATERR_CENNOSTI"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j]));
                                cmdDATA += "MATERR_CENNOSTI = :MATERR_CENNOSTI, ";
                            }
                            else if (TagOfObject == 2)
                            {
                                //код материала
                                Parameters.Add("COD_MATER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j]));
                                cmdDATA += "COD_MATER = :COD_MATER, ";
                            }
                            else if (TagOfObject == 3)
                            {
                                //заводской номер
                                Parameters.Add("ZAVOD_NOMER"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j]));
                                cmdDATA += "ZAVOD_NOMER = :ZAVOD_NOMER, ";
                            }
                            else if (TagOfObject == 4)
                            {
                                //Ед. изм. Наимен. Код
                                Parameters.Add("ED_IZM_NAIM_1"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j]));
                                cmdDATA += "ED_IZM_NAIM_1 = :ED_IZM_NAIM_1, ";
                            }
                            else if (TagOfObject == 5)
                            {
                                //Ед. изм. Наимен. Код
                                Parameters.Add("ED_IZM_NAIM_2"); DataFromTextBox.Add(PriemSpisanie.IsNullParametr((System.Windows.Forms.TextBox)((System.Windows.Forms.Panel)(this.Controls.Find(("panelN" + (i + 2).ToString()), true)[0])).Controls[j]));
//.........这里部分代码省略.........
开发者ID:Blyumenshteyn,项目名称:UchetUSP,代码行数:101,代码来源:AddNakladnaya.cs

示例12: DeleteElementFromDB

        public static void DeleteElementFromDB(System.Windows.Forms.DataGridView dgv)
        {
            using (WinForms.Common.InputBox InputnumberOfElements = new UchetUSP.WinForms.Common.InputBox("Удаление элементов", "Удалить", "Количество удаляемых элементов"))
            {

                if (InputnumberOfElements.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (string.Compare(InputnumberOfElements.textBox1.Text, "") != 0)
                    {
                        if (Convert.ToInt32(dgv[19, dgv.SelectedCells[0].RowIndex].Value.ToString()) >= Convert.ToInt32(InputnumberOfElements.textBox1.Text))
                        {
                            System.Collections.Generic.List<string> Parameters = new System.Collections.Generic.List<string>();

                            System.Collections.Generic.List<string> DataFromTextBox = new System.Collections.Generic.List<string>();

                            int NalichieParam = 0;

                            NalichieParam = (Convert.ToInt32(dgv[19, dgv.SelectedCells[0].RowIndex].Value.ToString()) - Convert.ToInt32(InputnumberOfElements.textBox1.Text));

                            Parameters.Add("NALICHI"); DataFromTextBox.Add(NalichieParam.ToString());
                            Parameters.Add("OBOZN"); DataFromTextBox.Add(dgv[1, dgv.SelectedCells[0].RowIndex].Value.ToString());

                            string cmd = "UPDATE DB_DATA SET NALICHI =:NALICHI WHERE OBOZN = :OBOZN";

                            if (SQLOracle.UpdateQuery(cmd, Parameters, DataFromTextBox) == true)
                            {
                                System.Windows.Forms.MessageBox.Show("ОБновление данных прошло успешно!");
                            }

                            Parameters.Clear();
                            DataFromTextBox.Clear();
                        }

                    }

                }

            }
        }
开发者ID:Blyumenshteyn,项目名称:UchetUSP,代码行数:39,代码来源:ElmInform.cs

示例13: RemoveNodesByLocalAddress

 public void RemoveNodesByLocalAddress(ObjectList<LocalAddress> addressesSource, ObjectList<LocalAddress> la)
 {
     System.Collections.Generic.List<LocalAddress> list = new System.Collections.Generic.List<LocalAddress>();
     foreach (LocalAddress address in la)
     {
         LocalAddress address2 = address;
         while (true)
         {
             LocalAddress parent = address2.GetParent();
             if (parent == LocalAddress.Null)
             {
                 break;
             }
             list.Add(parent);
             address2 = parent;
         }
         if (list.get_Count() == 0)
         {
             this.Load(addressesSource, false);
             return;
         }
         for (int i = (int) (list.get_Count() - 1); i >= 0; i = (int) (i - 1))
         {
             this.GetNodeByAddress(list.get_Item(i)).OnBeforeExpand();
         }
         AddressesNode nodeByAddress = this.GetNodeByAddress(address);
         if (nodeByAddress != null)
         {
             this.RemoveNode(nodeByAddress);
         }
         list.Clear();
     }
     if (this.OnChangeSelectAddresses != null)
     {
         this.OnChangeSelectAddresses();
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:37,代码来源:AreaAddressesTree.cs

示例14: ButtonCommitClicked

		bool ButtonCommitClicked ()
		{
			// In case we have local unsaved files with changes, throw a dialog for the user.
			System.Collections.Generic.List<Document> docList = new System.Collections.Generic.List<Document> ();
			foreach (var item in IdeApp.Workbench.Documents) {
				if (!item.IsDirty || !selected.Contains (item.FileName))
					continue;
				docList.Add (item);
			}

			if (docList.Count != 0) {
				AlertButton response = MessageService.GenericAlert (
					MonoDevelop.Ide.Gui.Stock.Question,
					GettextCatalog.GetString ("You are trying to commit files which have unsaved changes."),
					GettextCatalog.GetString ("Do you want to save the changes before committing?"),
					new AlertButton[] {
						AlertButton.Cancel,
						new AlertButton ("Don't Save"),
						AlertButton.Save
					}
				);

				if (response == AlertButton.Cancel)
					return false;

				if (response == AlertButton.Save) {
					// Go through all the items and save them.
					foreach (var item in docList)
						item.Save ();

					// Check if save failed on any item and abort.
					foreach (var item in docList)
						if (item.IsDirty) {
							MessageService.ShowMessage (GettextCatalog.GetString (
								"Some files could not be saved. Commit operation aborted"));
							return false;
						}
				}

				docList.Clear ();
			}

			// Update the change set
			List<FilePath> todel = new List<FilePath> ();
			foreach (ChangeSetItem it in changeSet.Items) {
				if (!selected.Contains (it.LocalPath))
					todel.Add (it.LocalPath);
			}
			foreach (string file in todel)
				changeSet.RemoveFile (file);
			changeSet.GlobalComment = Message;
			
			// Perform the commit
			
			int n;
			for (n=0; n<extensions.Count; n++) {
				CommitDialogExtension ext = extensions [n];
				bool res;
				try {
					res = ext.OnBeginCommit (changeSet);
				} catch (Exception ex) {
					LoggingService.LogInternalError (ex);
					res = false;
				}
				if (!res) {
					// Commit failed. Rollback the previous extensions
					for (int m=0; m<n; m++) {
						ext = extensions [m];
						try {
							ext.OnEndCommit (changeSet, false);
						} catch {}
					}
					return false;
				}
			}
			return true;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:77,代码来源:CommitDialog.cs

示例15: CreateListViewColumn

        /// <summary>
        /// Create columns for ListView
        /// </summary>
        private void CreateListViewColumn()
        {
            this.olvSkyrimDict.AllColumns.Clear();
              this.olvTHSkyrimSourceStrings.AllColumns.Clear();
              this.olvTHSkyrimTargetStrings.AllColumns.Clear();

              string typeCol = String.Empty;

              System.Collections.Generic.List<OLVColumn> listCol = new System.Collections.Generic.List<OLVColumn>();
              BrightIdeasSoftware.OLVColumn olvCol;
              BrightIdeasSoftware.OLVColumn primarySortColumn;

              #region olvTHSkyrimSourceStrings / olvTHSkyrimTargetStrings

              for (int i = 0; i < 2; i++)
              {
            listCol.Clear();

            olvCol = new BrightIdeasSoftware.OLVColumn();
            olvCol.AspectName = "StringID";
            olvCol.Text = "ID";
            olvCol.Width = 60;
            olvCol.HeaderTextAlign = HorizontalAlignment.Center;
            olvCol.Groupable = false;
            olvCol.Name = "olvColSkyrimSourceStringsIDHexa";
            olvCol.HeaderFormatStyle = headerFormatStyleData2;
            olvCol.TextAlign = HorizontalAlignment.Center;
            olvCol.Sortable = true;
            listCol.Add(olvCol);

            olvCol = new BrightIdeasSoftware.OLVColumn();
            olvCol.AspectName = "SkyrimText";
            olvCol.Text = "Text";
            olvCol.Width = 450;
            olvCol.HeaderTextAlign = HorizontalAlignment.Center;
            olvCol.Groupable = false;
            olvCol.Name = "olvColSkyrimSourceStringsText";
            olvCol.HeaderFormatStyle = headerFormatStyleData2;
            olvCol.TextAlign = HorizontalAlignment.Left;
            olvCol.Sortable = true;
            listCol.Add(olvCol);
            primarySortColumn = olvCol;

            if (i == 0)
            {
              this.olvTHSkyrimSourceStrings.AllColumns.AddRange(listCol);
              this.olvTHSkyrimSourceStrings.RebuildColumns();
            }

            if (i == 1)
            {
              this.olvTHSkyrimTargetStrings.AllColumns.AddRange(listCol);
              this.olvTHSkyrimTargetStrings.RebuildColumns();
            }
              }
              #endregion

              #region olvSkyrimDict

              listCol.Clear();

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "StringID";
              olvCol.Text = "ID";
              olvCol.Width = 60;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = false;
              olvCol.Name = "olvColSkyrimStringIDHexa";
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Center;
              olvCol.Sortable = true;
              listCol.Add(olvCol);

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "SourceString";
              olvCol.Text = "Source";
              olvCol.Width = 240;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = false;
              olvCol.Name = "olvColSkyrimItemDescSourceLang";
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Left;
              olvCol.Sortable = true;
              listCol.Add(olvCol);
              primarySortColumn = olvCol;

              olvCol = new BrightIdeasSoftware.OLVColumn();
              olvCol.AspectName = "TargetString";
              olvCol.Text = "Target";
              olvCol.Width = 240;
              olvCol.HeaderTextAlign = HorizontalAlignment.Center;
              olvCol.Groupable = false;
              olvCol.Name = "olvColSkyrimItemDescTargetLang";
              olvCol.HeaderFormatStyle = headerFormatStyleData;
              olvCol.TextAlign = HorizontalAlignment.Left;
              olvCol.Sortable = true;
              listCol.Add(olvCol);
//.........这里部分代码省略.........
开发者ID:SmaugNogardeht,项目名称:tesvsnip,代码行数:101,代码来源:TranslatorHelperFunctions.cs


注:本文中的System.Collections.Generic.System.Collections.Generic.List.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。