コード例 #1
0
        public void ViewList()
        {
            UIDocument uidoc = this.ActiveUIDocument;
            Document   doc   = uidoc.Document;
            FilteredElementCollector viewCollector  = new FilteredElementCollector(doc);
            ICollection <ElementId>  collectedViews = viewCollector.OfClass(typeof(ViewPlan)).ToElementIds();

            string viewList  = "";
            int    a         = 0;
            double levelElev = 0;

            foreach (ElementId eid in collectedViews)
            {
                ViewPlan myview = doc.GetElement(eid) as ViewPlan;
                View     view   = doc.GetElement(eid) as View;



                if ((myview.Name != "") && (myview.GenLevel != null) && ViewType.Equals(myview.ViewType, ViewType.FloorPlan))
                {
                    string myViewType = myview.ViewType.ToString();
                    Level  myLevel    = doc.GetElement(myview.GenLevel.Id) as Level;
                    levelElev = myLevel.Elevation * 304.8;
                    viewList += a.ToString() + "_view_" + myview.Name.ToString() + "_LEVEL_" + (Math.Round(levelElev * 10) / 10).ToString() + "_template_" + myview.ViewTemplateId
                                + myViewType + Environment.NewLine;
                    //uidoc.ActiveView = view;
                    a++;
                }
            }
            TaskDialog.Show("ViewsInModel", viewList);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            SummaryParameter other = obj as SummaryParameter;
            if (other == null)
                return false;

            if (!ViewType.Equals(other.ViewType))
                return false;

            if (!PeriodType.Equals(other.PeriodType))
                return false;

            if (Year != null && Year.Equals(other.Year))
                return true;
            else if (Year == null && other.Year != null)
                return false;
            else if (Year == null && other.Year == null)
                return true;
            else if (Month != null && Month.Equals(other.Month))
                return true;
            else if (Month == null && other.Month != null)
                return false;
            else if (Month == null && other.Month == null)
                return true;

            return false;
        }
コード例 #3
0
        public void ViewList()
        {
            UIDocument uidoc = this.ActiveUIDocument;
            Document   doc   = uidoc.Document;
            FilteredElementCollector viewCollector  = new FilteredElementCollector(doc);
            ICollection <ElementId>  collectedViews = viewCollector.OfClass(typeof(ViewPlan)).ToElementIds();

            string viewList = "";
            int    a        = 0;

            foreach (ElementId eId in collectedViews)
            {
                ViewPlan view     = doc.GetElement(eId) as ViewPlan;
                string   viewType = view.ViewType.ToString();
                Element  viewE    = doc.GetElement(eId);

                if (view.Name != "" && view.GenLevel != null && ViewType.Equals(view.ViewType, ViewType.FloorPlan))
                {
                    viewList += view.Name.ToString() + " " + view.GenLevel.Name.ToString() + " "
                                + " " + viewType + Environment.NewLine;
                    a++;
                }
            }

            TaskDialog.Show("ViewsInModel", viewList);
        }
コード例 #4
0
ファイル: NumberView.cs プロジェクト: Wyzzus/hack-moscow-3
    public void Choose()
    {
        if (MyType.Equals(ViewType.Enemy))
        {
            StopAllCoroutines();
            switch (MyType)
            {
            case ViewType.Ally:
                NumbersManager.instance.ResetAlliesBack();
                break;

            case ViewType.Enemy:
                NumbersManager.instance.ResetEnemiesBack();
                break;
            }
            StartCoroutine(Fluct());
        }
    }
コード例 #5
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            Visibility trueValue  = Visibility.Visible;
            Visibility falseValue = Visibility.Collapsed;

            if (IsInverted)
            {
                trueValue  = Visibility.Collapsed;
                falseValue = Visibility.Visible;
            }

            if (ViewType.Equals(value))
            {
                return(trueValue);
            }

            return(falseValue);
        }
コード例 #6
0
        public override bool Equals(object obj)
        {
            SummaryParameter other = obj as SummaryParameter;

            if (other == null)
            {
                return(false);
            }

            if ((ViewType != null && other.ViewType == null) || (ViewType == null && other.ViewType != null) || !ViewType.Equals(other.ViewType))
            {
                return(false);
            }

            if (!PeriodType.Equals(other.PeriodType))
            {
                return(false);
            }

            if (Year != null && Year.Equals(other.Year))
            {
                return(true);
            }
            else if (Year == null && other.Year != null)
            {
                return(false);
            }
            else if (Year == null && other.Year == null)
            {
                return(true);
            }
            else if (Month != null && Month.Equals(other.Month))
            {
                return(true);
            }
            else if (Month == null && other.Month != null)
            {
                return(false);
            }
            else if (Month == null && other.Month == null)
            {
                return(true);
            }

            return(false);
        }