C# (CSharp) System Code Examples

C# (CSharp) System - 30 examples found. These are the top rated real world C# (CSharp) examples of System extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
0
        public Func<string> First()
        {
            var sources = new[] { this.Male(), this.Female() };
            var factory = _random.Numbers.Integers(max: sources.Length);

            return () => sources[factory()]();
        }
Example #2
0
 public static void SomeFunction(GetMahNumber getit, NamespaceDlg getitnow, TemplatedDelegate<float> unused)
 {
     Console.WriteLine(getit(getitnow()));
     var a = new[] { getitnow };
     a[0]();
     StaticAction();
     Utilities.StaticAction();
     Blargh.Utilities.StaticAction();
 }
    static void RunCode(string code)
    {
        int accumulator = 0;
        var opcodes = new Dictionary<char, Action>
        {
            {'H', () => Console.WriteLine("Hello, World!"))},
            {'Q', () => Console.WriteLine(code) },
            {'9', () => Console.WriteLine(Enumerable.Range(1,100).Reverse().Select(n => string.Format("{0} bottles of beer on the wall\n{0} bottles of beer\nTake one down, pass it around\n{1} bottles of beer on the wall\n", n, n-1)).Aggregate((a,b) => a + "\n" + b))},
            {'+', () => accumulator++ }
        }

        foreach(var c in code)
            opcodes[c]();
    }
 /// <summary>
 /// 随机生成生成简单密码
 /// </summary>
 /// <param name="length"></param>
 /// <returns></returns>
 public string CreateTemporaryPassword(int length)
 {
     Func<Random, char> randomNumber = rnd => (char)rnd.Next(48, 58);
     Func<Random, char> randomCharacter = rnd => (char)rnd.Next(97, 123);
     var funcArray = new[] { randomNumber, randomCharacter };
     var chars = new char[length];
     Random random = new Random();
     for (int i = 0; i < length; i++)
     {
         var index = random.Next(0, funcArray.Length);
         chars[i] = funcArray[index](random);
     }
     return new string(chars);
 }
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         myLoginID=Session["LoginID"].ToString();
     }
     catch
     {
     }
     if (myLoginID=="")
     {
         Response.Redirect("../Login.aspx");
     }
     intSubjectID=Convert.ToInt32(Request["SubjectID"]);
     strSubjectName=Convert.ToString(Request["SubjectName"]);
     labSubject.Text=Convert.ToString(Request["SubjectName"]);
     if (!IsPostBack)
     {
         //if (ObjFun.GetValues("select UserType from UserInfo where LoginID='"+myLoginID+"' and UserType=1 and (RoleMenu=1 or (RoleMenu=2 and Exists(select OptionID from UserPower where UserID=UserInfo.UserID and PowerID=3 and OptionID=3)))","UserType")!="1")
         //{
         //    Response.Write("<script>alert('�Բ�����û�д˲���Ȩ�ޣ�')</script>");
         //    Response.End();
         //}
         //else
         //{
             if (intSubjectID!=0)
             {
                 CountTestType(intSubjectID);//����������ͳ��
                 CountTestLore(intSubjectID);//������֪ʶ��ͳ��
                 CountTestDiff(intSubjectID);//�������Ѷ�ͳ��
             }
         //}
     }
 }
Example #6
0
        public static void WriteException(System.Exception e)
        {
            ArrayList messages = new ArrayList();
            while (e != null)
            {
                messages.Add(e);
                e = e.InnerException;
            }
            Console.WriteLine(" ");
            Console.WriteLine("------- System.Exception ----------------------------- ");
            messages.Reverse();

            foreach (System.Exception ex in messages)
            {
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine(" ");
            Console.WriteLine("----- Details -----");
            foreach (System.Exception ex in messages)
            {
                Console.WriteLine("Message..........: " + ex.Message);
                Console.WriteLine("Stact trace......: " + ex.StackTrace);
                Console.WriteLine("TargetSite.......: " + ex.TargetSite.Name);
                Console.WriteLine("Source...........: " + ex.Source);
                Console.WriteLine(" ");
            }
        }
Example #7
0
        public IEnumerable<SelectListItem> GetSelectListItems(System.Web.Routing.RequestContext requestContext, string filter = null)
        {
            var siteName = requestContext.GetRequestValue("siteName");

            var site = new Site(siteName).AsActual();

            IEnumerable<Page> pageList = new List<Page>();

            var rootPages = Kooboo.CMS.Sites.Services.ServiceFactory.PageManager.All(site, null);

            pageList = rootPages.ToList();

            foreach (var r in rootPages)
            {
                this.GenerateList(site, r, ref pageList);
            }

            if (filter == null)
            {
                return null;
            }

            var result = pageList.Where(o => o.VirtualPath.StartsWith(filter, StringComparison.OrdinalIgnoreCase)).Select(o => new SelectListItem { Text = o.VirtualPath, Value = o.VirtualPath });

            return result;
        }
Example #8
0
 public void OnMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     var mouseState = Mouse.GetState();
     var keyboardState = Keyboard.GetState();
     var currentMouseCoordinate = new Vector2(e.X, e.Y);
     if (keyboardState.IsKeyDown(Key.ShiftLeft) && (mouseState[MouseButton.Middle] || (mouseState[MouseButton.Left] && keyboardState[Key.ControlLeft])))
     {
         var d = 5;
         var previousMouseWorldCoordinate = Maths.Project(ViewMatrix, Viewport.ProjectionMatrix, previousMouseCoordinate, (Rectangle)Viewport, Maths.ProjectionTarget.View);
         var mouseWorldCoordinate = Maths.Project(ViewMatrix, ProjectionMatrix, currentMouseCoordinate, (Rectangle)Viewport, Maths.ProjectionTarget.View);
         var delta = mouseWorldCoordinate - previousMouseWorldCoordinate;
         delta *= d;
         panTrack.Update(delta.X, delta.Y);
     }
     else if (keyboardState.IsKeyDown(Key.AltLeft) && (mouseState[MouseButton.Middle] || (mouseState[MouseButton.Left] && keyboardState[Key.ControlLeft])))
     {
         var previousMouseWorldCoordinate = Maths.Project(ViewMatrix, Viewport.ProjectionMatrix, previousMouseCoordinate, (Rectangle)Viewport, Maths.ProjectionTarget.View);
         var mouseWorldCoordinate = Maths.Project(ViewMatrix, ProjectionMatrix, currentMouseCoordinate, (Rectangle)Viewport, Maths.ProjectionTarget.View);
         var delta = mouseWorldCoordinate - previousMouseWorldCoordinate;
         delta *= 10;
         zoomTrack.Update(delta.Y);
     }
     else if (mouseState[MouseButton.Middle] || (mouseState[MouseButton.Left] && keyboardState[Key.ControlLeft]))
     {
         var delta = currentMouseCoordinate - previousMouseCoordinate;
         //delta *= 10;
         orbitTrack.Update(delta.X, delta.Y);
     }
     if (this.MouseMove != null) this.MouseMove(this, new MouseEventArgs(this, new Vector2(e.X, e.Y), default(Vector3), e.Button));
     previousMouseCoordinate = currentMouseCoordinate;
 }
Example #9
0
 public override void TouchUp(System.Drawing.PointF global, System.Drawing.PointF relative)
 {
     var videoControl = Source.FindParent<HotelVideoControl>() as HotelVideoControl;
     if (videoControl == null) return;
     videoControl.UnTouchSlider();
     base.TouchUp(global, relative);
 }
 public object[] ConvertBack(object value,
                             Type[] targetTypes,
                             object parameter,
                             System.Globalization.CultureInfo culture)
 {
     throw new NotSupportedException();
 }
Example #11
0
 public SqlStatement BuildDeleteCommand(NonQueryLinqCommandData commandData)
 {
     var sqlWhere = string.Empty;
       if(commandData.IsSingleTableCommand) {
     var whereList = commandData.BaseSelect.Where;
     if(whereList.Count > 0) {
       var tables = new[] { commandData.TargetTable };
       sqlWhere = "\r\n  " + BuildWhere(tables, whereList);
     }
       } else {
     //multiple tables version
     // base query must return set of PK values
     var targetEnt = commandData.TargetTable.TableInfo.Entity;
     Util.Check(targetEnt.PrimaryKey.ExpandedKeyMembers.Count == 1,
       "DELETE LINQ query with multiple tables cannot be used for table with composite primiry key. Entity: {0}", targetEnt.EntityType);
     var pk = targetEnt.PrimaryKey.ExpandedKeyMembers[0].Member;
     var outExpr = commandData.BaseSelect.Reader.Body;
     Util.Check(outExpr.Type == pk.DataType,
       "DELETE Query with multiple tables must return a value compatible with primary key of the table." +
       " Query returns: {0}; Primary key type: {1}, entity: {2}", outExpr.Type, pk.DataType, targetEnt.EntityType);
     var subQueryStmt = BuildSelect(commandData.BaseSelect);
     var subQuery = subQueryStmt.ToString();
     var pkCol = commandData.TargetTable.TableInfo.GetColumnByMemberName(pk.MemberName);
     Util.Check(pkCol != null, "Internal error in Linq engine: failed to find PK column for PK member {0}, entity {1}",
          pk.MemberName, targetEnt.EntityType);
     var strPkCol = _sqlProvider.GetColumn(pkCol.ColumnName);
     sqlWhere = string.Format("   WHERE {0} IN (\r\n{1})",  strPkCol, subQuery);
       }
       var tblInfo = commandData.TargetTable.TableInfo;
       var sql =string.Format("DELETE FROM {0} {1};", tblInfo.FullName, sqlWhere);
       return new SqlStatement(sql);
 }
        public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext)
        {

            if (actionContext.ModelState.IsValid) return;

            var errors = actionContext.ModelState
                .Where(e => e.Value.Errors.Count > 0)
                .Select(e => new Error
                {
                    Name = e.Key,
                    Message = e.Value.Errors.First().ErrorMessage ?? e.Value.Errors.First().Exception.Message
                }).ToArray();

            var strErrors = new StringBuilder();
            foreach (var error in errors)
            {
                var errorM = String.IsNullOrEmpty(error.Message) ? "Invalid Value" : error.Message;
                strErrors.Append(string.Format("[{0}]:{{{1}}}/", error.Name, errorM));
            }
            actionContext.Response = new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.BadRequest,
                ReasonPhrase = strErrors.ToString(),
                Content = new StringContent(strErrors.ToString())
            };
        }
Example #13
0
        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            base.OnBackKeyPress(e);

            var isHidden = false;

            try
            {
                if (_avatarControl != null)
                isHidden = _avatarControl.IsHidden;
            }
            catch (Exception)
            {
                Application.Current.Terminate();
            }

            if (isHidden)
            {
                e.Cancel = true;

                PopupManager.Instance.Hide();
            }
            else 
                Application.Current.Terminate();
        }
Example #14
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            App.SelectedRoom = string.Empty;

            if (IsolatedStorageSettings.ApplicationSettings.Contains("NickName"))
            {
                TxtNickname.Text = IsolatedStorageSettings.ApplicationSettings["NickName"].ToString();
                TxtAge.Text = IsolatedStorageSettings.ApplicationSettings["Age"].ToString();
                TxtAvatarCode.Text = IsolatedStorageSettings.ApplicationSettings["AvatarCode"].ToString();

                _gender = IsolatedStorageSettings.ApplicationSettings["Gender"].ToString();
                var nickColor = IsolatedStorageSettings.ApplicationSettings["NickColor"] is Color ? (Color)IsolatedStorageSettings.ApplicationSettings["NickColor"] : new Color();

                _viewModel.NickColor = new SolidColorBrush(nickColor);

                if (_gender.Equals("m"))
                {
                    BtnMale.Background = (SolidColorBrush)Application.Current.Resources["ButtonBackground"];
                    BtnFemale.Background = (SolidColorBrush)Application.Current.Resources["TransparentBackground"];
                }
                else if (_gender.Equals("f"))
                {
                    BtnMale.Background = (SolidColorBrush) Application.Current.Resources["TransparentBackground"];
                    BtnFemale.Background = (SolidColorBrush) Application.Current.Resources["ButtonBackground"];
                }
                else
                {
                    BtnMale.Background = (SolidColorBrush)Application.Current.Resources["TransparentBackground"];
                    BtnFemale.Background = (SolidColorBrush)Application.Current.Resources["TransparentBackground"];
                }
            }
        }
Example #15
0
        public static void drawLine(Vector3 pos1, Vector3 pos2, int bold, System.Drawing.Color color)
        {
            var wts1 = Drawing.WorldToScreen(pos1);
            var wts2 = Drawing.WorldToScreen(pos2);

            Drawing.DrawLine(wts1[0], wts1[1], wts2[0], wts2[1], bold, color);
        }
 /// <summary> This implements only the most basic checking for an email address's validity -- that it contains
 /// an '@' contains no characters disallowed by RFC 2822. This is an overly lenient definition of
 /// validity. We want to generally be lenient here since this class is only intended to encapsulate what's
 /// in a barcode, not "judge" it.
 /// </summary>
 internal static bool isBasicallyValidEmailAddress(System.String email)
 {
     if (email == null)
     {
         return false;
     }
     bool atFound = false;
     for (int i = 0; i < email.Length; i++)
     {
         char c = email[i];
         if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && (c < '0' || c > '9') && !isAtextSymbol(c))
         {
             return false;
         }
         if (c == '@')
         {
             if (atFound)
             {
                 return false;
             }
             atFound = true;
         }
     }
     return atFound;
 }
        public object Convert(object[] values,
                              Type targetType,
                              object parameter,
                              System.Globalization.CultureInfo culture)
        {
            if (values == null ||
                values.Length != 2)
            {
                return Visibility.Collapsed;
            }

            if (values[0] is IEnumerable<string>)
            {
                var a = (IEnumerable<string>)values[0];
                var b = values[1];

                if (a.Contains(b) == true)
                {
                    return Visibility.Collapsed;
                }
            }
            else if (values[0] is ItemCollection)
            {
                var a = (ItemCollection)values[0];
                var b = values[1];

                if (a.Contains(b) == true)
                {
                    return Visibility.Collapsed;
                }
            }

            return Visibility.Visible;
        }
Example #18
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     var manager = new TuinManager();
     foreach (Leverancier lev in levOb)
     {
         if (lev.Changed == true)
             GewijzigdeLeveranciers.Add(lev);
         lev.Changed = false;
     }
     if (OudeLeveranciers.Count() != 0 || NieuweLeveranciers.Count() != 0 || GewijzigdeLeveranciers.Count() != 0)
     {
         if (MessageBox.Show("Wilt u alles wegschrijven naar de database ?", "Opslaan", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
         {
             if (OudeLeveranciers.Count() != 0)
                 manager.SchrijfVerwijderingen(OudeLeveranciers);
             else if (NieuweLeveranciers.Count() != 0)
                 manager.SchrijfToevoegingen(NieuweLeveranciers);
             else if (GewijzigdeLeveranciers.Count() != 0)
                 manager.SchrijfWijzigingen(GewijzigdeLeveranciers);
         }
     }
     OudeLeveranciers.Clear();
     NieuweLeveranciers.Clear();
     GewijzigdeLeveranciers.Clear();
 }
        /// <summary>
        /// Helper method for building the error response for the user
        /// </summary>
        /// <param name="errorCode"></param>
        /// <returns></returns>
        internal static HttpResponseMessage BuildResponse(ApiErrorCode errorCode)
        {
            HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
            string message = null;

            switch (errorCode)
            {
                case ApiErrorCode.ExpiredToken:
                    message = ApiErrorMessages.ExpiredToken;
                    statusCode = HttpStatusCode.Unauthorized;
                    break;

                case ApiErrorCode.InvalidToken:
                    message = ApiErrorMessages.InvalidToken;
                    statusCode = HttpStatusCode.Unauthorized;
                    break;
                case ApiErrorCode.UserDoesNotExist:
                    message = ApiErrorMessages.UserNotFound;
                    statusCode = HttpStatusCode.NotModified;
                    break;
                case ApiErrorCode.PasswordIsRequired:
                    message = ApiErrorMessages.PasswordIsRequired;
                    statusCode = HttpStatusCode.BadRequest;
                    break;
            }

            var responseBody = new
            {
                errorCode = errorCode,
                errorMessage = message
            };

            return BuildResponseMessage(statusCode, responseBody);
        }
Example #20
0
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            float floatValue;
            float.TryParse((string)value,System.Globalization.NumberStyles.Number, System.Globalization.CultureInfo.InvariantCulture, out floatValue);

            return ConvertBack(floatValue, (string)parameter);
        }
Example #21
0
        public ExportData(System.Data.DataTable dt, string location)
        {
            //instantiate excel objects (application, workbook, worksheets)
            excel.Application XlObj = new excel.Application();
            XlObj.Visible = false;
            excel._Workbook WbObj = (excel.Workbook)(XlObj.Workbooks.Add(""));
            excel._Worksheet WsObj = (excel.Worksheet)WbObj.ActiveSheet;

            //run through datatable and assign cells to values of datatable

                int row = 1; int col = 1;
                foreach (DataColumn column in dt.Columns)
                {
                    //adding columns
                    WsObj.Cells[row, col] = column.ColumnName;
                    col++;
                }
                //reset column and row variables
                col = 1;
                row++;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //adding data
                    foreach (var cell in dt.Rows[i].ItemArray)
                    {
                        WsObj.Cells[row, col] = cell;
                        col++;
                    }
                    col = 1;
                    row++;
                }
                WbObj.SaveAs(location);
        }
        public void GetQuotes()
        {
            // create list of stocks
            var stocks = new[] { new Stock { Symbol = "MSFT" }, new Stock { Symbol = "YHOO" } };
            var expectedQuotes = new[] { new StockQuote { Symbol = "MSFT" }, new StockQuote { Symbol = "YHOO" } };

            // set up fake logger
            var logger = A.Fake<ILog>();

            // set up first fake data provider
            var marketDataProvider1 = A.Fake<IYahooMarketDataProvider>();
            A.CallTo(() => marketDataProvider1.GetQuotes(A<IEnumerable<Stock>>.Ignored))
             .Throws<Exception>();

            // set up second fake data provider
            var marketDataProvider2 = A.Fake<IYahooMarketDataProvider>();
            A.CallTo(() => marketDataProvider2.GetQuotes(A<IEnumerable<Stock>>.Ignored))
             .Returns(expectedQuotes);

            // create Yahoo market data provider
            var yahooMarketDataProvider = new YahooMarketDataProvider(logger, new[] { marketDataProvider1, marketDataProvider2 });

            // get quotes from provider
            IEnumerable<StockQuote> actualQuotes = yahooMarketDataProvider.GetQuotes(stocks);

            // check that a call was made to get the stock quote select
            A.CallTo(() => marketDataProvider1.GetQuotes(stocks)).MustHaveHappened();
            A.CallTo(() => marketDataProvider2.GetQuotes(stocks)).MustHaveHappened();

            A.CallTo(() => logger.Warn(A<string>.Ignored, A<Exception>.Ignored)).MustHaveHappened();

            // check that quotes returned are the same as the quotes returned by the result translator
            actualQuotes.Should().OnlyContain(q => expectedQuotes.Contains(q));
        }
Example #23
0
	/// <summary>
	///     Changes the language of the <c>Form</c> object provided and all
	///     its MDI children (in the case of MDI UI) to the currently
	///     selected language.
	/// </summary>
	/// <param name="form">
	///     <c>Form</c> object to apply changes to.
	/// </param>
	/// <param name="cultureInfo">
	///     <c>CultureInfo</c> to which language has to be changed.
	/// </param>
	public void ChangeLanguage(System.Windows.Forms.Form form, System.Globalization.CultureInfo cultureInfo) {
		m_cultureInfo = cultureInfo;
		ChangeFormLanguage(form);
		foreach (System.Windows.Forms.Form childForm in form.MdiChildren) {
			ChangeFormLanguage(childForm);
		}
	}
 public void TestSerializeAnonymousClass()
 {
     object a = new { X = 1 };
     var json = a.ToJson();
     var expected = "{ 'X' : 1 }".Replace("'", "\"");
     Assert.AreEqual(expected, json);
 }
        private void ArrayBinding_Load(object sender, System.EventArgs e)
        {
            // Access database
            System.Windows.Forms.DataVisualization.Charting.Utilities.SampleMain.MainForm mainForm = (System.Windows.Forms.DataVisualization.Charting.Utilities.SampleMain.MainForm)this.ParentForm;

            // The XML document
            string fileNameString = mainForm.applicationPath + "\\data\\data.xml";
            string fileNameSchema = mainForm.applicationPath + "\\data\\data.xsd";

            // Initializes a new instance of the DataSet class
            DataSet custDS = new DataSet();

            // Reads an XML schema into the DataSet.
            custDS.ReadXmlSchema( fileNameSchema );

            // Reads XML schema and data into the DataSet.
            custDS.ReadXml( fileNameString );

            // Initializes a new instance of the DataView class
            DataView firstView = new DataView(custDS.Tables[0]);

            Chart1.Series.Clear();
            // Since the DataView implements and IEnumerable, pass the reader directly into
            // the DataBindTable method with the name of the column used for the X value.
            Chart1.DataBindTable(firstView, "Name");

            // Set series appearance
            Chart1.Series[0].ChartType = SeriesChartType.Bar;
            Chart1.Series[0].Font = new Font("Trebuchet MS", 8);
            Chart1.Series[0].Color = System.Drawing.Color.FromArgb(220, 224,64,10);
            Chart1.Series[0].BorderWidth = 0;
        }
Example #26
0
	public Player(string name, System.DateTime birthDate, NeoDatis.Odb.Test.VO.Sport.Sport
		 favoriteSport)
	{
		this.name = name;
		this.birthDate = birthDate;
		this.favoriteSport = favoriteSport;
	}
Example #27
0
        protected void sbmt_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                int createMacroVal = 0;
                if (createMacro.Checked)
                    createMacroVal = 1;

                string xsltName = UmbracoSettings.UseLegacyXmlSchema ? xsltTemplate.SelectedValue :
                    Path.Combine("schema2", xsltTemplate.SelectedValue);

                string returnUrl = dialogHandler_temp.Create(
                    helper.Request("nodeType"),
                    createMacroVal,
                    xsltName + "|||" + rename.Text);

                BasePage.Current.ClientTools
                    .ChangeContentFrameUrl(returnUrl)
                    .ChildNodeCreated()
                    .CloseModalWindow();




            }

        }
Example #28
0
    // Import Message Asset
    private static void ImportParameterAsset(string path, System.Type type)
    {
        try{
            if( File.Exists(path) == false ){
                return;
            }

            string s = File.ReadAllText(path);

            string asset_path = GetAssetPath(path);
            DataClassBase data = AssetDatabase.LoadAssetAtPath(asset_path, type) as DataClassBase;
            if( data == null ){
                data = ScriptableObject.CreateInstance(type) as DataClassBase;
                if( data == null ){
                    return;
                }
                data.Load(s, path);
                AssetDatabase.CreateAsset(data, asset_path);
            }
            else{
                data.Reload(s, path);
            }

            EditorUtility.SetDirty(data);
            AssetDatabase.SaveAssets();
        }
        catch(System.Exception err){
            Debug.Log(err.Message);
            EditorUtility.DisplayDialog("Import Error", "Error File : " + path, "OK");
        }
    }
    public override GroupConfiguration SelectGroupConfiguration( int groupLevel, CollectionViewGroup collectionViewGroup, System.ComponentModel.GroupDescription groupDescription )
    {
      if( m_groupConfigurationSelectorItems.Count == 0 )
        return base.SelectGroupConfiguration( groupLevel, collectionViewGroup, groupDescription );

      string fieldName = string.Empty;

      DataGridGroupDescription dataGridGroupDescription = groupDescription as DataGridGroupDescription;
      if( dataGridGroupDescription != null )
      {
        fieldName = dataGridGroupDescription.PropertyName;
      }
      else
      {
        PropertyGroupDescription propertyGroupDescription = groupDescription as PropertyGroupDescription;
        if( propertyGroupDescription != null )
        {
          fieldName = propertyGroupDescription.PropertyName;
        }
      }

      if( String.IsNullOrEmpty( fieldName ) == true )
        return base.SelectGroupConfiguration( groupLevel, collectionViewGroup, groupDescription );

      FieldNameGroupConfigurationSelectorItem groupConfig = m_groupConfigurationSelectorItems.GetGroupConfigurationSelectorItem( fieldName );
      if( groupConfig != null )
      {
        return groupConfig.GroupConfiguration;
      }

      return base.SelectGroupConfiguration( groupLevel, collectionViewGroup, groupDescription );
    }
Example #30
0
		public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
		{
			if (String.IsNullOrEmpty(name))
				name = Name;

			base.Initialize(name, config);
		}