Example #1
0
        public BoardView(CoreUI ui, BoardService boards, ulong id, uint project)
        {
            InitializeComponent();

            UI     = ui;
            Core   = boards.Core;
            Boards = boards;
            Trust  = Core.Trust;


            UserID    = id;
            ProjectID = project;

            if (UserID != Core.UserID)
            {
                PostButton.Visible    = false;
                RightSplitter.Visible = false;
                ArchiveButton.Visible = false;
            }

            GuiUtils.SetupToolstrip(toolStrip1, new OpusColorTable());

            PostHeader.DocumentText = HeaderPage.ToString();

            PostView.SmallImageList = new List <Image>();
            PostView.SmallImageList.Add(BoardRes.post);
            PostView.SmallImageList.Add(BoardRes.higher);
            PostView.SmallImageList.Add(BoardRes.lower);

            PostView.OverlayImages.Add(BoardRes.high_scope);
            PostView.OverlayImages.Add(BoardRes.low_scope);

            PostBody.Core = Core;
        }
Example #2
0
        public PlanService(OpCore core)
        {
            Core     = core;
            Network  = core.Network;
            Protocol = Network.Protocol;
            Store    = Network.Store;
            Trust    = Core.Trust;

            if (Core.Sim != null)
            {
                SaveInterval = 30;
            }

            Core.SecondTimerEvent += Core_SecondTimer;

            Cache = new VersionedCache(Network, ServiceID, DataTypeFile, false);

            Cache.FileAquired += new FileAquiredHandler(Cache_FileAquired);
            Cache.FileRemoved += new FileRemovedHandler(Cache_FileRemoved);
            Cache.Load();

            if (!PlanMap.SafeContainsKey(Core.UserID))
            {
                LocalPlan = new OpPlan(new OpVersionedFile(Core.User.Settings.KeyPublic));
                LocalPlan.Init();
                LocalPlan.Loaded = true;
                PlanMap.SafeAdd(Core.UserID, LocalPlan);
            }
        }
Example #3
0
        private void LoadTrustTree()
        {
            TrustService trust = Core.Trust;

            // add projects to combo
            trust.ProjectRoots.LockReading(delegate()
            {
                foreach (uint id in trust.ProjectRoots.Keys)
                {
                    string name = "";

                    if (id == 0)
                    {
                        name = "Main";
                    }
                    else
                    {
                        name = trust.GetProjectName(id);
                    }

                    ProjectCombo.Items.Add(new AddProjectItem(id, name));
                }
            });

            TrustTree.FirstLineBlank = false;
            TrustTree.Init(trust);

            TrustTree.MultiSelect = true;
        }
Example #4
0
        public ScheduleView(CoreUI ui, PlanService plans, ulong id, uint project)
        {
            InitializeComponent();

            UI    = ui;
            Core  = ui.Core;
            Plans = plans;
            Trust = Core.Trust;

            UserID    = id;
            ProjectID = project;

            StartTime = Core.TimeNow;
            EndTime   = Core.TimeNow.AddMonths(3);

            GuiUtils.SetupToolstrip(TopStrip, new OpusColorTable());

            MainSplit.Panel2Collapsed = true;

            Core.KeepDataGui += new KeepDataHandler(Core_KeepData);

            PlanStructure.NodeExpanding += new EventHandler(PlanStructure_NodeExpanding);
            PlanStructure.NodeCollapsed += new EventHandler(PlanStructure_NodeCollapsed);

            // set last block so that setdetails shows correctly
            LastBlock = new PlanBlock();
            SetDetails(null);
        }
Example #5
0
        public LinkNode(OpLink link, LinkTree parent)
        {
            Link       = link;
            ParentView = parent;
            Trust      = parent.Trust;
            Locations  = parent.Core.Locations;

            UpdateStatus();
        }
Example #6
0
        public ProfileView(ProfileService profile, ulong id, uint project)
        {
            InitializeComponent();

            Profiles = profile;
            Core     = profile.Core;
            Trust    = Core.Trust;

            UserID    = id;
            ProjectID = project;
        }
Example #7
0
        public EditProfile(ProfileService control, ProfileView view)
        {
            InitializeComponent();

            Core     = control.Core;
            Links    = Core.Trust;
            Profiles = control;
            MainView = view;

            TextFields = new Dictionary <string, string>(view.TextFields);
            FileFields = new Dictionary <string, string>(view.FileFields);
        }
Example #8
0
        public EditLink(OpCore core, uint id)
            : base(core)
        {
            InitializeComponent();

            Core  = core;
            Trust = core.Trust;

            ProjectID = id;

            AwayCheckBox.Checked = Core.Locations.LocalAway;
            AwayMessage.Enabled  = Core.Locations.LocalAway;
            AwayMessage.Text     = Core.User.Settings.AwayMessage;
        }
Example #9
0
        public void Init(TrustService trust)
        {
            Trust = trust;
            Core  = trust.Core;

            Core.Locations.GuiUpdate += new LocationGuiUpdateHandler(Locations_Update);
            Trust.GuiUpdate          += new LinkGuiUpdateHandler(Trust_Update);
            Core.KeepDataGui         += new KeepDataHandler(Core_KeepData);

            SelectedLink = Core.UserID;

            SelectedItemChanged += new EventHandler(LinkTree_SelectedItemChanged);
            NodeExpanding       += new EventHandler(LinkTree_NodeExpanding);
            NodeCollapsed       += new EventHandler(LinkTree_NodeCollapsed);
        }
        protected void ExecuteQueryContext(QueryContext context)
        {
            // Keep search until the maxlevel is hit or matchlevel is hit
            while (context.Level < context.MaxLevel && context.Targets.Count > 0)
            {
                context.Level++;
                context.Visited.SetAll(false); // Reset visited

                SearchIssuer(context, context.Issuer);

                ClearTargets(context);
            }

            TrustService.BuildPackage(context);
        }
Example #11
0
        public DetailsForm(StorageView view, FolderNode folder)
        {
            InitializeComponent();

            View         = view;
            Trust        = View.Trust;
            TargetFolder = folder;

            EnableControls(View.Working != null);

            NameBox.Text = folder.Text;

            SizeLabel.Text = "Contains " + Utilities.CommaIze(CalculateFolderSize(folder, 0)) + " Bytes";

            LoadVis(folder.Details.Scope);
        }
Example #12
0
        public MailView(MailUI ui)
        {
            InitializeComponent();

            UI    = ui;
            Mail  = ui.Mail;
            Core  = ui.Core;
            Trust = Core.Trust;

            MessageView.SmallImageList = new List <Image>();
            MessageView.SmallImageList.Add(MailRes.recvmail);
            MessageView.SmallImageList.Add(MailRes.sentmail);

            MessageHeader.DocumentText = HeaderPage.ToString();

            GuiUtils.SetupToolstrip(toolStrip1, new OpusColorTable());

            MessageBody.Core = Core;
        }
Example #13
0
        public DetailsForm(StorageView view, FolderNode folder, FileItem file)
        {
            InitializeComponent();

            View  = view;
            Core  = View.Core;
            Trust = View.Trust;

            TargetFolder = folder;
            TargetFile   = file;

            EnableControls(View.Working != null);

            NameBox.Text = file.Text;

            SizeLabel.Text = Utilities.CommaIze(((StorageFile)file.Details).InternalSize) + " Bytes";

            LoadVis(file.Details.Scope);
        }
Example #14
0
        public GoalsView(CoreUI ui, PlanService plans, ulong id, uint project)
        {
            InitializeComponent();

            UI    = ui;
            Core  = ui.Core;
            Plans = plans;
            Trust = Core.Trust;

            UserID    = id;
            ProjectID = project;

            GuiUtils.SetupToolstrip(toolStrip1, new OpusColorTable());

            GuiUtils.FixMonoDropDownOpening(SelectGoalButton, SelectGoal_DropDownOpening);

            splitContainer1.Panel2Collapsed = true;

            SetDetails(null, null);
        }
Example #15
0
        public void Init(GoalsView view)
        {
            View  = view;
            Core  = View.Core;
            Plans = view.Plans;
            Trust = Core.Trust;

            GoalTree.NodeExpanding += new EventHandler(GoalTree_NodeExpanding);
            GoalTree.NodeCollapsed += new EventHandler(GoalTree_NodeCollapsed);

            GoalTree.ControlPadding = 3;

            GoalTree.SmallImageList = new List <Image>();
            GoalTree.SmallImageList.Add(new Bitmap(16, 16));
            GoalTree.SmallImageList.Add(PlanRes.star);
            GoalTree.SmallImageList.Add(PlanRes.high_goal);
            GoalTree.SmallImageList.Add(PlanRes.low_goal);

            DelegateLink.Hide();
            AddItemLink.Hide();
        }
Example #16
0
        public ProfileService(OpCore core)
        {
            Core     = core;
            Network  = core.Network;
            Protocol = Network.Protocol;
            Store    = Network.Store;
            Trust    = Core.Trust;

            ExtractPath = Core.User.RootPath + Path.DirectorySeparatorChar +
                          "Data" + Path.DirectorySeparatorChar +
                          ServiceID.ToString() + Path.DirectorySeparatorChar +
                          DataTypeExtracted.ToString();

            Cache = new VersionedCache(Network, ServiceID, DataTypeFile, false);

            Cache.FileAquired += new FileAquiredHandler(Cache_FileAquired);
            Cache.FileRemoved += new FileRemovedHandler(Cache_FileRemoved);
            Cache.Load();

            if (!ProfileMap.SafeContainsKey(Core.UserID))
            {
                SaveLocal(DefaultTemplate, null, null);
            }
        }
Example #17
0
        public ChatService(OpCore core)
        {
            Core    = core;
            Network = Core.Network;
            Trust   = core.Trust;

            Network.RudpControl.SessionUpdate             += new SessionUpdateHandler(Session_Update);
            Network.RudpControl.SessionData[ServiceID, 0] += new SessionDataHandler(Session_Data);
            Network.RudpControl.KeepActive += new KeepActiveHandler(Session_KeepActive);

            Core.SecondTimerEvent += Core_SecondTimer;
            Core.KeepDataCore     += new KeepDataHandler(Core_KeepData);

            Core.Locations.KnowOnline     += new KnowOnlineHandler(Location_KnowOnline);
            Core.Locations.LocationUpdate += new LocationUpdateHandler(Location_Update);

            if (Trust != null)
            {
                Trust.LinkUpdate += new LinkUpdateHandler(Link_Update);
                Link_Update(Trust.LocalTrust);
            }

            TempLocation = new TempCache(Network, ServiceID, DataTypeLocation);
        }
Example #18
0
 public TrustUI(CoreUI ui, OpService service)
 {
     UI    = ui;
     Core  = ui.Core;
     Trust = service as TrustService;
 }
Example #19
0
        public StorageService(OpCore core)
        {
            Core     = core;
            Network  = core.Network;
            Protocol = Network.Protocol;
            Store    = Network.Store;
            Trust    = Core.Trust;

            Core.SecondTimerEvent += Core_SecondTimer;
            Core.MinuteTimerEvent += Core_MinuteTimer;

            Network.CoreStatusChange += new StatusChange(Network_StatusChange);

            Core.Transfers.FileSearch[ServiceID, FileTypeData]  += new FileSearchHandler(Transfers_DataFileSearch);
            Core.Transfers.FileRequest[ServiceID, FileTypeData] += new FileRequestHandler(Transfers_DataFileRequest);

            Core.Trust.LinkUpdate += new LinkUpdateHandler(Trust_Update);

            LocalFileKey  = Core.User.Settings.FileKey;
            FileCrypt.Key = LocalFileKey;
            FileCrypt.IV  = new byte[FileCrypt.IV.Length];

            string rootpath = Core.User.RootPath + Path.DirectorySeparatorChar + "Data" + Path.DirectorySeparatorChar + ServiceID.ToString() + Path.DirectorySeparatorChar;

            DataPath     = rootpath + FileTypeData.ToString();
            WorkingPath  = rootpath + FileTypeWorking.ToString();
            ResourcePath = rootpath + FileTypeResource.ToString();

            Directory.CreateDirectory(DataPath);
            Directory.CreateDirectory(WorkingPath);

            // clear resource files so that updates of these files work
            if (Directory.Exists(ResourcePath))
            {
                Directory.Delete(ResourcePath, true);
            }

            Cache = new VersionedCache(Network, ServiceID, FileTypeCache, false);

            Cache.FileAquired += new FileAquiredHandler(Cache_FileAquired);
            Cache.FileRemoved += new FileRemovedHandler(Cache_FileRemoved);
            Cache.Load();


            // load working headers
            OpStorage local = GetStorage(Core.UserID);

            foreach (uint project in Trust.LocalTrust.Links.Keys)
            {
                if (local != null)
                {
                    LoadHeaderFile(GetWorkingPath(project), local, false, true);
                }

                Working[project] = new WorkingStorage(this, project);

                bool doSave = false;
                foreach (ulong higher in Trust.GetAutoInheritIDs(Core.UserID, project))
                {
                    if (Working[project].RefreshHigherChanges(higher))
                    {
                        doSave = true;
                    }
                }

                Working[project].AutoIntegrate(doSave);
            }

            foreach (string testPath in Directory.GetFiles(DataPath))
            {
                if (!ReferencedPaths.Contains(testPath))
                {
                    try { File.Delete(testPath); }
                    catch { }
                }
            }

            ReferencedPaths.Clear();
            Loading = false;
        }