Exemple #1
0
        public MainWindowAdapter(
            Project project, IFieldPathFactory pathFactory,
            PresetView preset, StandardView standard, AdvancedView advanced,
            RetrieveFieldsView fields)
            : base(project)
        {
            _appWidth       = Properties.Settings.Default.AppWidth;
            _appHeight      = Properties.Settings.Default.AppHeight;
            _appWindowState = Properties.Settings.Default.AppWindowState;
            _viewColumnSize = new GridLength(Properties.Settings.Default.ViewColumnSize);

            Preset         = preset;
            Standard       = standard;
            Advanced       = advanced;
            RetrieveFields = fields;
            _views.Add("Preset", preset.Adapter);
            _views.Add("Standard", standard.Adapter);
            _views.Add("Advanced", advanced.Adapter);

            Preset.Adapter.Search   += Adapter_Search;
            Standard.Adapter.Search += Adapter_Search;
            Advanced.Adapter.Search += Adapter_Search;

            ProjectAdapter = new ProjectAdapter(project);
            ProjectAdapter.Project.CurrentConnectionChanged += delegate
            {
                RefreshPaths();
                OnPropertyChanged("ApplicationTitle");
            };
            PathFactory = pathFactory;

            CurrentView             = Preset.Adapter;
            SelectedSubjectChanged += delegate { RefreshPaths(); };
            RefreshPaths();
        }
Exemple #2
0
        private void ProjectServiceOpened(object sender, SledProjectServiceProjectEventArgs e)
        {
            // create before intellisense jobs kick off, as it has to be done on the main thread

            m_project = new ProjectAdapter(e.Project, m_documentService);
            m_broker.ProjectOpened(m_project);
        }
Exemple #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.empty_recycleview, null);

            main = (Activity as MainActivity);

            mRecyclerView  = rootView.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            mLayoutManager = new LinearLayoutManager(rootView.Context);
            mRecyclerView.SetLayoutManager(mLayoutManager);


            mProjects      = new Projects();
            mProjectList   = main.getProjectList();
            mProjectServer = main.getProjectServerList();
            if (mProjectList != null)
            {
                for (int i = 0; i < mProjectList.D.Results.Count; i++)
                {
                    StringBuilder work = new StringBuilder();
                    work.Append(mProjectList.D.Results[i].ProjectWork.TrimEnd(new char[] { '0', '.' }));
                    if (work.ToString().Equals(""))
                    {
                        work.Append("0");
                    }

                    StringBuilder temp = new StringBuilder();
                    temp.Append(mProjectList.D.Results[i].ProjectDuration.TrimEnd(new char[] { '0', '.' }));
                    if (temp.ToString().Equals(""))
                    {
                        temp.Append("0");
                    }
                    int duration = Convert.ToInt32(temp.ToString()) / 8;
                    for (int j = 0; j < mProjectServer.D.Results.Count; j++)
                    {
                        if (mProjectServer.D.Results[j].Name.Equals(mProjectList.D.Results[i].ProjectName))
                        {
                            mProjects.addProjects(
                                mProjectList.D.Results[i].ProjectName,
                                mProjectList.D.Results[i].ProjectPercentCompleted.ToString(),
                                work.ToString() + "h",
                                duration.ToString() + "d",
                                mProjectServer.D.Results[j].IsCheckedOut,
                                mProjectList.D.Results[i].ProjectOwnerName);
                        }
                    }
                }
            }

            mProjectAdapter            = new ProjectAdapter(mProjects, main);
            mProjectAdapter.itemClick += Adapter_ItemClick;
            mRecyclerView.SetAdapter(mProjectAdapter);
            return(rootView);
        }
Exemple #4
0
 public DocumentAdapter(Uri uri, ProjectAdapter project)
 {
     Uri = uri;
     Project = project;
     Name = Path.GetFileNameWithoutExtension(Uri.LocalPath);
 }
Exemple #5
0
        private void ProjectServiceOpened(object sender, SledProjectServiceProjectEventArgs e)
        {
            // create before intellisense jobs kick off, as it has to be done on the main thread

            m_project = new ProjectAdapter(e.Project, m_documentService);
            m_broker.ProjectOpened(m_project);
        }
Exemple #6
0
 public DocumentAdapter(Uri uri, ProjectAdapter project)
 {
     Uri     = uri;
     Project = project;
     Name    = Path.GetFileNameWithoutExtension(Uri.LocalPath);
 }